]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Set the CALLERID(dnid-num-plan) for incoming ISDN calls.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 25 Mar 2013 23:19:06 +0000 (23:19 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 25 Mar 2013 23:19:06 +0000 (23:19 +0000)
The CALLEDTON channel variable is set for incoming ISDN calls to the lower
7 bits of the Q.931 type-of-number/numbering-plan octet.  The
CALLERID(dnid-num-plan) should have the same value.

(closes issue ASTERISK-21248)
Reported by: rmudgett

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@383796 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/sig_pri.c

index e9536e63917836b80fc20898482b547c1880349a..fcd24661b8d432ad61cf8bd9b59897db52d016fd 100644 (file)
@@ -5349,6 +5349,10 @@ static void *pri_dchannel(void *vpri)
 
                                                        snprintf(calledtonstr, sizeof(calledtonstr), "%d", e->ring.calledplan);
                                                        pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
+                                                       ast_channel_lock(c);
+                                                       c->dialed.number.plan = e->ring.calledplan;
+                                                       ast_channel_unlock(c);
+
                                                        if (e->ring.redirectingreason >= 0) {
                                                                /* This is now just a status variable.  Use REDIRECTING() dialplan function. */
                                                                pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason));
@@ -5487,10 +5491,12 @@ static void *pri_dchannel(void *vpri)
 
                                                        snprintf(calledtonstr, sizeof(calledtonstr), "%d", e->ring.calledplan);
                                                        pbx_builtin_setvar_helper(c, "CALLEDTON", calledtonstr);
+                                                       ast_channel_lock(c);
+                                                       c->dialed.number.plan = e->ring.calledplan;
+                                                       ast_channel_unlock(c);
 
                                                        sig_pri_handle_subcmds(pri, chanpos, e->e, e->ring.channel,
                                                                e->ring.subcmds, e->ring.call);
-
                                                }
                                                if (c && !ast_pbx_start(c)) {
                                                        ast_verb(3, "Accepting call from '%s' to '%s' on channel %d/%d, span %d\n",