rendered paste bodyIndex: 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",