Asterisk 1.6 auto dial redirections

Hello!

Our provider has option to redirect all calls if 21numberyouwant# is dialed to specified number. Im creating a file that dials that number for each extension/number so that redirections whould start at 5PM and end 8AM (crontab). And when i copy file to outbound folder, asterisk outputs:

-- Attempting call on SIP/T2-novi-peer/*210XXXXXXXX for 55@from-trunk:1 (Retry 1) == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Executing [55@from-trunk:1] Macro("SIP/T2-novi-peer-000000d6", "exten-vm,novm,55") in new stack -- Executing [s@macro-exten-vm:1] Macro("SIP/T2-novi-peer-000000d6", "user-callerid,") in new stack -- Executing [s@macro-user-callerid:1] Set("SIP/T2-novi-peer-000000d6", "AMPUSER=10223955") in new stack -- Executing [s@macro-user-callerid:2] GotoIf("SIP/T2-novi-peer-000000d6", "0?report") in new stack -- Executing [s@macro-user-callerid:3] ExecIf("SIP/T2-novi-peer-000000d6", "1?Set(REALCALLERIDNUM=10223955)") in new stack -- Executing [s@macro-user-callerid:4] Set("SIP/T2-novi-peer-000000d6", "AMPUSER=") in new stack -- Executing [s@macro-user-callerid:5] Set("SIP/T2-novi-peer-000000d6", "AMPUSERCIDNAME=") in new stack -- Executing [s@macro-user-callerid:6] GotoIf("SIP/T2-novi-peer-000000d6", "1?report") in new stack -- Goto (macro-user-callerid,s,10) -- Executing [s@macro-user-callerid:10] GotoIf("SIP/T2-novi-peer-000000d6", "0?continue") in new stack -- Executing [s@macro-user-callerid:11] Set("SIP/T2-novi-peer-000000d6", "__TTL=64") in new stack -- Executing [s@macro-user-callerid:12] GotoIf("SIP/T2-novi-peer-000000d6", "1?continue") in new stack -- Goto (macro-user-callerid,s,19) -- Executing [s@macro-user-callerid:19] Set("SIP/T2-novi-peer-000000d6", "CALLERID(number)=10223955") in new stack -- Executing [s@macro-user-callerid:20] Set("SIP/T2-novi-peer-000000d6", "CALLERID(name)=") in new stack -- Executing [s@macro-user-callerid:21] NoOp("SIP/T2-novi-peer-000000d6", "Using CallerID "" <10223955>") in new stack -- Executing [s@macro-exten-vm:2] Set("SIP/T2-novi-peer-000000d6", "RingGroupMethod=none") in new stack -- Executing [s@macro-exten-vm:3] Set("SIP/T2-novi-peer-000000d6", "VMBOX=novm") in new stack -- Executing [s@macro-exten-vm:4] Set("SIP/T2-novi-peer-000000d6", "__EXTTOCALL=55") in new stack -- Executing [s@macro-exten-vm:5] Set("SIP/T2-novi-peer-000000d6", "CFUEXT=") in new stack -- Executing [s@macro-exten-vm:6] Set("SIP/T2-novi-peer-000000d6", "CFBEXT=") in new stack -- Executing [s@macro-exten-vm:7] Set("SIP/T2-novi-peer-000000d6", "RT=""") in new stack -- Executing [s@macro-exten-vm:8] Macro("SIP/T2-novi-peer-000000d6", "record-enable,55,IN") in new stack -- Executing [s@macro-record-enable:1] GotoIf("SIP/T2-novi-peer-000000d6", "1?check") in new stack -- Goto (macro-record-enable,s,4) -- Executing [s@macro-record-enable:4] ExecIf("SIP/T2-novi-peer-000000d6", "0?MacroExit()") in new stack -- Executing [s@macro-record-enable:5] GotoIf("SIP/T2-novi-peer-000000d6", "0?Group:OUT") in new stack -- Goto (macro-record-enable,s,15) -- Executing [s@macro-record-enable:15] GotoIf("SIP/T2-novi-peer-000000d6", "1?IN") in new stack -- Goto (macro-record-enable,s,20) -- Executing [s@macro-record-enable:20] ExecIf("SIP/T2-novi-peer-000000d6", "1?MacroExit()") in new stack -- Executing [s@macro-exten-vm:9] Macro("SIP/T2-novi-peer-000000d6", "dial-one,"",tr,55") in new stack -- Executing [s@macro-dial-one:1] Set("SIP/T2-novi-peer-000000d6", "DEXTEN=55") in new stack -- Executing [s@macro-dial-one:2] Set("SIP/T2-novi-peer-000000d6", "DIALSTATUS_CW=") in new stack -- Executing [s@macro-dial-one:3] GosubIf("SIP/T2-novi-peer-000000d6", "0?screen,1") in new stack -- Executing [s@macro-dial-one:4] GosubIf("SIP/T2-novi-peer-000000d6", "0?cf,1") in new stack -- Executing [s@macro-dial-one:5] GotoIf("SIP/T2-novi-peer-000000d6", "1?skip1") in new stack -- Goto (macro-dial-one,s,8) -- Executing [s@macro-dial-one:8] GotoIf("SIP/T2-novi-peer-000000d6", "0?nodial") in new stack -- Executing [s@macro-dial-one:9] GotoIf("SIP/T2-novi-peer-000000d6", "0?continue") in new stack -- Executing [s@macro-dial-one:10] Set("SIP/T2-novi-peer-000000d6", "EXTHASCW=ENABLED") in new stack -- Executing [s@macro-dial-one:11] GotoIf("SIP/T2-novi-peer-000000d6", "0?next1:cwinusebusy") in new stack -- Goto (macro-dial-one,s,23) -- Executing [s@macro-dial-one:23] GotoIf("SIP/T2-novi-peer-000000d6", "1?next3:continue") in new stack -- Goto (macro-dial-one,s,24) -- Executing [s@macro-dial-one:24] ExecIf("SIP/T2-novi-peer-000000d6", "0?Set(DIALSTATUS_CW=BUSY)") in new stack -- Executing [s@macro-dial-one:25] GotoIf("SIP/T2-novi-peer-000000d6", "0?nodial") in new stack -- Executing [s@macro-dial-one:26] GosubIf("SIP/T2-novi-peer-000000d6", "1?dstring,1:dlocal,1") in new stack -- Executing [dstring@macro-dial-one:1] Set("SIP/T2-novi-peer-000000d6", "DSTRING=") in new stack -- Executing [dstring@macro-dial-one:2] Set("SIP/T2-novi-peer-000000d6", "DEVICES=55") in new stack -- Executing [dstring@macro-dial-one:3] ExecIf("SIP/T2-novi-peer-000000d6", "0?Return()") in new stack -- Executing [dstring@macro-dial-one:4] ExecIf("SIP/T2-novi-peer-000000d6", "0?Set(DEVICES=5)") in new stack -- Executing [dstring@macro-dial-one:5] Set("SIP/T2-novi-peer-000000d6", "LOOPCNT=1") in new stack -- Executing [dstring@macro-dial-one:6] Set("SIP/T2-novi-peer-000000d6", "ITER=1") in new stack -- Executing [dstring@macro-dial-one:7] Set("SIP/T2-novi-peer-000000d6", "THISDIAL=SIP/55") in new stack -- Executing [dstring@macro-dial-one:8] GosubIf("SIP/T2-novi-peer-000000d6", "1?zap2dahdi,1") in new stack -- Executing [zap2dahdi@macro-dial-one:1] ExecIf("SIP/T2-novi-peer-000000d6", "0?Return()") in new stack -- Executing [zap2dahdi@macro-dial-one:2] Set("SIP/T2-novi-peer-000000d6", "NEWDIAL=") in new stack -- Executing [zap2dahdi@macro-dial-one:3] Set("SIP/T2-novi-peer-000000d6", "LOOPCNT2=1") in new stack -- Executing [zap2dahdi@macro-dial-one:4] Set("SIP/T2-novi-peer-000000d6", "ITER2=1") in new stack -- Executing [zap2dahdi@macro-dial-one:5] Set("SIP/T2-novi-peer-000000d6", "THISPART2=SIP/55") in new stack -- Executing [zap2dahdi@macro-dial-one:6] ExecIf("SIP/T2-novi-peer-000000d6", "0?Set(THISPART2=DAHDI/55)") in new stack -- Executing [zap2dahdi@macro-dial-one:7] Set("SIP/T2-novi-peer-000000d6", "NEWDIAL=SIP/55&") in new stack -- Executing [zap2dahdi@macro-dial-one:8] Set("SIP/T2-novi-peer-000000d6", "ITER2=2") in new stack -- Executing [zap2dahdi@macro-dial-one:9] GotoIf("SIP/T2-novi-peer-000000d6", "0?begin2") in new stack -- Executing [zap2dahdi@macro-dial-one:10] Set("SIP/T2-novi-peer-000000d6", "THISDIAL=SIP/55") in new stack -- Executing [zap2dahdi@macro-dial-one:11] Return("SIP/T2-novi-peer-000000d6", "") in new stack -- Executing [dstring@macro-dial-one:9] Set("SIP/T2-novi-peer-000000d6", "DSTRING=SIP/55&") in new stack -- Executing [dstring@macro-dial-one:10] Set("SIP/T2-novi-peer-000000d6", "ITER=2") in new stack -- Executing [dstring@macro-dial-one:11] GotoIf("SIP/T2-novi-peer-000000d6", "0?begin") in new stack -- Executing [dstring@macro-dial-one:12] Set("SIP/T2-novi-peer-000000d6", "DSTRING=SIP/55") in new stack -- Executing [dstring@macro-dial-one:13] Return("SIP/T2-novi-peer-000000d6", "") in new stack -- Executing [s@macro-dial-one:27] GotoIf("SIP/T2-novi-peer-000000d6", "0?nodial") in new stack -- Executing [s@macro-dial-one:28] GotoIf("SIP/T2-novi-peer-000000d6", "1?skiptrace") in new stack -- Goto (macro-dial-one,s,30) -- Executing [s@macro-dial-one:30] Set("SIP/T2-novi-peer-000000d6", "D_OPTIONS=tr") in new stack -- Executing [s@macro-dial-one:31] ExecIf("SIP/T2-novi-peer-000000d6", "0?SIPAddHeader(Alert-Info: )") in new stack -- Executing [s@macro-dial-one:32] ExecIf("SIP/T2-novi-peer-000000d6", "0?SIPAddHeader()") in new stack -- Executing [s@macro-dial-one:33] ExecIf("SIP/T2-novi-peer-000000d6", "0?Set(CHANNEL(musicclass)=)") in new stack -- Executing [s@macro-dial-one:34] GosubIf("SIP/T2-novi-peer-000000d6", "0?qwait,1") in new stack -- Executing [s@macro-dial-one:35] Set("SIP/T2-novi-peer-000000d6", "__CWIGNORE=") in new stack -- Executing [s@macro-dial-one:36] Set("SIP/T2-novi-peer-000000d6", "__KEEPCID=TRUE") in new stack -- Executing [s@macro-dial-one:37] Dial("SIP/T2-novi-peer-000000d6", "SIP/55,"",tr") in new stack == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 == Everyone is busy/congested at this time (1:0/0/1) -- Executing [s@macro-dial-one:38] ExecIf("SIP/T2-novi-peer-000000d6", "0?Set(DIALSTATUS=)") in new stack -- Executing [s@macro-dial-one:39] GosubIf("SIP/T2-novi-peer-000000d6", "0?s-CHANUNAVAIL,1") in new stack -- Executing [s@macro-dial-one:40] MacroExit("SIP/T2-novi-peer-000000d6", "") in new stack -- Executing [s@macro-exten-vm:10] GotoIf("SIP/T2-novi-peer-000000d6", "0?exit") in new stack -- Executing [s@macro-exten-vm:11] Set("SIP/T2-novi-peer-000000d6", "SV_DIALSTATUS=CHANUNAVAIL") in new stack -- Executing [s@macro-exten-vm:12] GosubIf("SIP/T2-novi-peer-000000d6", "0?docfu,1") in new stack -- Executing [s@macro-exten-vm:13] GosubIf("SIP/T2-novi-peer-000000d6", "0?docfb,1") in new stack -- Executing [s@macro-exten-vm:14] Set("SIP/T2-novi-peer-000000d6", "DIALSTATUS=CHANUNAVAIL") in new stack -- Executing [s@macro-exten-vm:15] NoOp("SIP/T2-novi-peer-000000d6", "Voicemail is 'novm'") in new stack -- Executing [s@macro-exten-vm:16] GotoIf("SIP/T2-novi-peer-000000d6", "1?s-CHANUNAVAIL,1") in new stack -- Goto (macro-exten-vm,s-CHANUNAVAIL,1) -- Executing [s-CHANUNAVAIL@macro-exten-vm:1] NoOp("SIP/T2-novi-peer-000000d6", "IVR_RETVM: IVR_CONTEXT: ") in new stack -- Executing [s-CHANUNAVAIL@macro-exten-vm:2] GotoIf("SIP/T2-novi-peer-000000d6", "0?exit,1") in new stack -- Executing [s-CHANUNAVAIL@macro-exten-vm:3] PlayTones("SIP/T2-novi-peer-000000d6", "congestion") in new stack -- Executing [s-CHANUNAVAIL@macro-exten-vm:4] Congestion("SIP/T2-novi-peer-000000d6", "10") in new stack == Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 4) exited non-zero on 'SIP/T2-novi-peer-000000d6' in macro 'exten-vm' == Spawn extension (from-trunk, 55, 1) exited non-zero on 'SIP/T2-novi-peer-000000d6' -- Executing [h@from-trunk:1] Macro("SIP/T2-novi-peer-000000d6", "hangupcall,") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("SIP/T2-novi-peer-000000d6", "1?skiprg") in new stack -- Goto (macro-hangupcall,s,4) -- Executing [s@macro-hangupcall:4] GotoIf("SIP/T2-novi-peer-000000d6", "1?skipblkvm") in new stack -- Goto (macro-hangupcall,s,7) -- Executing [s@macro-hangupcall:7] GotoIf("SIP/T2-novi-peer-000000d6", "1?theend") in new stack -- Goto (macro-hangupcall,s,9) -- Executing [s@macro-hangupcall:9] Hangup("SIP/T2-novi-peer-000000d6", "") in new stack == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/T2-novi-peer-000000d6' in macro 'hangupcall' == Spawn extension (from-trunk, h, 1) exited non-zero on 'SIP/T2-novi-peer-000000d6'

test.call

Channel: SIP/T2-novi-peer/*210XXXXXXXX*# WaitTime: 60 Context: from-trunk Extension: 55 Priority: 1 CallerID: <XXXXXXX>

Does anyone have better solution or fix for this one?

I would really appriciate it.

Thanks

Why don’t you just implement that in the Asterisk dial plan?

I don’t think he’s using Asterisk! The dialplan seems to have come from a GUI.