]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
DNID does not get cleard on a new call when using immediate=yes with ISDN signaling.
authorRichard Mudgett <rmudgett@digium.com>
Thu, 22 Jul 2010 19:31:34 +0000 (19:31 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 22 Jul 2010 19:31:34 +0000 (19:31 +0000)
When you are using chan_dahdi ISDN signaling with immediate=yes and a call
comes in without a DNID then you get the DNID of a previous call.
Chan_dahdi does not touch the DNID field on a new call if it does not have
a DNID.

Made always copy the DNID from the new call.

The patches backport the relevant changes from trunk -r210387.

(closes issue #17568)
Reported by: wuwu
Patches:
      issue17568_v1.4.patch uploaded by rmudgett (license 664)
      issue17568_v1.6.2.patch uploaded by rmudgett (license 664)

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

channels/chan_dahdi.c

index b5960143f94e51324e03efcfc83f8edba686f35f..1e4713c6d7df570917f5dd934a38722549b987a5 100644 (file)
@@ -9485,6 +9485,10 @@ static void *pri_dchannel(void *vpri)
                                        }
                                        apply_plan_to_number(pri->pvts[chanpos]->rdnis, sizeof(pri->pvts[chanpos]->rdnis), pri,
                                                             e->ring.redirectingnum, e->ring.callingplanrdnis);
+
+                                       /* Set DNID on all incoming calls -- even immediate */
+                                       ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
+
                                        /* If immediate=yes go to s|1 */
                                        if (pri->pvts[chanpos]->immediate) {
                                                if (option_verbose > 2)
@@ -9495,7 +9499,6 @@ static void *pri_dchannel(void *vpri)
                                        /* Get called number */
                                        else if (!ast_strlen_zero(e->ring.callednum)) {
                                                ast_copy_string(pri->pvts[chanpos]->exten, e->ring.callednum, sizeof(pri->pvts[chanpos]->exten));
-                                               ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
                                        } else if (pri->overlapdial)
                                                pri->pvts[chanpos]->exten[0] = '\0';
                                        else {
@@ -9503,9 +9506,6 @@ static void *pri_dchannel(void *vpri)
                                                pri->pvts[chanpos]->exten[0] = 's';
                                                pri->pvts[chanpos]->exten[1] = '\0';
                                        }
-                                       /* Set DNID on all incoming calls -- even immediate */
-                                       if (!ast_strlen_zero(e->ring.callednum))
-                                               ast_copy_string(pri->pvts[chanpos]->dnid, e->ring.callednum, sizeof(pri->pvts[chanpos]->dnid));
                                        /* No number yet, but received "sending complete"? */
                                        if (e->ring.complete && (ast_strlen_zero(e->ring.callednum))) {
                                                if (option_verbose > 2)