<div dir="ltr">Hi, <br>I am using phpagi for agi scripting. and want to update callerid number but didn't get any success. please help me how to update PHPAGI is new for me. Below is the code which I write.<br><br><span style="color:rgb(0,102,0)">#!/usr/bin/php -q</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)"><?php</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">set_time_limit(30);</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">//require(.phpagi.php.);</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">include("phpagi.php");</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi = new AGI();</span><br style="color:rgb(0,102,0)"><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">//answer the call</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi-> answer();</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi->verbose("------------------------------------------");</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">$agi-> exec('Set',"CALLERID(num)=01133200274");</span><br style="color:rgb(0,102,0)"><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$ani = $agi->request['agi_callerid'];</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">$agi->noop("My CalleID: <<<<<<<=".$ani);</span><br style="color:rgb(0,102,0)"><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi->set_variable("CALLERID(num)","01133200274");</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">$ani = $agi->request['agi_callerid'];</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi->noop("My CalleID: <<<<<<<=".$ani);</span><br style="color:rgb(0,102,0)">
<br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">$agi-> exec('Dial',"SIP/<a href="mailto:00918885268942@sip.trunk.gradwell.com">00918885268942@sip.trunk.gradwell.com</a>,60,r");</span><br style="color:rgb(0,102,0)">
<span style="color:rgb(0,102,0)">//$agi-> exec('Dial',"SIP/00918885268942@voipon,60,r");</span><br style="color:rgb(0,102,0)"><span style="color:rgb(0,102,0)">?> </span><br style="color:rgb(0,102,0)" clear="all">
<br>And CLI> <br><br> <span style="color:rgb(102,0,0)">== Using SIP RTP CoS mark 5</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> -- Executing [101@outbound:1] Answer("SIP/2209-000026d3", "") in new stack</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> -- Executing [101@outbound:2] AGI("SIP/2209-000026d3", "/home/virendra.bhati/outdial.php") in new stack</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> -- Launched AGI Script /home/virendra.bhati/outdial.php</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_request: /home/virendra.bhati/outdial.php</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_channel: SIP/2209-000026d3</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_language: en</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_type: SIP</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_uniqueid: 1326357644.10070</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_version: 1.6.2.20</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_callerid: 2209</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_calleridname: unknown</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_callingpres: 0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_callingani2: 0</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_callington: 0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_callingtns: 0</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_dnid: 101</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_rdnis: unknown</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_context: outbound</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_extension: 101</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_priority: 2</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_enhanced: 0.0</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_accountcode:</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> agi_threadid: 1386719552</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >></span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << ANSWER</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << VERBOSE "------------------------------------------" 1</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> /home/virendra.bhati/outdial.php: ------------------------------------------</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=1</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << EXEC Set CALLERID(num)=01133200274</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> -- AGI Script Executing Application: (Set) Options: (CALLERID(num)=01133200274)</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << NOOP "My CalleID: <<<<<<<=2209"</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << SET VARIABLE CALLERID(num) "01133200274"</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=1</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << NOOP "My CalleID: <<<<<<<=2209"</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Rx << EXEC Dial SIP/<a href="mailto:00918885268942@sip.trunk.gradwell.com">00918885268942@sip.trunk.gradwell.com</a>,60,r</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> -- AGI Script Executing Application: (Dial) Options: (SIP/<a href="mailto:00918885268942@sip.trunk.gradwell.com">00918885268942@sip.trunk.gradwell.com</a>,60,r)</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> == Using SIP RTP CoS mark 5</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> > ast_get_srv: SRV lookup for '_sip._<a href="http://udp.sip.trunk.gradwell.com">udp.sip.trunk.gradwell.com</a>' mapped to host <a href="http://v-sip-trunk-out-f1.gradwell.net">v-sip-trunk-out-f1.gradwell.net</a>, port 5060</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> -- Called <a href="mailto:00918885268942@sip.trunk.gradwell.com">00918885268942@sip.trunk.gradwell.com</a></span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)">[Jan 12 14:10:52] WARNING[28001]: chan_sip.c:18463 handle_response_invite: Received response: "Forbidden" from '"01133200274" <<a href="mailto:sip%3A01133200274@10.10.10.181">sip:01133200274@10.10.10.181</a>>;tag=as76229e88'</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> -- SIP/sip.trunk.gradwell.com-000026d4 is circuit-busy</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> == Everyone is busy/congested at this time (1:0/1/0)</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"><SIP/2209-000026d3>AGI Tx >> 200 result=0</span><br style="color:rgb(102,0,0)"><span style="color:rgb(102,0,0)"> -- <SIP/2209-000026d3>AGI Script /home/virendra.bhati/outdial.php completed, returning 0</span><br style="color:rgb(102,0,0)">
<span style="color:rgb(102,0,0)"> -- Executing [101@outbound:3] Hangup("SIP/2209-000026d3", "") in new stack</span><br style="color:rgb(102,0,0)"><br>-- <br><div dir="ltr"><br>Thanks and regards<br>
<br> Virendra Bhati<br>+91-8885268942<br>Software Engineer<br></div><br>
</div>