Transfer Queue Call using AMI

Hi All,

Here is the scenario

  1. call is coming to queue and transfered to agent.
  2. Agent talk and wants to transfer the call to other agent using AMI (Redirect)
  3. we originate a new call and put the agent2 in meetme room with caller and agent1.
  4. it is working fine as conference but when any of two main channel hangs up (Caller or First Agent). Second channel will autometically hang up.
  5. I am using asterisk 1.4.41

Is it a bug or do i need to change my dialplan

extensions.conf

exten = s,1,queue(testqueue|hRt|||800|agentupdate.php,${lang})

AMI code (PHP):

//Call agent and put him in a conference room

$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”);

fwrite($file, “Action: originate\r\n”);
fwrite($file, “Channel: SIP/$transferchan\r\n”);
fwrite($file, “Callerid: $extn\r\n”);
fwrite($file, “Context: konfer\r\n”);
fwrite($file, “Exten: 2001\r\n”);
fwrite($file, “Priority: 1\r\n”);
$actionid4=rand(000000000,9999999999);
fwrite($file, “actionid: “.$actionid4.”\r\n\r\n”);

fwrite($file, “Action: Logoff\r\n”);
$actionid3=rand(000000000,9999999999);
fwrite($file, “actionid: “.$actionid3.”\r\n\r\n”);
fclose($file);

//Redirct caller and agent to conference room
$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”);

fwrite($file, “Action: Redirect\r\n”);
fwrite($file, “Channel: $callerchannel\r\n”);
fwrite($file, “ExtraChannel: $extn\r\n”);
fwrite($file, “Exten: 2001\r\n”);
fwrite($file, “Context: konfer\r\n”);
fwrite($file, “Priority: 1\r\n”);
$actionid2=rand(000000000,9999999999);
fwrite($file, “actionid: “.$actionid2.”\r\n\r\n”);

fwrite($file, “Action: Logoff\r\n”);
$actionid3=rand(000000000,9999999999);
fwrite($file, “actionid: “.$actionid3.”\r\n\r\n”);

fclose($file);

//Remove Agent 1 from meetme

$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: $chnlname\r\n”);
fwrite($file, “Exten: s\r\n”);
fwrite($file, “Context: hangup\r\n”);
fwrite($file, “Priority: 1\r\n”);
$actionid2=rand(000000000,9999999999);
fwrite($file, “actionid: “.$actionid2.”\r\n\r\n”);
$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);

i am using as follows

exten = _XXXX,n,meetme(${EXTEN},1rq)

This is problem only comes when hangup occured on any of two main channels (caller and actual agent --assigned by queue). If 2 nd agent disconnect call, rest 2 channels will remain active in meet me room.

If there is any option kindly let me know

Thanks

Vijay Goyal

Duplicate of question which was already, more correctly, asked in Asterisk Support.

Hi Devid55,

I havn’t got problem resolved thats why I reposted it.

You reposted it on the wrong forum, and the correct procedure is to wait at least 24 hours and then, if appropriate, append another post, to the original thread, to bring the question to the top. 24 hours is in the forum guidelines as the minimum delay before waking up (bumping) a question that has not received an answer.

Sorry Devid My Mistake…I will take care of it now.