Ok, I’m trying to figure out how to transfer a call through the Asterisk Manager Interface. I know i need to use the redirect action, so while i figured out which channel I was using the channel redirect command in the asterisk console.
Here is the output from my “core show channels”:
pbx1*CLI> core show channels
Channel Location State Application(Data)
SIP/6002-00000c75 s@macro-dial-one:42 Up Dial(SIP/6001,15,tr)
SIP/6001-00000c76 (None) Up AppDial((Outgoing Line))
2 active channels
1 active call
2122 calls processed
Now I was not sure exactly which channel I should transfer. So I tired to transfer the originators channel.
pbx1*CLI> channel redirect SIP/6002-00000c75 6003
Channel 'SIP/6002-00000c75' successfully redirected to 6003
== Spawn extension (macro-dial-one, s, 6003) exited non-zero on 'SIP/6002-00000c75' in macro 'dial-one'
== Spawn extension (macro-exten-vm, s, 14) exited non-zero on 'SIP/6002-00000c75' in macro 'exten-vm'
== Spawn extension (from-internal, 6001, 2) exited non-zero on 'SIP/6002-00000c75'
-- Executing [6001@from-internal:2] Macro("SIP/6002-00000c75", "exten-vm,6001,6001,0,0,0") in new stack
-- Executing [s@macro-exten-vm:1] Macro("SIP/6002-00000c75", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/6002-00000c75", "AMPUSER=6002") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/6002-00000c75", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/6002-00000c75", "0?Set(REALCALLERIDNUM=6002)") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/6002-00000c75", "AMPUSER=6002") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/6002-00000c75", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/6002-00000c75", "1?report") in new stack
-- Goto (macro-user-callerid,s,13)
-- Executing [s@macro-user-callerid:13] GotoIf("SIP/6002-00000c75", "0?continue") in new stack
-- Executing [s@macro-user-callerid:14] Set("SIP/6002-00000c75", "__TTL=63") in new stack
-- Executing [s@macro-user-callerid:15] GotoIf("SIP/6002-00000c75", "1?continue") in new stack
-- Goto (macro-user-callerid,s,26)
-- Executing [s@macro-user-callerid:26] Set("SIP/6002-00000c75", "CALLERID(number)=6002") in new stack
-- Executing [s@macro-user-callerid:27] Set("SIP/6002-00000c75", "CALLERID(name)=Glenn - Home") in new stack
-- Executing [s@macro-user-callerid:28] Set("SIP/6002-00000c75", "CHANNEL(language)=en") in new stack
-- Executing [s@macro-exten-vm:2] Set("SIP/6002-00000c75", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("SIP/6002-00000c75", "__EXTTOCALL=6001") in new stack
-- Executing [s@macro-exten-vm:4] Set("SIP/6002-00000c75", "__PICKUPMARK=6001") in new stack
-- Executing [s@macro-exten-vm:5] Set("SIP/6002-00000c75", "RT=15") in new stack
-- Executing [s@macro-exten-vm:6] Gosub("SIP/6002-00000c75", "sub-record-check,s,1(exten,6001,)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("SIP/6002-00000c75", "1?check") in new stack
-- Goto (sub-record-check,s,6)
-- Executing [s@sub-record-check:6] Set("SIP/6002-00000c75", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:7] GotoIf("SIP/6002-00000c75", "1?next") in new stack
-- Goto (sub-record-check,s,10)
-- Executing [s@sub-record-check:10] ExecIf("SIP/6002-00000c75", "0?Return()") in new stack
-- Executing [s@sub-record-check:11] GotoIf("SIP/6002-00000c75", "1?exten,1") in new stack
-- Goto (sub-record-check,exten,1)
-- Executing [exten@sub-record-check:1] GotoIf("SIP/6002-00000c75", "1?callee") in new stack
-- Goto (sub-record-check,exten,8)
-- Executing [exten@sub-record-check:8] GosubIf("SIP/6002-00000c75", "0?record,1(exten,6001,6002)") in new stack
-- Executing [exten@sub-record-check:9] Return("SIP/6002-00000c75", "") in new stack
-- Executing [s@macro-exten-vm:7] GotoIf("SIP/6002-00000c75", "1?macrodial") in new stack
-- Goto (macro-exten-vm,s,13)
-- Executing [s@macro-exten-vm:13] GosubIf("SIP/6002-00000c75", "0?clrheader,1()") in new stack
-- Executing [s@macro-exten-vm:14] Macro("SIP/6002-00000c75", "dial-one,15,tr,6001") in new stack
-- Executing [s@macro-dial-one:1] Set("SIP/6002-00000c75", "DEXTEN=6001") in new stack
-- Executing [s@macro-dial-one:2] Set("SIP/6002-00000c75", "DIALSTATUS_CW=") in new stack
-- Executing [s@macro-dial-one:3] GosubIf("SIP/6002-00000c75", "0?screen,1()") in new stack
-- Executing [s@macro-dial-one:4] GosubIf("SIP/6002-00000c75", "0?cf,1()") in new stack
-- Executing [s@macro-dial-one:5] GotoIf("SIP/6002-00000c75", "1?skip1") in new stack
-- Goto (macro-dial-one,s,8)
-- Executing [s@macro-dial-one:8] GotoIf("SIP/6002-00000c75", "0?nodial") in new stack
-- Executing [s@macro-dial-one:9] GotoIf("SIP/6002-00000c75", "0?continue") in new stack
-- Executing [s@macro-dial-one:10] Set("SIP/6002-00000c75", "EXTHASCW=ENABLED") in new stack
-- Executing [s@macro-dial-one:11] GotoIf("SIP/6002-00000c75", "0?next1:cwinusebusy") in new stack
-- Goto (macro-dial-one,s,23)
-- Executing [s@macro-dial-one:23] GotoIf("SIP/6002-00000c75", "1?next3:continue") in new stack
-- Goto (macro-dial-one,s,24)
-- Executing [s@macro-dial-one:24] ExecIf("SIP/6002-00000c75", "0?Set(DIALSTATUS_CW=BUSY)") in new stack
-- Executing [s@macro-dial-one:25] GotoIf("SIP/6002-00000c75", "0?nodial") in new stack
-- Executing [s@macro-dial-one:26] GosubIf("SIP/6002-00000c75", "1?dstring,1():dlocal,1()") in new stack
-- Executing [dstring@macro-dial-one:1] Set("SIP/6002-00000c75", "DSTRING=") in new stack
-- Executing [dstring@macro-dial-one:2] Set("SIP/6002-00000c75", "DEVICES=6001") in new stack
-- Executing [dstring@macro-dial-one:3] ExecIf("SIP/6002-00000c75", "0?Return()") in new stack
-- Executing [dstring@macro-dial-one:4] ExecIf("SIP/6002-00000c75", "0?Set(DEVICES=001)") in new stack
-- Executing [dstring@macro-dial-one:5] Set("SIP/6002-00000c75", "LOOPCNT=1") in new stack
-- Executing [dstring@macro-dial-one:6] Set("SIP/6002-00000c75", "ITER=1") in new stack
-- Executing [dstring@macro-dial-one:7] Set("SIP/6002-00000c75", "THISDIAL=SIP/6001") in new stack
-- Executing [dstring@macro-dial-one:8] GosubIf("SIP/6002-00000c75", "1?zap2dahdi,1()") in new stack
-- Executing [zap2dahdi@macro-dial-one:1] ExecIf("SIP/6002-00000c75", "0?Return()") in new stack
-- Executing [zap2dahdi@macro-dial-one:2] Set("SIP/6002-00000c75", "NEWDIAL=") in new stack
-- Executing [zap2dahdi@macro-dial-one:3] Set("SIP/6002-00000c75", "LOOPCNT2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:4] Set("SIP/6002-00000c75", "ITER2=1") in new stack
-- Executing [zap2dahdi@macro-dial-one:5] Set("SIP/6002-00000c75", "THISPART2=SIP/6001") in new stack
-- Executing [zap2dahdi@macro-dial-one:6] ExecIf("SIP/6002-00000c75", "0?Set(THISPART2=DAHDI/6001)") in new stack
-- Executing [zap2dahdi@macro-dial-one:7] Set("SIP/6002-00000c75", "NEWDIAL=SIP/6001&") in new stack
-- Executing [zap2dahdi@macro-dial-one:8] Set("SIP/6002-00000c75", "ITER2=2") in new stack
-- Executing [zap2dahdi@macro-dial-one:9] GotoIf("SIP/6002-00000c75", "0?begin2") in new stack
-- Executing [zap2dahdi@macro-dial-one:10] Set("SIP/6002-00000c75", "THISDIAL=SIP/6001") in new stack
-- Executing [zap2dahdi@macro-dial-one:11] Return("SIP/6002-00000c75", "") in new stack
-- Executing [dstring@macro-dial-one:9] Set("SIP/6002-00000c75", "DSTRING=SIP/6001&") in new stack
-- Executing [dstring@macro-dial-one:10] Set("SIP/6002-00000c75", "ITER=2") in new stack
-- Executing [dstring@macro-dial-one:11] GotoIf("SIP/6002-00000c75", "0?begin") in new stack
-- Executing [dstring@macro-dial-one:12] Set("SIP/6002-00000c75", "DSTRING=SIP/6001") in new stack
-- Executing [dstring@macro-dial-one:13] Return("SIP/6002-00000c75", "") in new stack
-- Executing [s@macro-dial-one:27] GotoIf("SIP/6002-00000c75", "0?nodial") in new stack
-- Executing [s@macro-dial-one:28] GotoIf("SIP/6002-00000c75", "0?skiptrace") in new stack
-- Executing [s@macro-dial-one:29] GosubIf("SIP/6002-00000c75", "1?ctset,1():ctclear,1()") in new stack
-- Executing [ctset@macro-dial-one:1] Set("SIP/6002-00000c75", "DB(CALLTRACE/6001)=6002") in new stack
-- Executing [ctset@macro-dial-one:2] Return("SIP/6002-00000c75", "") in new stack
-- Executing [s@macro-dial-one:30] Set("SIP/6002-00000c75", "D_OPTIONS=tr") in new stack
-- Executing [s@macro-dial-one:31] ExecIf("SIP/6002-00000c75", "0?SIPAddHeader(Alert-Info: )") in new stack
-- Executing [s@macro-dial-one:32] ExecIf("SIP/6002-00000c75", "0?SIPAddHeader()") in new stack
-- Executing [s@macro-dial-one:33] ExecIf("SIP/6002-00000c75", "0?Set(CHANNEL(musicclass)=)") in new stack
-- Executing [s@macro-dial-one:34] GosubIf("SIP/6002-00000c75", "0?qwait,1()") in new stack
-- Executing [s@macro-dial-one:35] Set("SIP/6002-00000c75", "__CWIGNORE=") in new stack
-- Executing [s@macro-dial-one:36] Set("SIP/6002-00000c75", "__KEEPCID=TRUE") in new stack
-- Executing [s@macro-dial-one:37] GotoIf("SIP/6002-00000c75", "0?usegoto,1") in new stack
-- Executing [s@macro-dial-one:38] GotoIf("SIP/6002-00000c75", "1?godial") in new stack
-- Goto (macro-dial-one,s,42)
-- Executing [s@macro-dial-one:42] Dial("SIP/6002-00000c75", "SIP/6001,15,tr") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/6001
-- SIP/6001-00000c77 is ringing
-- SIP/6001-00000c77 answered SIP/6002-00000c75
The of course called the 6001 phone to ring and they were both still connected to each other. That wasn’t what i was expecting to happen. So I tired to transfer the other channel:
pbx1*CLI> core show channels
Channel Location State Application(Data)
SIP/6002-00000c75 s@macro-dial-one:42 Up Dial(SIP/6001,15,tr)
SIP/6001-00000c77 (None) Up AppDial((Outgoing Line))
2 active channels
1 active call
2122 calls processed
pbx1*CLI> channel redirect SIP/6001-00000c77 6003
Channel 'SIP/6001-00000c77' successfully redirected to 6003
-- Executing [h@macro-dial-one:1] Macro("SIP/6002-00000c75", "hangupcall,") in new stack
== Starting SIP/6001-00000c77 at from-internal,s,6003 failed so falling back to exten 's'
-- Executing [s@from-internal:1] Macro("SIP/6001-00000c77", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/6001-00000c77", "1?theend") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/6002-00000c75", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/6001-00000c77", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/6002-00000c75", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/6001-00000c77", "") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/6002-00000c75", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/6001-00000c77' in macro 'hangupcall'
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/6002-00000c75' in macro 'hangupcall'
== Spawn extension (from-internal, s, 1) exited non-zero on 'SIP/6001-00000c77'
-- Executing [h@from-internal:1] Hangup("SIP/6001-00000c77", "") in new stack
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/6001-00000c77'
== Spawn extension (macro-dial-one, h, 1) exited non-zero on 'SIP/6002-00000c75'
== Spawn extension (macro-dial-one, s, 42) exited non-zero on 'SIP/6002-00000c75' in macro 'dial-one'
== Spawn extension (macro-exten-vm, s, 14) exited non-zero on 'SIP/6002-00000c75' in macro 'exten-vm'
== Spawn extension (from-internal, 6001, 2) exited non-zero on 'SIP/6002-00000c75'
pbx1*CLI>
Now at this point both channels are now closed and there is no call. At this point I am sure this isn’t doing what it should, or maybe I’m just not understanding the command syntax properly. I should also point out my asterisk version is 1.8.14.0