Problem with inbound AGIs

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Problem with inbound AGIs

Postby edgar » Mon Dec 04, 2006 1:32 pm

Hi,

I'm having problems receiving inbound calls from an external IAX account... I always get an "520-Invalid command syntax" error when the AGI tries to set the channel status... this seems to happen with all inbound AGIs.

I'm using Asterisk 1.2.12.1 and Vicidal 2.0.1.

Here's the extension that handles the incoming account:

Code: Select all
exten => 70102,1,Ringing
exten => 70102,2,Wait(1)
exten => 70102,3,Answer
exten => 70102,4,AGI(agi-VDADcloser_inbound_NOCID.agi,Inbound1-----70102-----CLOSER1---------------999-----1)
exten => 70102,5,Hangup



... and the asterisk log:
Code: Select all
    -- Accepting AUTHENTICATED call from XXX.XXX.XXX.XXX:
       > requested format = alaw,
       > requested prefs = (ulaw|alaw),
       > actual format = ulaw,
       > host prefs = (ulaw|alaw|gsm),
       > priority = mine
    -- Executing Set("IAX2/BS IAX-2", "FROM_DID=s") in new stack
    -- Executing Goto("IAX2/BS IAX-2", "custom-inb1|s|1") in new stack
    -- Goto (custom-inb1,s,1)
    -- Executing Goto("IAX2/BS IAX-2", "default|70102|1") in new stack
    -- Goto (default,70102,1)
    -- Executing Ringing("IAX2/BS IAX-2", "") in new stack
    -- Executing Wait("IAX2/BS IAX-2", "1") in new stack
    -- Saved useragent "SJphone/1.64.343d (SJ Labs)" for peer 6604
    -- Executing Answer("IAX2/BS IAX-2", "") in new stack
    -- Executing AGI("IAX2/BS IAX-2", "agi-VDADcloser_inbound_NOCID.agi|Inbound1-----70102-----CLOSER1---------------999-----1") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/agi-VDADcloser_inbound_NOCID.agi
AGI Tx >> agi_request: agi-VDADcloser_inbound_NOCID.agi
AGI Tx >> agi_channel: IAX2/BS IAX-2
AGI Tx >> agi_language: en
AGI Tx >> agi_type: IAX2
AGI Tx >> agi_uniqueid: 1165256070.0
AGI Tx >> agi_callerid: 210330343
AGI Tx >> agi_calleridname: 210330343
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: default
AGI Tx >> agi_extension: 70102
AGI Tx >> agi_priority: 4
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << STREAM FILE beep ""
    -- Saved useragent "SJphone/1.61.312b (SJ Labs)" for peer 6904
AGI Tx >> 200 result=0 endpos=3520
AGI Rx << SET CALLERID Y1204181431000000012
AGI Tx >> 200 result=1
AGI Rx << CHANNEL STATUS IAX2/BS IAX-2
AGI Tx >> 520-Invalid command syntax.  Proper usage follows:
AGI Tx >>  Usage: CHANNEL STATUS [<channelname>]
        Returns the status of the specified channel.
 If no channel name is given the returns the status of the
 current channel.  Return values:
  0 Channel is down and available
  1 Channel is down, but reserved
  2 Channel is off hook
  3 Digits (or equivalent) have been dialed
  4 Line is ringing
  5 Remote end is ringing
  6 Line is up
  7 Line is busy
AGI Tx >> 520 End of proper usage.
AGI Rx << CHANNEL STATUS IAX2/BS IAX-2
AGI Tx >> 520-Invalid command syntax.  Proper usage follows:
AGI Tx >>  Usage: CHANNEL STATUS [<channelname>]
        Returns the status of the specified channel.
 If no channel name is given the returns the status of the
 current channel.  Return values:
  0 Channel is down and available
  1 Channel is down, but reserved
  2 Channel is off hook
  3 Digits (or equivalent) have been dialed
  4 Line is ringing
  5 Remote end is ringing
  6 Line is up
  7 Line is busy
AGI Tx >> 520 End of proper usage.
AGI Rx << CHANNEL STATUS IAX2/BS IAX-2
AGI Tx >> 520-Invalid command syntax.  Proper usage follows:
AGI Tx >>  Usage: CHANNEL STATUS [<channelname>]
        Returns the status of the specified channel.
 If no channel name is given the returns the status of the
 current channel.  Return values:
  0 Channel is down and available
  1 Channel is down, but reserved
  2 Channel is off hook
  3 Digits (or equivalent) have been dialed
  4 Line is ringing
  5 Remote end is ringing
  6 Line is up
  7 Line is busy
AGI Tx >> 520 End of proper usage.
AGI Rx << SET CONTEXT default
AGI Tx >> 200 result=0
AGI Rx << SET EXTENSION 8307
AGI Tx >> 200 result=0
AGI Rx << SET PRIORITY 1
AGI Tx >> 200 result=0
    -- AGI Script agi-VDADcloser_inbound_NOCID.agi completed, returning 0
    -- Executing Answer("IAX2/BS IAX-2", "") in new stack
    -- Executing Playback("IAX2/BS IAX-2", "vm-goodbye") in new stack
    -- Playing 'vm-goodbye' (language 'en')
    -- Executing Hangup("IAX2/BS IAX-2", "") in new stack
  == Spawn extension (default, 8307, 3) exited non-zero on 'IAX2/BS IAX-2'
    -- Executing DeadAGI("IAX2/BS IAX-2", "call_log.agi|h") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/call_log.agi
AGI Tx >> agi_request: call_log.agi
AGI Tx >> agi_channel: IAX2/BS IAX-2
AGI Tx >> agi_language: en
AGI Tx >> agi_type: IAX2
AGI Tx >> agi_uniqueid: 1165256070.0
AGI Tx >> agi_callerid: unknown
AGI Tx >> agi_calleridname: Y1204181431000000012
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: default
AGI Tx >> agi_extension: h
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
    -- AGI Script call_log.agi completed, returning 0
    -- Executing DeadAGI("IAX2/BS IAX-2", "VD_hangup.agi|PRI-----NODEBUG-----16---------------") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/VD_hangup.agi
AGI Tx >> agi_request: VD_hangup.agi
AGI Tx >> agi_channel: IAX2/BS IAX-2
AGI Tx >> agi_language: en
AGI Tx >> agi_type: IAX2
AGI Tx >> agi_uniqueid: 1165256070.0
AGI Tx >> agi_callerid: unknown
AGI Tx >> agi_calleridname: Y1204181431000000012
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: default
AGI Tx >> agi_extension: h
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
    -- AGI Script VD_hangup.agi completed, returning 0
    -- Hungup 'IAX2/BS IAX-2'




Any ideas on what may be wrong?

Thanks
edgar
 
Posts: 2
Joined: Mon Dec 04, 2006 1:22 pm

Postby mflorell » Tue Dec 05, 2006 8:33 am

What asterisk-perl version are you using?
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby edgar » Tue Dec 05, 2006 9:11 am

I'm using perl 5.8.5 and asterisk-perl 0.08
edgar
 
Posts: 2
Joined: Mon Dec 04, 2006 1:22 pm

Postby mflorell » Tue Dec 05, 2006 11:48 am

How did you get a space in the chanel name variable?

I think that may be your problem.

Try using a full registration address to Dial from and not an account reference name only.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 142 guests