If no number is specified in the SIP_HEADER dialplan function, then just use the...
authorJoshua Colp <jcolp@digium.com>
Fri, 1 Sep 2006 16:19:03 +0000 (16:19 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 1 Sep 2006 16:19:03 +0000 (16:19 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41689 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index a5c4d69..f841816 100644 (file)
@@ -10909,9 +10909,13 @@ static int func_header_read(struct ast_channel *chan, char *function, char *data
        }
 
        AST_STANDARD_APP_ARGS(args, data);
-       sscanf(args.number, "%d", &number);
-       if (number < 1)
+       if (!args.number) {
                number = 1;
+       } else {
+               sscanf(args.number, "%d", &number);
+               if (number < 1)
+                       number = 1;
+       }
 
        p = chan->tech_pvt;