[Asterisk-Users] GotoIf Problems

Eric Wieling eric at fnords.org
Thu Oct 23 13:55:14 MST 2003


I have the following in my extensions.conf:

exten => 21,1,NoOp(${CALLERIDNUM})
exten => 21,2,GotoIf($[${CALLERIDNUM} = ""]?21|4:21|9)
exten => 21,4,Playback(/etc/asterisk/interactive-services/no-callerid)
exten => 21,5,Wait(1)
exten => 21,6,Playback(/etc/asterisk/interactive-services/no-callerid)
exten => 21,7,Wait(1)
exten => 21,8,Goto(10,4)
exten => 21,9,Playback(/etc/asterisk/interactive-services/calling-from)
exten => 21,10,SayDigits(${CALLERIDNUM})
exten => 21,11,Wait(1)
exten => 21,12,Playback(/etc/asterisk/interactive-services/calling-from)
exten => 21,13,SayDigits(${CALLERIDNUM})
exten => 21,14,Wait(1)
exten => 21,15,Goto(10,4)

When I call from a phone with Caller*ID I get this on the console:

    -- Executing NoOp("Zap/2-1", "2111") in new stack
    -- Executing GotoIf("Zap/2-1", "0?21|4:21|9") in new stack
    -- Goto (interactive-services,21,9)
    -- Executing Playback("Zap/2-1", "/etc/asterisk/interactive-services/calling-from") in new stack
    -- Executing SayDigits("Zap/2-1", "2111") in new stack
 
When I call from a phone with no Caller*ID set I get this:

    -- Executing NoOp("Zap/4-1", "") in new stack
    -- Executing GotoIf("Zap/4-1", "0?21|4:21|9") in new stack
    -- Goto (interactive-services,21,9)
    -- Executing Playback("Zap/4-1", "/etc/asterisk/interactive-services/calling-from") 
    -- Executing SayDigits("Zap/4-1", "") in new stack

As you can see my GotoIf doesn't seem to work, but I can't figure out why.  Does anyone have any suggestions?

-- 
Sample configs, scripts, more : http://www.fnords.org/~eric/asterisk/

BTEL Consulting 504-899-1387 or 850-484-4545 or 877-677-9643




More information about the asterisk-users mailing list