I figured out another way to do it. But here’s the log of where it’s failing. After that I explained what I did that should work for me.
[2012-06-02 14:42:00] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:1] ResetCDR(“SIP/100-00000000”, “”) in new stack
[2012-06-02 14:42:00] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:2] NoCDR(“SIP/100-00000000”, “”) in new stack
[2012-06-02 14:42:00] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:3] Progress(“SIP/100-00000000”, “”) in new stack
[2012-06-02 14:42:00] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:4] Wait(“SIP/100-00000000”, “1”) in new stack
[2012-06-02 14:42:01] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:5] Progress(“SIP/100-00000000”, “”) in new stack
[2012-06-02 14:42:01] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:6] Playback(“SIP/100-00000000”, “silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer”) in new stack
[2012-06-02 14:42:01] VERBOSE[28824] file.c: – <SIP/100-00000000> Playing ‘silence/1.ulaw’ (language ‘en’)
[2012-06-02 14:42:02] VERBOSE[28824] file.c: – <SIP/100-00000000> Playing ‘cannot-complete-as-dialed.gsm’ (language ‘en’)
[2012-06-02 14:42:05] VERBOSE[28824] file.c: – <SIP/100-00000000> Playing ‘check-number-dial-again.gsm’ (language ‘en’)
[2012-06-02 14:42:07] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:7] Wait(“SIP/100-00000000”, “1”) in new stack
[2012-06-02 14:42:08] VERBOSE[28824] pbx.c: – Executing [2215551212@from-internal:8] Congestion(“SIP/100-00000000”, “20”) in new stack
[2012-06-02 14:42:08] WARNING[28824] channel.c: Prodding channel ‘SIP/100-00000000’ failed
[2012-06-02 14:42:08] VERBOSE[28824] pbx.c: == Spawn extension (from-internal, 2215551212, 8) exited non-zero on ‘SIP/100-00000000’
[2012-06-02 14:42:08] VERBOSE[28824] pbx.c: – Executing [h@from-internal:1] Hangup(“SIP/100-00000000”, “”) in new stack
[2012-06-02 14:42:08] VERBOSE[28824] pbx.c: == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/100-00000000’
I disabled the above [macro-dialout-trunk-predial-hook] and just made changes int the outbound routes section. eg. I created a “33_outside” outbound route. and added a 33 to the prefix of the outgoing call. Then enabled “override extension”, and set the caller ID for that particular outbound route. Here’s the code.
[outrt-4] ; 33_outside
include => outrt-4-custom
exten => _33.,1,Macro(user-callerid,LIMIT,)
exten => _33.,n,Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})})
exten => _33.,n,ExecIf($["${KEEPCID}"!=“TRUE” & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=7085591212))
exten => _33.,n,Set(_NODEST=)
exten => _33.,n,Gosub(sub-record-check,s,1(out,${EXTEN},))
exten => _33.,n,Macro(dialout-trunk,2,${EXTEN:2},)
exten => _33.,n,Macro(outisbusy,)