Index: channels/sig_pri.h =================================================================== --- channels/sig_pri.h (revision 204649) +++ channels/sig_pri.h (working copy) @@ -162,6 +162,7 @@ struct sig_pri_callback *calls; void *chan_pvt; ast_mutex_t service_lock; /*!< Mutex for service messages */ + int reverse_charging_indication:3; }; struct sig_pri_pri { Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 204649) +++ channels/chan_dahdi.c (working copy) @@ -5412,6 +5412,15 @@ ast_mutex_lock(&p->lock); snprintf(buf, len, "%f", p->txgain); ast_mutex_unlock(&p->lock); +#if HAVE_PRI + } else if (!strcasecmp(data, "reversecharge")) { + ast_mutex_lock(&p->lock); + if (p->sig == SIG_PRI) { + struct sig_pri_pri *pri = p->pri; + /* snprintf(buf, len, "%d", p->reverse_charge_indication); */ + } + ast_mutex_unlock(&p->lock); +#endif } else { ast_copy_string(buf, "", len); res = -1; Index: channels/sig_pri.c =================================================================== --- channels/sig_pri.c (revision 204649) +++ channels/sig_pri.c (working copy) @@ -1163,7 +1163,8 @@ pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr); if (e->ring.redirectingreason >= 0) pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason)); - + pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge; + sig_pri_lock_private(pri->pvts[chanpos]); ast_mutex_lock(&pri->lock); @@ -1208,7 +1209,8 @@ if (e->ring.redirectingreason >= 0) pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason)); - + pri->pvts[chanpos]->reverse_charging_indication = e->ring.reversecharge; + snprintf(calledtonstr, sizeof(calledtonstr)-1, "%d", e->ring.calledplan); pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr); @@ -1888,6 +1890,11 @@ case 'r': pridialplan = PRI_NPI_RESERVED | (pridialplan & 0xf0); break; +#if defined(PRI_REVERSECHARGE_REQUESTED) + case 'c': + pri_sr_set_reversecharge(sr, PRI_REVERSECHARGE_REQUESTED); + break; +#endif default: if (isalpha(c[p->stripmsd])) { ast_log(LOG_WARNING, "Unrecognized pridialplan %s modifier: %c\n", Index: configs/chan_dahdi.conf.sample =================================================================== --- configs/chan_dahdi.conf.sample (revision 204649) +++ configs/chan_dahdi.conf.sample (working copy) @@ -77,6 +77,11 @@ ;service_message_support=yes ; Enable service message support for channel. Must be set after switchtype. ; +; PRI Reverse Charging Indication: Indicate to the called party that the +; incoming call will be reverse charged. To enable, prefix the dialed number +; with one of the following letters: +; C - Reverse Charge Indication Requested +; ; PRI Dialplan: The ISDN-level Type Of Number (TON) or numbering plan, used for ; the dialed number. For most installations, leaving this as 'unknown' (the ; default) works in the most cases. In some very unusual circumstances, you @@ -104,7 +109,7 @@ ;pridialplan=unknown ;prilocaldialplan=national ; -; pridialplan may be also set at dialtime, by prefixing the dialled number with +; pridialplan may be also set at dialtime, by prefixing the dialed number with ; one of the following letters: ; U - Unknown ; I - International