Asterisk manager Example: Redirect

Redirect with ExtraChannel:

Attempted goal:
Have a 'robot' program Redirect both ends of an already-connected call to a meetme room using the ExtraChannel feature through the management interface.

SEND:
ACTION: Redirect
Channel: SIP/1234-6378
ExtraChannel: SIP/4321-45cf6c80
Exten: 680
Priority: 1
Context: default


RECEIVE:
Response: Error
Message: Channel not existant


Or, hopefully:
Event: Newchannel
Channel: AsyncGoto/SIP/1234-6378
State: Up
CallerID:
Uniqueid: 1124983197.19239

Event: Rename
Oldname: SIP/1234-6378
Newname: SIP/1234-6378
Uniqueid: 1124982513.19184

Event: Rename
Oldname: AsyncGoto/SIP/1234-6378
Newname: SIP/1234-6378
Uniqueid: 1124983197.19239

Event: Rename
Oldname: SIP/1234-6378
Newname: AsyncGoto/SIP/1234-6378
Uniqueid: 1124982513.19184

Event: Newexten
Channel: SIP/1234-6378
Context: default
Extension: 680
Priority: 1
Application: SetVar
AppData: channel=SIP/1234
Uniqueid: 1124983197.19239


Response: Success
Message: Dual Redirect successful

Where 680 is an extension that sends you to a MeetMe room. (Note: Some events were removed for space, but the basic jist of them is still there.)


Note that on Asterisk 1.8.7.1 the request should be:


SEND:
ACTION: Redirect
Channel: SIP/1234-6378
ExtraChannel: SIP/4321-45cf6c80
Exten: 680
Priority: 1
Context: default
ExtraExten: 680
ExtraPriority: 1
ExtraContext: default


I don't know if this is due to a bug and it should be using the same context and extension as Channel but its easy to workaround using the above.


Back


Redirect with ExtraChannel:

Attempted goal:
Have a 'robot' program Redirect both ends of an already-connected call to a meetme room using the ExtraChannel feature through the management interface.

SEND:
ACTION: Redirect
Channel: SIP/1234-6378
ExtraChannel: SIP/4321-45cf6c80
Exten: 680
Priority: 1
Context: default


RECEIVE:
Response: Error
Message: Channel not existant


Or, hopefully:
Event: Newchannel
Channel: AsyncGoto/SIP/1234-6378
State: Up
CallerID:
Uniqueid: 1124983197.19239

Event: Rename
Oldname: SIP/1234-6378
Newname: SIP/1234-6378
Uniqueid: 1124982513.19184

Event: Rename
Oldname: AsyncGoto/SIP/1234-6378
Newname: SIP/1234-6378
Uniqueid: 1124983197.19239

Event: Rename
Oldname: SIP/1234-6378
Newname: AsyncGoto/SIP/1234-6378
Uniqueid: 1124982513.19184

Event: Newexten
Channel: SIP/1234-6378
Context: default
Extension: 680
Priority: 1
Application: SetVar
AppData: channel=SIP/1234
Uniqueid: 1124983197.19239


Response: Success
Message: Dual Redirect successful

Where 680 is an extension that sends you to a MeetMe room. (Note: Some events were removed for space, but the basic jist of them is still there.)


Note that on Asterisk 1.8.7.1 the request should be:


SEND:
ACTION: Redirect
Channel: SIP/1234-6378
ExtraChannel: SIP/4321-45cf6c80
Exten: 680
Priority: 1
Context: default
ExtraExten: 680
ExtraPriority: 1
ExtraContext: default


I don't know if this is due to a bug and it should be using the same context and extension as Channel but its easy to workaround using the above.


Back


Created by: flobi, Last modification: Wed 07 of Dec, 2011 (10:34 UTC) by alexb_uk
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+