Hey all,
I have a piece of PHP script that telnets into Asterisk AMI (FreePBX 13.14) on port 5038 and originates a call between two given external numbers A and B. I have done a few tests and the script seems to work OK. In some of the tests though I noticed that the two channels are established but there is no voice. The call then drops after 30 secs due to no RTP packets.This seems to happen only when B is on a particular network (Telstra is the main telecom provider in Australia). Now I emphasize on that… only when number B is on this network. So for example if A is on that network everything is fine.
I have checked a lot of things too long to list them all here. I even set up another server ground up (on Hyper V) on a physically and logically different network and different host, get exact same issue.Even used asterisk-version-switch to go back to version 11. no joy. Not sure if this is to do with Codec, some network settings, or what?
the main function looks like below:
function callback($sock, $cid1, $cid2, $service_number){
fputs($sock, “Action: Originate\r\n”);
fputs($sock, “Channel: SIP/$route_name/$cid1\r\n”);
fputs($sock, “CallerID: $service_number\r\n”);
fputs($sock, “Context: from-internal\r\n”);
fputs($sock, “Exten: $cid2\r\n”);
fputs($sock, “Priority: 1\r\n”);
}
$cid1 and 2 are basically A and B.
NB - I do not have any extensions set up. Just using Asterisk to make external calls for me.
I hope some one can shed some light on this.
Thanks