GotoIf Redirection To Label Not Working Correctly

Home » Asterisk Users » GotoIf Redirection To Label Not Working Correctly
Asterisk Users 4 Comments

I run a hotdesking system based on the example from Asterisk: The Definitive Guide. Calls come into the [hotdesk] context, which verifies the phone has a logged in user and sends the call to users,${EXTEN},1 if there is a user logged in. The [users] context then includes several other contexts for internal/external call handling, as follows:

[users]
include => internal include => dummyextensions

switch => DUNDi/dundi-peer

Internal office calls should get caught by the include => internal, and run through the [internal] context as follows:
[internal]
exten => _3XX,1,NoOp()
same => n,Set(E=${EXTEN})
same => n,Set(${E}_VMCONTEXT=${HOTDESK_INFO(vmcontext,${E})})
same => n,Set(USER_LOCATION=${HOTDESK_USER_STATUS(${E})})
same => n,GotoIf($[${ODBCROWS} < 1]?notloggedin) same => n,Dial(SIP/${USER_LOCATION},20,wWU(blf-begincall^${E}^INUSE)b(blf-begincall^s^1(${E}^RINGING)))
same => n,Voicemail(${E}@${${E}_VMCONTEXT},b)
same => n,Hangup()
same => n(notloggedin),Set(LOGGED_OFF=1)
same => n,Voicemail(${E}@${${E}_VMCONTEXT},u)
same => n,Hangup()

In both Asterisk 10 and Asterisk 11, the GotoIf does not work under the circumstances above, giving me the following error and hanging up the call:

[Aug 23 15:17:35] WARNING[3558][C-00000565]: pbx.c:11799 pbx_parseable_goto: Priority ‘notloggedin’ must be a number > 0, or valid label

I can work around the issue with any of the following:

– Change the GotoIf to point to internal,${EXTEN},notloggedin

– Change the GotoIf to point to 9

– Comment out the DUNDi switch in [users]

– Unload the pbx_dundi.so module

In the latter two cases, the call redirects to the notloggedin priority label within [internal],${EXTEN} without me changing the GotoIf – as long as the DUNDi switch is not active in [users]. With the DUNDi switch active, I get the warning message above and the call hangs up.

Is there something I’m doing wrong in my config? Is this basically expected behavior that I need to adjust around?

Thank you,

Noah Engelberth MetaLINK Technologies

4 thoughts on - GotoIf Redirection To Label Not Working Correctly