I don’t have the Aync AGI included any longer as it was indicated that was NOT a good path. I now understand that making CLI calls with $astman->Command required an asynchronous call session. I thought maybe the Goto call to a dialplan context would not require the async session but obviously that is not correct. So please be clear, that is not the ‘chosen path’.
If there is a question why I’m using PHP, that is because the phones I’m working with can call a web service page where I can implement additional features. The phones do not support call parking feature buttons / soft functions so I am attempting to add that functionality through a web service accessed easily by the user from the phone.
I’ve investigated using $astman->Redirect($thechannel, $extrachannel, $exten, $context, $priority) with some success but have not found documentation on this. I don’t quite understand the channels and bridging that needs to be setup before this so my attempt to park a channel ends up with the wrong side hearing the parking lot the call was parked on. The call is parked and can be picked up but timeout ring back isn’t setup correctly either.
I see when a call is manually (with the user pressing *270 on a phone keypad while the call is active) that some LOCAL channels are spanned and bridge connections swapped around before the park occurs. The park seems to actually work on one the spawned LOCAL channels, not the raw channel to the extension directly. My redirect call to 70 doesn’t perform the channel spawns so it looks like the raw channel is put into the parking lot.
Specifically my PHP call I have tried working with looks like this:
> $thechannel = ‘SIP/101-0000001c’; //test channel
> $extrachannel = ‘’;
> $exten = 70;
> $context = ‘from-internal-xfer’;
> $priority = 1;
> $out = $astman->Redirect($thechannel, $extrachannel, $exten, $context, $priority);
I haven’t figured out what the extrachannel argument actually does yet. If I add the call’s other channel half here I get both channels parked and I get both channels parked into different lots. Cool but not very useful.
Is there a way to get a detailed explanation of the Redirect method call and the parameter interactions? Very little insight can be gleaned from the build it help (manager show command topic redirect). Searches for this have come up blank other than the reference at http://wiki.freepbx.org/display/FOP/Asterisk+Manager+Class.
I think with all the effort that has been put into indicating why what I’m doing will not work but no algorithm of actually doing this has been put forward, that no one actually knows how to park a call (two channels that are in an existing bridge) using php? Again, I already can identify the channels setup to the extension making the PHP web service call.
In looking at the Asterisk ARI and investigating PHPARI which appear would need to be installed, I’m still not clear on basic mechanism to achieving my goal. Seems like the dialplan would have to use the Stasis app but that is not a core part way FreePBX work is it? I’m not sure how this helps solve my problem. At this point, the question isn’t as much about the technology as much as the technique to be used.