Call Transfer Issue from PHP AMI

Dear Team,
I have been running a call center application in the asterisk-16.18.0 where the SIP registered users act as the agents and receive the calls landing in the Queue. The incoming calls get transferred from the phones using the features.conf. However, i am supposed to transfer the call using the PHP via the AMI. But then it does not allow me to transfer the call. If i try bridge, it is going but not using the Redirect. I am sure that it could be a configuration help, but not getting any clue on how to do that. If i run the Originate http://ipaddr/ccs/ccsAppCall.php?Ext=6002&Tel=98400XXXXX application i am able to land call on my cellphone but fail to transfer the call using the Web GUI thereafter.
Action: Originate
Channel: SIP/jio1/98400XXXXX
Context: national
Exten: 6002
Priority: 1

But when i try to Use
$Query1=“Action: Redirect\r\n”;
$Query1.=“Channel: “.$channel2.”\r\n”;
$Query1.=“Context: default\r\n”;
$Query1.=“Exten: “.$channel1.”\r\n”;
$Query1.=“Priority: “.$nPriority.”\r\n”;

The channel2 value i am taking from
$commandline=‘sudo asterisk -rx "core show channels "’;
$commandline=$commandline.’|grep ‘;

echo $output=shell_exec("$commandline");
$str=explode(" ",$output);

And the channel1 is what i receive from the database where in the Channel Id of incoming call in the Queue is received.
Any help in this regard would be a savior.
Apologies if i have not posted in the right group.

Could you explain where ccsAppCall.php comes from (it doesn’t seem to be part of Asterisk) and what you mean by the Web GUI (no Web GUIs are supported on this forum)?

Also, your originate will not create a local channel, so I don’t understand why you are trying to find and redirect a local channel.

Dear David,
Thanks for the prompt response. Yes the ccsAppCall.php doesnt do any thing other but to call the Originate Command to reach out to a mobile number run by an agent who is already in a queue call. As i have a Jio SIP Trunk… I were looking towards making the AMI as example:
Action: Redirect
Channel: SIP/jio-00000aed
Context: default
Exten: SIP/jio-00000aeg
Priority: 1

But that is not happening even though i have both the channel information.

This is not an extension, not even in FreePBX terms. It is a channel (instance) name. Extension in Asterisk means something with a context and matching exten => …,1, line in extensions.conf, or one of its equivalents.

If you want to connect two channels together, you have to bridge them, not redirect.

True… But if bridge, i would get a second call on my extension which i did not want, so i preferred Redirect.
To avoid i tried Calling the extensions to Confbridge … it worked well but then i dont understand if i disconnect how would i receive the second call and where should i maintain it.
I used the dialplan as well…
exten =>s,1,Answer
exten =>s,n,Noop(Let us look deeper into the soul of the invite)
exten =>s,n,Noop(pseudoin=${SIP_HEADER(From)})
exten =>s,n,Set(pseudoin=${CUT(pseudoin,@,1)})
exten =>s,n,Set(pseudoin=${CUT(pseudoin,:,2)})
exten =>s,n,Set(CALLERID="${pseudoin}")
exten =>s,n,Set(pseudodid=${SIP_HEADER(To)})
exten =>s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten =>s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten =>s,n,Background(sound/Welcome)
exten => s,n,Goto(national,86006002,1)


I am sure i can get the call transfer as well as the conference working, but not post i disconnect. Frankly i didnot try post disconnect,as i knew the result in advance as i would have joined the same group.

That’s the opposite of the case. Bridge joins existing channels, so no new call is made, but redirect, done simply, results in an extension dialling a new call (although the extension could invoke Bridge).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.