[SOLVED] Unparseable GoToIf(). Not A Bug!


#1

TURNS OUT THAT IT WASNT THE GOTO BUT THE RANDOM() BEFORE IT WHICH LACKED THE : AFTER THE INTEGER.

THANKS A BUNCH TO QWELL FOR BEING THE ONLY PERSON I SPOKE TO ASTUTE ENOUGH TO NOTICE THAT IT WASNT THE GOTOIF(), BUT THE RANDOM() BEFORE IT WHICH WAS WRONG.

EVERYTHING WORKS FINE NOW. IF YOU WANT TO SEE MY EXERCISE IN FUTILITY CHECK BELOW. YOU MAY JUST LAUGH AT ME.

===================================================================================

that’s the code that fails. the CLI says its a syntax error (see below for details).

so i set up a test scenario in another context

[gototest] exten => Marc,1,set(__CLEANER[1]=NoOne) exten => Marc,2,noop(${CLEANER[1]} is the value. Print "correct"..... exten => Marc,3,gotoif($["${CLEANER[1]}" = "Marc"]?4:5) exten => Marc,4,noop(something is terribly wrong) exten => Marc,5,noop(correct)

and the CLI spits out.

[quote]== Parsing ‘/etc/asterisk/sip_notify.conf’: Found
– Executing Goto(“SIP/Brian-4f2d”, “gototest|Marc|1”) in new stack
– Goto (gototest,Marc,1)
– Executing Set(“SIP/Brian-4f2d”, “__CLEANER[1]=NoOne”) in new stack
– Executing NoOp(“SIP/Brian-4f2d”, “NoOne is the value. Print “correct” if nothing is terribly wrong”) in new stack
– Executing GotoIf(“SIP/Brian-4f2d”, “0?4:5”) in new stack
– Goto (gototest,Marc,5)
– Executing NoOp(“SIP/Brian-4f2d”, “correct”) in new stack[/quote]

So in that context there is no problem with my syntax.

================================================================================

First some background: Just for experience i wanted to write some dialplan to “draw straws” for who wins the chance to clean my appartment.

Its pretty simple. The first part sets variables $ROOMMATE[1] - $ROOMATE[6] and assigns them a respective corresponding weight in MATEWEIGHT[1] -[6].

This part works fine and is relatively simple

[code][riah]
;who are the roommates?
exten => s,1,set(__ROOMMATE[1]=Brad)
exten => s,2,set(__ROOMMATE[2]=Brian)
exten => s,3,set(__ROOMMATE[3]=James)
exten => s,4,set(__ROOMMATE[4]=Jeff)
exten => s,5,set(__ROOMMATE[5]=Marc)
exten => s,6,set(__ROOMMATE[6]=Aubrey)

;for each roommate prompt for a weight
exten => s,7,set(__COUNT=1) ;set roommate counter
exten => s,8,while($[${COUNT}<7]) ;while we havent assigned a weight
exten => s,9,background(beep) ;prompt with a tone…
exten => s,10,waitexten(5) ;and givem five seconds to resppond
exten => s,11,set(__COUNT=$[${COUNT}+1]) ;then increment the counter
exten => s,12,endwhile

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;take the weight and build the array;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
exten => _X,1,set(__MATEWEIGHT[${COUNT}]= ${EXTEN})
exten => _X,n,goto(s,11) ;then repeat
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;[/code]

then another while loop cycles throught the roomates, jumps to an extension based on their name, and draws a straw .Again, I KNOW this part is working fine because i see in the CLI the prioroty 23 NoOp

exten => s,13,set(__WINNERS=0) ;at first we have no winners exten => s,14,set(__CLEANER[1]=NoOne) ;avoid null value exten => s,15,while($[${WINNERS} < 2]) ;while we dont have two winners... exten => s,16,noop(${CLEANER[1]}) exten => s,17,goto(Brad,1) exten => s,18,goto(Brian,1) exten => s,19,goto(James,1) exten => s,20,goto(Jeff,1) exten => s,21,goto(Marc,1) exten => s,22,goto(Aubrey,1) exten => s,23,noop(END OF THE LOOP. HOW MANY WINNERS? ${WINNERS}) exten => s,24,endwhile

Finally, there are the extensions corresponding to the roomates that draw a straw. They are all identical to the following code. For brevity i’ll only paste one here.

exten => Marc,1,random(${MATEWEIGHT[5]},Marc,3) ;goto pri. 3 if we have a winner exten => Marc,2,goto(s,22) ;or else draw again. exten => Marc,3,gotoif($["${CLEANER[1]}" = "Marc"]?2) ;did we just pick him? exten => Marc,4,set(__WINNERS=$[${WINNERS}+1]) ;if not we have a winner exten => Marc,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[5]}) ;and we set exten => Marc,6,goto(s,22) ;assume we need to draw again for now


