Summary:ASTERISK-19191: In AMI Redirect action somtimes channels get hangup while redirecting channels to meet me room
Reporter:vijay goyal (vijay85_ace)Labels:
Date Opened:2012-01-12 04:31:01.000-0600Date Closed:2012-02-16 07:19:32.000-0600
Versions: Frequency of
Environment:Debian 5 (Kernel-2.6.26-2-686) , Centos 5.2(Kernel-2.6.18-274.12.1.el5), Asterisk- DAHDI-linux-complete-2.6.0+2.6.0, libpri-

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");
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");
fwrite($file, "ActionID: $actionid2\r\n\r\n");
echo $response = stream_get_contents($file);
fwrite($file, "Action: Logoff\r\n");
fwrite($file, "ActionID: $actionid3\r\n\r\n");
$response = stream_get_contents($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
== Manager 'admin' logged on from

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.
Comments:By: David Woolley (davidw) 2012-01-12 05:28:43.710-0600

As noted on the forum, you need to say what you did to the SIP channel immediately before running this AMI, and, in particular, what you did to make sure that had completed.  My guess is that get channel by name has found a channel that was half way through a masquerade from a previous action and has found the zombie, rather than the replacement channel.

You certainly need to provide the verbose log for the whole call.

Note that the bug tracker is for recording problems and tracking their resolution.  It is not for the provision of workarounds, although, once the problem is identified, a workaround may become obvious.

By: Leif Madsen (lmadsen) 2012-02-16 07:19:19.630-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines