diff options
author | Sean Bright <sean@malleable.com> | 2009-07-02 17:46:14 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2009-07-02 17:46:14 +0000 |
commit | 719917fe59724bf2372d285094918f61bb442494 (patch) | |
tree | 217bddbe9752bc9d7d91a1aaac0610745b5be3f3 /channels/chan_dahdi.c | |
parent | 48c9a85d91932390c9f841a0302f44517a122c17 (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/chan_dahdi.c')
-rw-r--r-- | channels/chan_dahdi.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index 7df0b592b..8a93673d0 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -5403,7 +5403,7 @@ static int dahdi_func_read(struct ast_channel *chan, const char *function, char { struct dahdi_pvt *p = chan->tech_pvt; int res = 0; - + if (!strcasecmp(data, "rxgain")) { ast_mutex_lock(&p->lock); snprintf(buf, len, "%f", p->rxgain); @@ -5412,8 +5412,19 @@ static int dahdi_func_read(struct ast_channel *chan, const char *function, char ast_mutex_lock(&p->lock); snprintf(buf, len, "%f", p->txgain); ast_mutex_unlock(&p->lock); +#ifdef HAVE_PRI + } else if (!strcasecmp(data, "reversecharge")) { + ast_mutex_lock(&p->lock); + if (p->sig == SIG_PRI || p->sig == SIG_BRI || p->sig == SIG_BRI_PTMP) { + snprintf(buf, len, "%d", ((struct sig_pri_chan *) p->sig_pvt)->reverse_charging_indication); + } else { + *buf = '\0'; + res = -1; + } + ast_mutex_unlock(&p->lock); +#endif } else { - ast_copy_string(buf, "", len); + *buf = '\0'; res = -1; } |