THIS is where it fails, and always on that goto, only when I have a winner. I will see the s,23 noop go by two or three times, but as soon as i draw a straw, the IDENTICAL gotoif statement fails, where it doesnt in my test context. described above

Here is the last part of the error as reported in the CLI. Since it is random it will fail on any given roommate, but i posted a case where it failed on the second one so you can see the NoOp proving I get to the end of that last While

[quote] – Executing NoOp(“SIP/Brian-be1d”, “END OF THE LOOP. HOW MANY WINNERS? 0”) in new stack
– Executing EndWhile(“SIP/Brian-be1d”, “”) in new stack
– Executing While(“SIP/Brian-be1d”, “1”) in new stack
– Executing NoOp(“SIP/Brian-be1d”, “NoOne”) in new stack
– Executing Goto(“SIP/Brian-be1d”, “Brad|1”) in new stack
– Goto (riah,Brad,1)
– Executing NoOp(“SIP/Brian-be1d”, “we made it here NoOne”) in new stack
– Executing Random(“SIP/Brian-be1d”, " 9|Brad|3") in new stack
– Executing Goto(“SIP/Brian-be1d”, “s|18”) in new stack
– Goto (riah,s,18)
– Executing Goto(“SIP/Brian-be1d”, “Brian|1”) in new stack
– Goto (riah,Brian,1)
– Executing Random(“SIP/Brian-be1d”, " 9|Brian|3") in new stack
Apr 17 04:46:45 WARNING[2082]: pbx.c:6455 ast_parseable_goto: Goto requires an argument (optional context|optional extension|priority)
– Random branches to (riah,Brian,2)

[/quote]
[u][i][size=150]

I’m pretty sure this is a bug. Can someone help me verify?[/size][/i][/u]

If you want to test the code im gonna now skip a few lines and paste the entire context. Please try that before telling me to add or remove a space as i’ve tried every reasonable syntax people on IRC and I could think of.

[code]
[riah]
;who are the roommates?
exten => s,1,set(__ROOMMATE[1]=Brad)
exten => s,2,set(__ROOMMATE[2]=Brian)
exten => s,3,set(__ROOMMATE[3]=James)
exten => s,4,set(__ROOMMATE[4]=Jeff)
exten => s,5,set(__ROOMMATE[5]=Marc)
exten => s,6,set(__ROOMMATE[6]=Aubrey)

