[asterisk-users] problem with agi script not getting variable

James Mutuku listmutuku at gmail.com
Wed Sep 2 15:33:48 CDT 2009


I am learning agi scripting using php. I m using phpagi 2.x on asterisk 1.2.
I hve written a simple script that reads out the callerid using flite. My
problem is that I seems the script is not getting the callerID.

Bellow is the script

_________________
#!/usr/bin/php -q
     <?php
     /**
       * @package phpAGI_examples
       * @version 2.0
       */

       set_time_limit(30);
      require('phpagi.php');
      error_reporting(E_ALL);

      $agi = new AGI();
      $agi->answer();

      $cid = $agi->parse_callerid();
      $agi->exec("Flite","\"Hello, {$cid['name']}.\"");

       $agi->exec("flite","\"Goodbye\"");
      $agi->hangup();
   ?>

___________________
and below is my agi debug output


   -- Launched AGI Script /var/lib/asterisk/agi-bin/hints.php
AGI Tx >> agi_request: hints.php
AGI Tx >> agi_channel: SIP/1215-e5b8
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1251926037.3
AGI Tx >> agi_callerid: 1215
AGI Tx >> agi_calleridname: device
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 1220
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: privileged
AGI Tx >> agi_extension: 1220
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> AGI Rx << EXEC Flite "Hello, ."
    -- AGI Script Executing Application: (Flite) Options: (Hello, .)
    -- Playing '/tmp/flite_buf_VTgzTg' (language 'en')


As you can see, the callerID is not palyed out. What could I be doing wrong?
-- 
Best Regards,
James Mutuku Ndeti
Agile Systems Limited
+254722490994
www.agile.co.ke
mutuku.wordpress.com

Has your organization implemented a customer relationship management
(CRM)system? visit http://www.agile.co.ke/crm.php and find out how our CRM
can help you achieve better customer satisfaction and sales
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090902/996960a2/attachment.htm 


More information about the asterisk-users mailing list