[asterisk-dev] Bug with set variable from AGI?

Niklas Larsson niklas at tese.se
Tue Aug 21 00:00:31 CDT 2007


Hi,

trying to make a dialplan / AGI work with trunk and 1.4. I have been converting all | to , and the dialplan are good and working. But in 1.4, if i set an variable like: IAX2/2009,,tw and then try to dial it: dial(${ds}) - it fails with can't create channel.

It seams like the converting from , to | is not done when the var is set via AGI.

So my question is this a bug in asterisk or me?

Below is all the info needed (i think).

/niklas



test.agi:

#!/usr/bin/php -q
<?php

require_once "phpagi.php";

$AGI = new AGI();

$AGI->set_variable('ds1','IAX2/2009,,tw');

$AGI->set_variable('ds2','IAX2/2009||tw');

?>


extensions.conf:

exten => 995,1,Set(ds="iax2/2009,,tw")
exten => 995,n,Dial(${ds})

exten => 996,1,AGI(test.agi)
exten => 996,n,Dial(${ds1})
exten => 996,n,Hangup

exten => 997,1,AGI(test.agi)
exten => 997,n,Dial(${ds2})
exten => 997,n,Hangup


Dialing 995 (OK):

[Aug 20 17:41:51] VERBOSE[3494] logger.c:     -- Executing [995 at from-internal:1] Set("SIP/2003-082697b0", "ds="iax2/2009||tw"") in new stack
[Aug 20 17:41:51] VERBOSE[3494] logger.c:     -- Executing [995 at from-internal:2] Dial("SIP/2003-082697b0", "iax2/2009||tw") in new stack
[Aug 20 17:41:51] VERBOSE[3494] logger.c:     -- Called 2009
[Aug 20 17:41:51] VERBOSE[17556] logger.c:     -- Call accepted by 172.18.1.204 (format ulaw)
[Aug 20 17:41:51] VERBOSE[17556] logger.c:     -- Format for call is ulaw
[Aug 20 17:41:51] VERBOSE[3494] logger.c:     -- IAX2/2009-3 is ringing
[Aug 20 17:41:52] DEBUG[3494] chan_iax2.c: We're hanging up IAX2/2009-3 now...
[Aug 20 17:41:52] VERBOSE[3494] logger.c:     -- Hungup 'IAX2/2009-3'


Dialing 996 (Not working):

[Aug 20 17:42:37] VERBOSE[3509] logger.c:     -- Executing [996 at from-internal:1] AGI("SIP/2003-082697b0", "test.agi") in new stack
[Aug 20 17:42:37] VERBOSE[3509] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/test.agi
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_request: test.agi
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_channel: SIP/2003-082697b0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_language: se
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_type: SIP
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_uniqueid: 1187624557.100
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_callerid: 2003
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_calleridname: Snom
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_callingpres: 0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_callingani2: 0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_callington: 0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_callingtns: 0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_dnid: 996
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_rdnis: unknown
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_context: from-internal
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_extension: 996
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_priority: 1
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_enhanced: 0.0
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >> agi_accountcode:
[Aug 20 17:42:37] VERBOSE[3509] logger.c: AGI Tx >>
[Aug 20 17:42:38] VERBOSE[3509] logger.c: AGI Rx << SET VARIABLE ds1 "IAX2/2009,,tw"
[Aug 20 17:42:38] VERBOSE[3509] logger.c: AGI Tx >> 200 result=1
[Aug 20 17:42:38] VERBOSE[3509] logger.c: AGI Rx << SET VARIABLE ds2 "IAX2/2009||tw"
[Aug 20 17:42:38] VERBOSE[3509] logger.c: AGI Tx >> 200 result=1
[Aug 20 17:42:38] VERBOSE[3509] logger.c:     -- AGI Script test.agi completed, returning 0
[Aug 20 17:42:38] VERBOSE[3509] logger.c:     -- Executing [996 at from-internal:2] Dial("SIP/2003-082697b0", "IAX2/2009,,tw") in new stack
[Aug 20 17:42:38] WARNING[3509] chan_iax2.c: No such host: 2009,,tw
[Aug 20 17:42:38] WARNING[3509] app_dial.c: Unable to create channel of type 'IAX2' (cause 3 - No route to destination)
[Aug 20 17:42:38] VERBOSE[3509] logger.c:   == Everyone is busy/congested at this time (1:0/0/1)
[Aug 20 17:42:38] VERBOSE[3509] logger.c:     -- Executing [996 at from-internal:3] Hangup("SIP/2003-082697b0", "") in new stack
[Aug 20 17:42:38] VERBOSE[3509] logger.c:   == Spawn extension (from-internal, 996, 3) exited non-zero on 'SIP/2003-082697b0'



Dialing 997 (OK):

[Aug 20 17:42:45] VERBOSE[3516] logger.c:     -- Executing [997 at from-internal:1] AGI("SIP/2003-08236d20", "test.agi") in new stack
[Aug 20 17:42:45] VERBOSE[3516] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/test.agi
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_request: test.agi
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_channel: SIP/2003-08236d20
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_language: se
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_type: SIP
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_uniqueid: 1187624565.101
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_callerid: 2003
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_calleridname: Snom
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_callingpres: 0
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_callingani2: 0
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_callington: 0
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_callingtns: 0
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_dnid: 997
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_rdnis: unknown
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_context: from-internal
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_extension: 997
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_priority: 1
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_enhanced: 0.0
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >> agi_accountcode:
[Aug 20 17:42:45] VERBOSE[3516] logger.c: AGI Tx >>
[Aug 20 17:42:46] VERBOSE[3516] logger.c: AGI Rx << SET VARIABLE ds1 "IAX2/2009,,tw"
[Aug 20 17:42:46] VERBOSE[3516] logger.c: AGI Tx >> 200 result=1
[Aug 20 17:42:46] VERBOSE[3516] logger.c: AGI Rx << SET VARIABLE ds2 "IAX2/2009||tw"
[Aug 20 17:42:46] VERBOSE[3516] logger.c: AGI Tx >> 200 result=1
[Aug 20 17:42:46] VERBOSE[3516] logger.c:     -- AGI Script test.agi completed, returning 0
[Aug 20 17:42:46] VERBOSE[3516] logger.c:     -- Executing [997 at from-internal:2] Dial("SIP/2003-08236d20", "IAX2/2009||tw") in new stack
[Aug 20 17:42:46] VERBOSE[3516] logger.c:     -- Called 2009
[Aug 20 17:42:46] VERBOSE[17557] logger.c:     -- Call accepted by 172.18.1.204 (format ulaw)
[Aug 20 17:42:46] VERBOSE[17557] logger.c:     -- Format for call is ulaw
[Aug 20 17:42:46] VERBOSE[3516] logger.c:     -- IAX2/2009-2 is ringing
[Aug 20 17:42:47] DEBUG[3516] chan_iax2.c: We're hanging up IAX2/2009-2 now...
[Aug 20 17:42:47] VERBOSE[3516] logger.c:     -- Hungup 'IAX2/2009-2'



More information about the asterisk-dev mailing list