;for each roommate prompt for a weight
exten => s,7,set(__COUNT=1) ;set roommate counter
exten => s,8,while($[${COUNT}<7]) ;while we havent assigned a weight to all the roommates…
exten => s,9,background(beep) ;prompt with a tone…
exten => s,10,waitexten(5) ;and givem five seconds to enter an extension 0-9
exten => s,11,set(__COUNT=$[${COUNT}+1]) ;then increment the counter
exten => s,12,endwhile

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;take the weight and build the array;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
exten => _X,1,set(__MATEWEIGHT[${COUNT}]= ${EXTEN}) ;give each roommate a relative weight using the counter
exten => _X,n,goto(s,11) ;then repeat
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;after weights are assigned, pick roommates until we have two winners
exten => s,13,set(__WINNERS=0) ;at first we have no winners
exten => s,14,set(__CLEANER[1]=NoOne) ;and we’ll use a new counter
exten => s,15,while($[${WINNERS} < 2]) ;while we dont have two winners…
exten => s,16,noop(${CLEANER[1]})
exten => s,17,goto(Brad,1) ;go to an extension based on roommate name below
exten => s,18,goto(Brian,1) ;go to an extension based on roommate name below
exten => s,19,goto(James,1) ;go to an extension based on roommate name below
exten => s,20,goto(Jeff,1) ;go to an extension based on roommate name below
exten => s,21,goto(Marc,1) ;go to an extension based on roommate name below
exten => s,22,goto(Aubrey,1) ;go to an extension based on roommate name below
exten => s,23,noop(END OF THE LOOP. HOW MANY WINNERS? ${WINNERS})
exten => s,24,endwhile

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   exten => Brad,1,noop(we made it here ${CLEANER[1]})                             ;jump to three if we have a winner
    exten => Brad,2,random(${MATEWEIGHT[1]},Brad,4)                         ;jump to three if we have a winner
    exten => Brad,3,goto(s,18)                                                              ;or else draw again.
    exten => Brad,4,gotoif($["${CLEANER[1]}" = "Brad"]?3)                           ;did we just pick him?
    exten => Brad,5,set(__WINNERS=$[${WINNERS}+1])                                  ;if not we have a winner
    exten => Brad,6,set(__CLEANER[${WINNERS}]=${ROOMMATE[1]})                       ;and we set the CLEANER variable
    exten => Brad,7,noop("we made it here).                                         ;and draw again
    exten => Brad,8,goto(s,18)                                              ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    exten => Brian,1,random(${MATEWEIGHT[2]},Brian,3)                               ;jump to three if we have a winner
    exten => Brian,2,goto(s,19)                                                             ;or else draw again.
    exten => Brian,3,gotoif($["${CLEANER[1]}" = "Brian"]?2)                         ;did we just pick him?
    exten => Brian,4,set(__WINNERS=$[${WINNERS}+1])                                 ;if not we have a winner
    exten => Brian,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[2]})                      ;and we set the CLEANER variable
    exten => Brian,6,goto(s,19)                                             ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    exten => James,1,random(${MATEWEIGHT[3]},James,3)                               ;jump to three if we have a winner
    exten => James,2,goto(s,20)                                                             ;or else draw again.
    exten => James,3,gotoif($["${CLEANER[1]}" = "James"]?2)                         ;did we just pick him?
    exten => James,4,set(__WINNERS=$[${WINNERS}+1])                                 ;if not we have a winner
    exten => James,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[3]})                      ;and we set the CLEANER variable
    exten => James,6,goto(s,20)                                             ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    exten => Jeff,1,random(${MATEWEIGHT[4]},Jeff,3)                         ;jump to three if we have a winner
    exten => Jeff,2,goto(s,21)                                                              ;or else draw again.
    exten => Jeff,3,gotoif($["${CLEANER[1]}" = "Jeff"]?2)                           ;did we just pick him?
    exten => Jeff,4,set(__WINNERS=$[${WINNERS}+1])                                  ;if not we have a winner
    exten => Jeff,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[4]})                       ;and we set the CLEANER variable
    exten => Jeff,6,goto(s,21)                                              ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    exten => Marc,1,random(${MATEWEIGHT[5]},Marc,3)                         ;jump to three if we have a winner
    exten => Marc,2,goto(s,22)                                                              ;or else draw again.
    exten => Marc,3,gotoif($["${CLEANER[1]}" = "Marc"]?2)                           ;did we just pick him?
    exten => Marc,4,set(__WINNERS=$[${WINNERS}+1])                                  ;if not we have a winner
    exten => Marc,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[5]})                       ;and we set the CLEANER variable
    exten => Marc,6,goto(s,22)                                              ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;;;;;;;;Go to exten ${ROOMMATEN[1-6], and use their weight to "draw" for a "win";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    exten => Aubrey,1,random(${MATEWEIGHT[6]},Aubrey,3)                             ;jump to three if we have a winner
    exten => Aubrey,2,goto(s,23)                                                            ;or else draw again.
    exten => Aubrey,3,gotoif($["${CLEANER[1]}" = "Aubrey"]?2)                               ;did we just pick him?
    exten => Aubrey,4,set(__WINNERS=$[${WINNERS}+1])                                        ;if not we have a winner
    exten => Aubrey,5,set(__CLEANER[${WINNERS}]=${ROOMMATE[6]})                     ;and we set the CLEANER variable
    exten => Aubrey,6,goto(s,23)                                            ;and draw again
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;spit out the winners at the end
exten => s,25,noop(${CLEANER[1]} and ${CLEANER[2]} are the winners.)[/code]

finally, the whole CLI output

[quote][size=75] – Executing Goto(“SIP/Brian-5dbf”, “riah|s|1”) in new stack
– Goto (riah,s,1)
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[1]=Brad”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[2]=Brian”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[3]=James”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[4]=Jeff”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[5]=Marc”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__ROOMMATE[6]=Aubrey”) in new stack
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=1”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[1]= 9”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=2”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[2]= 1”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=3”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[3]= 0”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=4”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[4]= 0”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=5”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[5]= 0”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=6”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “1”) in new stack
– Executing BackGround(“SIP/Brian-5dbf”, “beep”) in new stack
– Playing ‘beep’ (language ‘en’)
– Executing WaitExten(“SIP/Brian-5dbf”, “5”) in new stack
== CDR updated on SIP/Brian-5dbf
– Executing Set(“SIP/Brian-5dbf”, “__MATEWEIGHT[6]= 0”) in new stack
– Executing Goto(“SIP/Brian-5dbf”, “s|11”) in new stack
– Goto (riah,s,11)
– Executing Set(“SIP/Brian-5dbf”, “__COUNT=7”) in new stack
– Executing EndWhile(“SIP/Brian-5dbf”, “”) in new stack
– Executing While(“SIP/Brian-5dbf”, “0”) in new stack

