Menu

Get CALLERID on phpagi script

Anonymous
2011-05-01
2013-04-29
  • Anonymous

    Anonymous - 2011-05-01

    Hi guys,

    In my script I'm not able to get the callerid of a call.
    Using AGI debug on on asterisk console, I see the value of the variable, but in agi code I get notting:

    AGI DEBUG output

    <SIP/3550-0000000a>AGI Tx >> agi_request: spit_protection.php
    <SIP/3550-0000000a>AGI Tx >> agi_channel: SIP/3550-0000000a
    <SIP/3550-0000000a>AGI Tx >> agi_language: en
    <SIP/3550-0000000a>AGI Tx >> agi_type: SIP
    <SIP/3550-0000000a>AGI Tx >> agi_uniqueid: 1304255632.10
    <SIP/3550-0000000a>AGI Tx >> agi_version: 1.6.2.17
    <SIP/3550-0000000a>AGI Tx >> agi_callerid: 3550
    <SIP/3550-0000000a>AGI Tx >> agi_calleridname: Bavo1

    agi script:

    $bina=$agi->get_variable(CALLERID);
    $agi->noop("Caller ID:".$bina."");

    If I change the variable to UNIQUEID I see data on return of script.

    The name of variable is correct ?
    There is any other way to get the callerid of a call ?

    Regards,

    Fred

     
  • Cristian Luna

    Cristian Luna - 2011-05-03

    Hi Federico.

    To capture the caller id you can do the following:

    <?php
                 require('libs/phpagi.php');
                 $agi = new AGI();
                 $ani = $agi->request;
                  $agi->noop("My CalleID: ".$ani);

    ?>

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.