[asterisk-bugs] [JIRA] Created: (ASTERISK-20185) Parsing a label beginning with a numeric character in all Goto/GotoIf/GotoIfTime application causes unexpected behavior

Rusty Newton (JIRA) noreply at issues.asterisk.org
Wed Aug 1 09:35:21 CDT 2012


Parsing a label beginning with a numeric character in all Goto/GotoIf/GotoIfTime application causes unexpected behavior
-----------------------------------------------------------------------------------------------------------------------

                 Key: ASTERISK-20185
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20185
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: PBX/General
    Affects Versions: 1.8.8.2, 1.8.9.3, 1.8.10.1, 1.8.11.1, 1.8.12.2, 1.8.13.1, 1.8.14.0, 1.8.14.1
         Environment: Debian 6.0 latest version
Debian 5.0 latest version
            Reporter: Janu


Hello everyone,

While programming some parts of my asterisk dialplan, I've noticed thant in some cases, all GoTo aplications fail jumping into certain labels.

When I set a label starting with a number (like "4secs"), The GoTo statement jumps to priority number 4 instead of jumping into priority "4secs".

He're you have the dialplan explained above:

[test]
exten => _63XX,1,NoOP(Dialed ${EXTEN})
exten => _63XX,n,GotoIf($["${EXTEN}"= "6358"]?4secs)
exten => _63XX,n,Wait(1)
exten => _63XX,n,Dial(SIP/${EXTEN:2},10)
exten => _63XX,n(4secs),Dial(SIP/58,4)
exten => _63XX,n,Hangup

And the execution tests:

-- Executing [6358 at test:1] NoOp("SIP/59-0001426c", "Dialed 6358") in new stack
-- Executing [6358 at test:2] GotoIf("SIP/59-0001426c", "1?4secs") in new stack
-- Goto (test,6358,4)
-- Executing [6358 at test:4] Dial("SIP/59-0001426c", "SIP/58|10") in new stack
-- Called 58
-- SIP/58-0001426d is ringing
== Spawn extension (test, 6358, 4) exited non-zero on 'SIP/59-0001426c'

After some research, I found the problem in the code files:

FILE:
main/pbx.c

FUNCTION:
static int pbx_parseable_goto(struct ast_channel *chan, const char *goto_string, int async)

LINE:
if (sscanf(pri, "%30d", &ipri) != 1) {   

In this Statement, if we have som digits at the start of a label. The return of sscanf is equal to 1, and We fail for labels like (4secs)

Thanks for your support!

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list