(ed. SO FAR SO GOOD. NOW LETS SET SOME VARS AND START THE LAST LOOP)

-- Executing Set("SIP/Brian-3d7d", "__WINNERS=0") in new stack
-- Executing Set("SIP/Brian-3d7d", "__CLEANER[1]=NoOne") in new stack
-- Executing While("SIP/Brian-3d7d", "1") in new stack
-- Executing NoOp("SIP/Brian-3d7d", "NoOne") in new stack


(ed. NOW WE START CHECKING ROOMATES)

-- Executing Goto("SIP/Brian-3d7d", "Brad|1") in new stack
-- Goto (riah,Brad,1)
-- Executing NoOp("SIP/Brian-3d7d", "we made it here NoOne") in new stack
-- Executing Random("SIP/Brian-3d7d", " 9|Brad|4") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|18") in new stack
-- Goto (riah,s,18)
-- Executing Goto("SIP/Brian-3d7d", "Brian|1") in new stack
-- Goto (riah,Brian,1)
-- Executing Random("SIP/Brian-3d7d", " 9|Brian|3") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|19") in new stack
-- Goto (riah,s,19)
-- Executing Goto("SIP/Brian-3d7d", "James|1") in new stack
-- Goto (riah,James,1)
-- Executing Random("SIP/Brian-3d7d", " 0|James|3") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|20") in new stack
-- Goto (riah,s,20)
-- Executing Goto("SIP/Brian-3d7d", "Jeff|1") in new stack
-- Goto (riah,Jeff,1)
-- Executing Random("SIP/Brian-3d7d", " 0|Jeff|3") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|21") in new stack
-- Goto (riah,s,21)
-- Executing Goto("SIP/Brian-3d7d", "Marc|1") in new stack
-- Goto (riah,Marc,1)
-- Executing Random("SIP/Brian-3d7d", " 0|Marc|3") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|22") in new stack
-- Goto (riah,s,22)
-- Executing Goto("SIP/Brian-3d7d", "Aubrey|1") in new stack
-- Goto (riah,Aubrey,1)
-- Executing Random("SIP/Brian-3d7d", " 0|Aubrey|3") in new stack
-- Executing Goto("SIP/Brian-3d7d", "s|23") in new stack
-- Goto (riah,s,23)

— Executing NoOp(“SIP/Brian-3d7d”, “END OF THE LOOP. HOW MANY WINNERS? 0”) in new stack

(ed. WE MADE IT THROUGH THE LOOP AND NO WINNERS SO FAR)

-- Executing EndWhile("SIP/Brian-3d7d", "") in new stack
-- Executing While("SIP/Brian-3d7d", "1") in new stack
-- Executing NoOp("SIP/Brian-3d7d", "NoOne") in new stack
-- Executing Goto("SIP/Brian-3d7d", "Brad|1") in new stack
-- Goto (riah,Brad,1)
-- Executing NoOp("SIP/Brian-3d7d", "we made it here NoOne") in new stack
-- Executing Random("SIP/Brian-3d7d", " 9|Brad|4") in new stack

Apr 17 14:46:52 WARNING[12673]: pbx.c:6455 ast_parseable_goto: Goto requires an argument (optional context|optional extension|priority)
– Random branches to (riah,Brad,3)
== Spawn extension (riah, Brad, 2) exited non-zero on ‘SIP/Brian-3d7d’

[/size][/quote]

Discalimer: I know this can be made more efficeint, I know its not totally fair (and probably can’t be made so), and I know there is a lot of redundancy. This has never worked (even though now i think it should) so I want to make it as easy to follow as possible for debugging. This is just a proof of concept, and this post is about determining whether there is a bug in the dialplan parser, not to discuss the merits of my code.[/code][/quote]


#2

Puzzled here. You talk about the Gotoif() being wrong, but that’s not what I see in your logged output. Also, your syntax for random() is wrong - the percentage should be separated from the extension by a ‘:’).