From: Joshua Colp Date: Fri, 1 Sep 2006 16:19:03 +0000 (+0000) Subject: If no number is specified in the SIP_HEADER dialplan function, then just use the... X-Git-Tag: 1.4.0-beta1~217 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ee7419d26808578d36698585b88e27fadfa4a2f;p=thirdparty%2Fasterisk.git If no number is specified in the SIP_HEADER dialplan function, then just use the first one. (issue #7854 reported by sxpert and issue #7863 reported by hristo) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41689 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a5c4d694cc..f841816dfc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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;