[asterisk-users] PHP AGI script callerid question
Michelle Dupuis
support at ocg.ca
Fri Jan 26 10:52:27 MST 2007
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?
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?
Thanks,
MD
==============================================
// Test #1
function setid1($name,$number) {
$newid = "\"" . trim( substr( trim( $name ), 0, 15 ) )
. "\"<" . trim( substr( str_replace( " ", "", $number ), 0, 24 )
)
.">";
obj->set_callerid( $newid );
}
// Test #2
function setid1($name,$number) {
$obj->cmd("Set(CALLERID(name)=\"$name\"");
$obj->cmd("Set(CALLERID(num)=\"$number\"");
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070126/d5a6da3d/attachment.htm
More information about the asterisk-users
mailing list