This patch adds a new feature to ARI to redirect a channel to another server,
and fixes a few bugs in PJSIP's handling of the Transfer dialplan
application/ARI redirect capability.
*New Feature*
A new operation has been added to the ARI channels resource, redirect. With
this, a channel in a Stasis application can be redirected to another endpoint
of the same underlying channel technology.
*Bug fixes*
In the process of writing this new feature, two bugs were fixed in the PJSIP
stack:
(1) The existing .transfer channel callback had the limitation that it could
only transfer channels to a SIP URI, i.e., you had to pass
'PJSIP/sip:foo@my_provider.com' to the dialplan application. While this is
still supported, it is somewhat unintuitive - particularly in a world full
of endpoints. As such, we now also support specifying the PJSIP endpoint to
transfer to.
(2) res_pjsip_multihomed was, unfortunately, trying to 'help' a 302 redirect by
updating its Contact header. Alas, that resulted in the forwarding
destination set by the dialplan application/ARI resource/whatever being
rewritten with very incorrect information. Hence, we now don't bother
updating an outgoing response if it is a 302. Since this took a looong time
to find, some additional debug statements have been added to those modules
that update the Contact headers.
Review: https://reviewboard.asterisk.org/r/4316/
ASTERISK-24015 #close
Reported by: Private Name
ASTERISK-24703 #close
Reported by: Matt Jordan
........
Merged revisions 431717 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
"description":"Inform the channel that it should redirect itself to a different location. Note that this will almost certainly cause the channel to exit the application.",
"operations":[
{
"httpMethod":"POST",
"summary":"Redirect the channel to a different location.",
"nickname":"redirect",
"responseClass":"void",
"parameters":[
{
"name":"channelId",
"description":"Channel's id",
"paramType":"path",
"required":true,
"allowMultiple":false,
"dataType":"string"
},
{
"name":"endpoint",
"description":"The endpoint to redirect the channel to",
"paramType":"query",
"required":true,
"allowMultiple":false,
"dataType":"string"
}
],
"errorResponses":[
{
"code":400,
"reason":"Endpoint parameter not provided"
},
{
"code":404,
"reason":"Channel or endpoint not found"
},
{
"code":409,
"reason":"Channel not in a Stasis application"
},
{
"code":422,
"reason":"Endpoint is not the same type as the channel"