<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> </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 <support@ocg.ca><br>To: Asterisk Users Mailing List - Non-Commercial Discussion <asterisk-users@lists.digium.com><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). The first function works great with regular names and
numbers, BUT, if I call the function with ("Test","UnknownNumber"), the cid
number gets set to "asterisk". 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> </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. (i.e. the name and number remain at the asterisk default).
Why is this one not working?</span></font></div>
<div><font face="Arial" size="2"><span class="194283117-26012007"></span></font> </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> </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> </div>
<div><font face="Arial" size="2"></font> </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"> $newid
= </span> "\"" . trim( substr( trim( $name ), 0, 15 )
)<br> . "\"<" .
trim( substr( str_replace( " ", "", $number ), 0, 24 )
)<br>
.">";</font></font></div>
<div><font face="Arial"><font size="2"><span class="194283117-26012007">
obj</span>->set_callerid( <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> </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">
$obj->cmd("Set(CALLERID(name)=\"$name\"");<br>
$obj->cmd("Set(CALLERID(num)=\"$number\""); </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> </div>
<div align="left"><font face="Arial" size="2"><span class="194283117-26012007"></span></font> </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> <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>