Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv16550/channels

Modified Files:
        chan_zap.c 
Log Message:
Correctly choose end of number (i.e. if it ends in 'w' with nothing following)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.425
retrieving revision 1.426
diff -u -d -r1.425 -r1.426
--- chan_zap.c  5 Apr 2005 20:23:26 -0000       1.425
+++ chan_zap.c  6 Apr 2005 19:17:21 -0000       1.426
@@ -57,7 +57,7 @@
 #include <ctype.h>
 #ifdef ZAPATA_PRI
 #include <libpri.h>
-#ifndef PRI_REDIRECTING_REASON
+#ifndef PRI_AOC_UNITS
 #error "You need newer libpri"
 #endif
 #endif
@@ -1835,11 +1835,12 @@
                        p->dop.op = ZT_DIAL_OP_REPLACE;
                        s = strchr(c + p->stripmsd, 'w');
                        if (s) {
-                               if (strlen(s))
+                               if (strlen(s) > 1)
                                        snprintf(p->dop.dialstr, 
sizeof(p->dop.dialstr), "T%s", s);
                                else
                                        p->dop.dialstr[0] = '\0';
                                *s = '\0';
+                               s++;
                        } else {
                                p->dop.dialstr[0] = '\0';
                        }
@@ -1889,7 +1890,7 @@
                                pridialplan = PRI_LOCAL_ISDN;
                        }
                }
-               pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan,  
s ? 1 : 0);
+               pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan,  
(s && *s) ? 1 : 0);
 
                ldp_strip = 0;
                prilocaldialplan = p->pri->localdialplan - 1;

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to