Asterisk manager Example: Transfer

Asterisk Manager Example: Transfer

Transfer a call to another extension


Let's see what channels we actually have first:
SEND:
ACTION: Command
command: show channels

RECEIVE:
Response: Follows
Channel (Context Extension Pri ) State Appl. Data
SIP/x7065558529-8f54 (pms-x7065558529 1 ) Up Bridged Call SIP/127.180.254.109-44d00f80
SIP/127.180.254.109-44d00f80 (macro-dial_agi_ver.1.0.0 dial_command 1 ) Up Dial SIP/x7062618529
2 active channel(s)
--END COMMAND--

Okay, we'll transfer the first one.
SEND:
ACTION: Redirect
Channel: SIP/x7065558529-8f54
Context: default
Exten: 5558530
Priority: 1

RECEIVE:
Event: Newchannel
Channel: AsyncGoto/SIP/x7065558529-8f54
State: Up
CallerID:
Uniqueid: 1124983982.19260

Event: Rename
Oldname: SIP/x7065558529-8f54
Newname: SIP/x7065558529-8f54
Uniqueid: 1124983885.19259

Event: Rename
Oldname: AsyncGoto/SIP/x7065558529-8f54
Newname: SIP/x7065558529-8f54
Uniqueid: 1124983982.19260

Event: Rename
Oldname: SIP/x7065558529-8f54
Newname: AsyncGoto/SIP/x7065558529-8f54
Uniqueid: 1124983885.19259

Event: Newexten
Channel: SIP/x7065558529-8f54
Context: default
Extension: 5558530
Priority: 1
Application: SetVar
AppData: extension=5558530
Uniqueid: 1124983982.19260


Response: Success
Message: Redirect successful

Replace the Channel value with the channel to transfer, and the Exten value with the number to dial. Of course, you can also do this with ZAP or whatever you like.

Back

Asterisk Manager Example: Transfer

Transfer a call to another extension


Let's see what channels we actually have first:
SEND:
ACTION: Command
command: show channels

RECEIVE:
Response: Follows
Channel (Context Extension Pri ) State Appl. Data
SIP/x7065558529-8f54 (pms-x7065558529 1 ) Up Bridged Call SIP/127.180.254.109-44d00f80
SIP/127.180.254.109-44d00f80 (macro-dial_agi_ver.1.0.0 dial_command 1 ) Up Dial SIP/x7062618529
2 active channel(s)
--END COMMAND--

Okay, we'll transfer the first one.
SEND:
ACTION: Redirect
Channel: SIP/x7065558529-8f54
Context: default
Exten: 5558530
Priority: 1

RECEIVE:
Event: Newchannel
Channel: AsyncGoto/SIP/x7065558529-8f54
State: Up
CallerID:
Uniqueid: 1124983982.19260

Event: Rename
Oldname: SIP/x7065558529-8f54
Newname: SIP/x7065558529-8f54
Uniqueid: 1124983885.19259

Event: Rename
Oldname: AsyncGoto/SIP/x7065558529-8f54
Newname: SIP/x7065558529-8f54
Uniqueid: 1124983982.19260

Event: Rename
Oldname: SIP/x7065558529-8f54
Newname: AsyncGoto/SIP/x7065558529-8f54
Uniqueid: 1124983885.19259

Event: Newexten
Channel: SIP/x7065558529-8f54
Context: default
Extension: 5558530
Priority: 1
Application: SetVar
AppData: extension=5558530
Uniqueid: 1124983982.19260


Response: Success
Message: Redirect successful

Replace the Channel value with the channel to transfer, and the Exten value with the number to dial. Of course, you can also do this with ZAP or whatever you like.

Back

Created by: flobi, Last modification: Mon 28 of May, 2007 (20:46 UTC) by vinceval
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+