My system using php agi received the caller is as below
$callerid = $agi->get_variable(‘CALLERID(num)’);
I tried to send SMS using the phone number received through $callerid.
It is not working, may this be due to encoding issue?
SMS application works fine if I pass a phone number manually in pho script, but fails using the $callerid received from during call using phi agi in asterisk
Based on your code I will assume you are using PHPAGI class, so try this one $cid = $agi->parse_callerid(); this will create an associative array where called id number will be included as one of the array values. use print_r($cid); to retun all keys and value from the array and you will know which is the one holding the caller id number, depending on your phpagi version could be one of this :