Hi,
I am Using AMI Redirect action on Asterisk 1.8.8. I am using following code:-
$file = fsockopen(“localhost”,“5038”);
fwrite($file, “Action: Login\r\n”);
fwrite($file, “UserName: admin\r\n”);
fwrite($file, “Secret: alliance\r\n”);
$actionid=rand(000000000,9999999999);
fwrite($file, “ActionID: $actionid\r\n\r\n”);
stream_set_timeout($file, 1);
$response = stream_get_contents($file);
fwrite($file, “Action: Redirect\r\n”);
fwrite($file, “Channel: $callerchannel\r\n”); //Caller Channel—DAHDI
fwrite($file, “ExtraChannel: $extn\r\n”); //SIP Extension
fwrite($file, “Exten: 1009\r\n”);
fwrite($file, “ExtraExten: 1009\r\n”);
fwrite($file, “Context: konfer\r\n”);
fwrite($file, “ExtraContext: konfer\r\n”);
fwrite($file, “Priority: 1\r\n”);
fwrite($file, “ExtraPriority: 1\r\n”);
$actionid2=rand(000000000,9999999999);
fwrite($file, “ActionID: $actionid2\r\n\r\n”);
echo $response = stream_get_contents($file);
fwrite($file, “Action: Logoff\r\n”);
$actionid3=rand(000000000,9999999999);
fwrite($file, “ActionID: $actionid3\r\n\r\n”);
$response = stream_get_contents($file);
fclose($file);
Sometimes it works perfectly and some times it gives following error:
-- Executing [1009@konfer:1] Set("DAHDI/i1/01140517729-2b", "hex=1009") in new stack
-- Executing [1009@konfer:2] Set("DAHDI/i1/01140517729-2b", "type=konfer") in new stack
-- Executing [1009@konfer:3] Set("DAHDI/i1/01140517729-2b", "MEETME_RECORDINGFILE=/var/www/callcenter/recording/konfer-1009-132622028387") in new stack
-- Executing [1009@konfer:4] MeetMe("DAHDI/i1/01140517729-2b", "1009,1rq") in new stack
[Jan 10 10:32:50] WARNING[24550]: channel.c:5795 __ast_channel_masquerade: Can’t setup masquerade. One or both channels is dead. (AsyncGoto/SIP/110-0000002d <-- SIP/110-0000002d)
[Jan 10 10:32:50] WARNING[24550]: cdr.c:940 ast_cdr_end: CDR on channel ‘AsyncGoto/SIP/110-0000002d’ has no answer time but is ‘ANSWERED’
== Parsing ‘/etc/asterisk/meetme.conf’: == Found
– Created MeetMe conference 1023 for conference ‘1009’
> Starting recording of MeetMe Conference 1009 into file /var/www/callcenter/recording/konfer-1009-132622028387.wav.
== Manager ‘admin’ logged off from 127.0.0.1
== Manager ‘admin’ logged on from 127.0.0.1
I have analyze it… It gives above error in first attempt and start working fine after 2nd or 3rd try. If I try it after 2-3 hours again it gives error on 1st attempt. Can Anybody help me on this issue. why this problem is coming do i need to make some configuration changes.
Thanks in Advance