<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Have you tried <br><br>phpagi <br><br><span><a target="_blank" href="http://phpagi.sourceforge.net/">http://phpagi.sourceforge.net/</a></span><br><br><br><div>&nbsp;</div>Jon Farmer<br>Telford, Shropshire, UK<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Michelle Dupuis &lt;support@ocg.ca&gt;<br>To: Asterisk Users Mailing List - Non-Commercial Discussion &lt;asterisk-users@lists.digium.com&gt;<br>Sent: Friday, 26 January, 2007 5:52:27 PM<br>Subject: [asterisk-users] PHP AGI script callerid question<br><br>

 

<div><font face="Arial" size="2"><span class="194283117-26012007">I am trying to set 
callerid from a PHP script, using one of two functions as shown below (setid1 
and setid2).&nbsp; The first function works great with regular names and 
numbers, BUT, if I call the function with ("Test","UnknownNumber"),&nbsp;the cid 
number gets set to "asterisk".&nbsp; Why is my passed number parameter not being 
accepted in this case?</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div>
<div><font face="Arial" size="2"><span class="194283117-26012007">The second function 
uses the new/recommended method of setting cid name and number, but it has NO 
EFFECT.&nbsp; (i.e. the name and number remain at the asterisk default).&nbsp; 
Why is this one not working?</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div>
<div><font face="Arial" size="2"><span class="194283117-26012007">Thanks,</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007">MD</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div>
<div><font face="Arial" size="2"><span class="194283117-26012007">==============================================</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div>
<div><font face="Arial" size="2"></font>&nbsp;</div>
<div><span class="194283117-26012007"></span><font face="Arial"><font size="2">/<span class="194283117-26012007">/ Test #1</span></font></font><br><font face="Arial" size="2">function setid<span class="194283117-26012007">1</span>(<span class="194283117-26012007">$name,</span>$number) {</font></div>
<div><font face="Arial"><font size="2"><span class="194283117-26012007">&nbsp; $newid 
=&nbsp;</span> "\""&nbsp; . trim( substr( trim( $name ), 0, 15 ) 
)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . "\"&lt;" . 
trim( substr( str_replace( " ", "", $number ), 0, 24 ) 
)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
."&gt;";</font></font></div>
<div><font face="Arial"><font size="2"><span class="194283117-26012007">&nbsp; 
obj</span>-&gt;set_callerid(&nbsp;<span class="194283117-26012007">$</span><span class="194283117-26012007">newid </span>);</font></font></div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007">}</span></font></div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007">// Test 
#2</span></font></div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007">function 
setid<span class="194283117-26012007">1</span>(<span class="194283117-26012007">$name,</span>$number) {
<div><font face="Arial"><font size="2"><span class="194283117-26012007">&nbsp;&nbsp;&nbsp; 
$obj-&gt;cmd("Set(CALLERID(name)=\"$name\"");<br>&nbsp;&nbsp;&nbsp; 
$obj-&gt;cmd("Set(CALLERID(num)=\"$number\"");&nbsp;</span></font></font></div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007">}</span></font></div>
<div align="left"><font face="Arial" size="2"></font>&nbsp;</div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007"></span></font>&nbsp;</div></span></font></div><div><font face="Arial" size="2">_______________________________________________<br>--Bandwidth and Colocation provided by Easynews.com --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp; <a target="_blank" href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></font></div></div><font face="Arial" size="2"><br></font></div></div><br>
                <hr size=1> 
<a href="http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/spamguard/*http://us.rd.yahoo.com/evt=40565/*http://uk.docs.yahoo.com/nowyoucan.html">All New Yahoo! Mail</a> – Tired of unwanted email come-ons? Let our SpamGuard protect you.</body></html>