[Asterisk-Users] AGI didn't get var from Asterisk?

R Wong rolland.wong at cgc.com.hk
Wed Sep 15 00:44:18 MST 2004


Dear All,

    Just hope your guys out there can help me through..since I've been playing for serval hours....and still not able to resolve it...

    The workflow as I've created an .call file for Asterisk to call out and it's working fine with outdial, passing variable to asterisk..But the problem is when the calls reached Context and execute AGI script, the script didn't get any variable from the agi...

    The .call as the following (I'm using the PHP to generate the call file) :
        $channel="Channel: Zap/g2/xxxx\r\n";
        $channel.="Callerid: xxxx\r\n";
        $channel.="Context: autodial-agent\r\n";
        $channel.="Extension: s\r\n";
        $channel.="Priority: 1\r\n";
        $channel.="SetVar: AMSISDN=xxx\r\n";
        $channel.="SetVar: ADESKNUMBER=xxxx\r\n";
        $channel.="SetVar: ASTAFFNO=xxxx\r\n";
        $channel.="SetVar: ADBID=xxx\r\n";
        $channel.="MaxRetries: 1\r\n";
        $channel.="RetryTime: 90\r\n";
        $channel.="WaitTime: 60\r\n";


    The AGI Script:
    #!/usr/bin/php -q

    <?
    require ("phpagi.php");
    $agi=new AGI();
    $dbid=$agi->get_var("ADBID");
    $tt=$agi->set_var("Adbid1", $dbid);
    echo "VERBOSE DID: $dbid";
    ?>


    Console:
    -- Launched AGI Script UpdateAutoDial.php
      UpdateAutoDial.php|45: 'agi_request' => 'UpdateAutoDial.php'
      UpdateAutoDial.php|45: 'agi_channel' => 'Zap/1-1'
      UpdateAutoDial.php|45: 'agi_language' => 'en'
      UpdateAutoDial.php|45: 'agi_type' => 'Zap'
      UpdateAutoDial.php|45: 'agi_uniqueid' => '1095233534.12'
      UpdateAutoDial.php|45: 'agi_callerid' => 'xxxx'
      UpdateAutoDial.php|45: 'agi_dnid' => 'xxxx'
      UpdateAutoDial.php|45: 'agi_rdnis' => 'unknown'
      UpdateAutoDial.php|45: 'agi_context' => 'autodial-agent'
      UpdateAutoDial.php|45: 'agi_extension' => 's'
      UpdateAutoDial.php|45: 'agi_priority' => '3'
      UpdateAutoDial.php|45: 'agi_enhanced' => '0.0'
      UpdateAutoDial.php|45: 'agi_accountcode' => ''
      UpdateAutoDial.php|45: ';dig' => '/usr/bin/dig'
      UpdateAutoDial.php|45: 'debug' => 'true'
      UpdateAutoDial.php|45: >> GET VARIABLE ADBID
      UpdateAutoDial.php|45: >> SET VARIABLE Adbid1
      UpdateAutoDial.php|45: DID:
        -- AGI Script UpdateAutoDial.php completed, returning 0

    extension:
    [autodial-agent]
    exten => s,1,SetVar(agi_did=${ADBID}) 
    exten => s,2,SetVar(DMSISDN=${AMSISDN})
    exten => s,3,AGI(UpdateAutoDial.php|${ADBID})
    exten => s,4,NoOp(DBID1: ${ADBID})
    exten => s,5,Hangup


Thanks in advances for your help!

Regards,

R Wong


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20040915/17249967/attachment.htm


More information about the asterisk-users mailing list