summaryrefslogtreecommitdiff
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-07-02 17:46:14 +0000
committerSean Bright <sean@malleable.com>2009-07-02 17:46:14 +0000
commit719917fe59724bf2372d285094918f61bb442494 (patch)
tree217bddbe9752bc9d7d91a1aaac0610745b5be3f3 /channels/sig_pri.c
parent48c9a85d91932390c9f841a0302f44517a122c17 (diff)
Support setting and receiving Reverse Charging Indication over ISDN PRI.
This is a continuation of revision 885 to LibPRI (Capture and expose the Reverse Charging Indication IE on ISDN PRI) which added the ability to get/set Reverse Charging Indication in LibPRI. This patch adds the ability to specify RCI on the outbound leg of a PRI call from within Asterisk, by prefixing the dialed number with a capital 'C' like: ...,Dial(DAHDI/g1/C4445556666) And to read it off an inbound channel: exten => s,1,Set(RCI=${CHANNEL(reversecharge)}) Thanks again to rmudgett for the thorough review. (closes issue #13760) Reported by: mrgabu Review: https://reviewboard.asterisk.org/r/303/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 464dde23a..aac40616e 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -1163,7 +1163,8 @@ static void *pri_dchannel(void *vpri)
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 @@ static void *pri_dchannel(void *vpri)
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 @@ int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, i
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",