Hi All,
I am trying to find a solution to the following scenario
• A customer works 9am – 5pm Monday to Friday, so we have a Time Based Route for these hours
• They go home early some days, or go for long lunches, so they need to use Night and / or temporary mode for these occasions
We have tried the following
Inbound Route - 12345678, set to time based with 9 - 5pm schedule, where it runs the script tl_reroute with a prefix of 5005
Inbound route - 500512345678, set to operator managed. Day set to hunt list. Night go to voicemail
Watching the asterisk logs, when we ring 12345678, the call is routed via an Outbound route externally, rather than Thirdlane treating it as an internal call as we have 500512345678 listed as a DID.
Any ideas how we can get this scenario working?
Thanks in advance
Thanks for the prompt
Thanks for the prompt response. I have changed the variable and restarted asterisk, but it doesn't seem to have made any difference. I did notice in some other forum posts that there as a problem in some of the older re-route scripts. I am wondering whether I am running an older script.
Here is the re-route script on our MT system
exten => s,1,Dial(Local/${ARG2}${DIALED_PUBLIC_NUMBER:${ARG1}}@outgoing${TL_DASH}${tenant})
Does your outbound route
Does your outbound route match exactly to your inbound?
including e.164 format if programmed?
Ausip,
Ausip,
Have you looked at the asterisk log to see exactly what is being generated on the rewrite? That will allow you to see and compare what is being found or not found.
You can also see the entire flow of the dialplan to review what the result of the check_did (thirdlane stored procedure to check if local DID exists) call is.
Thanks @netriplex
Thanks @netriplex
check_did is not being generated in the Asterisk logs.
Both DID's are listed in Thirdlane
500561370181002 - Operator Managed
61370181002 - Time Based
actual dialed number is 61370181002, prefixed by tl_reroute it is 500561370181002
== Setting global variable 'TL_ORIGINATE_TIMEOUT' to '60'
== Setting global variable 'TL_NEW_RECORDING_MECHANISM' to '1'
== Setting global variable 'TL_REROUTE_LOCAL_DIDS' to '1'
== Setting global variable 'TL_CHECK_INBOUND_PERMISSIONS' to '0'
== Setting global variable 'PROMPT_LANGUAGE' to ''
== Setting global variable 'OPERATOR' to '0'
== Setting global variable 'TL_CHECK_DIALING_PERMISSIONS' to '0'
== Setting global variable 'TL_DASH' to '-'
== Setting global variable 'TL_CUSTOM_INBOUND_SCRIPT' to ''
== Setting global variable 'TL_MULTI' to '1'
== Setting global variable 'TIME_ZONE' to ''
== Setting global variable 'TL_DEBUG' to '0'
== Setting global variable 'RINGTIME' to '30'
== Setting global variable 'TL_ENABLE_MAXCALLS_CHECK' to '0'
== Setting global variable 'RECORDING_FORMAT' to 'WAV'
-- Time to scan old dialplan and merge leftovers back into the new: 0.001652 sec
-- Time to restore hints and swap in new dialplan: 0.024729 sec
-- Time to delete the old dialplan: 0.003172 sec
-- Total time merge_contexts_delete: 0.029553 sec
-- pbx_config successfully loaded 752 contexts (enable debug for details).
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [61370181002@from-outside:1] Wait("SIP/aereon-00000008", "1") in new stack
-- Executing [61370181002@from-outside:2] Set("SIP/aereon-00000008", "CDR(did)=61370181002") in new stack
-- Executing [61370181002@from-outside:3] ExecIf("SIP/aereon-00000008", "0?Gosub(from-outside-fixinbound,61370181002,1)") in new stack
-- Executing [61370181002@from-outside:4] Set("SIP/aereon-00000008", "__INCOMINGCLI=61419588320") in new stack
-- Executing [61370181002@from-outside:5] Goto("SIP/aereon-00000008", "from-outside-redir,61370181002,1") in new stack
-- Goto (from-outside-redir,61370181002,1)
-- Executing [61370181002@from-outside-redir:1] Gosub("SIP/aereon-00000008", "tl-from-outside,s,1(61370181002,ausipservice,,Australia/Melbourne)") in new stack
-- Executing [s@tl-from-outside:1] Set("SIP/aereon-00000008", "HASH(__T)=ausipservice,9,1,,,default,,1,61370181000,,,,,,0,,day,,0") in new stack
-- Executing [s@tl-from-outside:2] Set("SIP/aereon-00000008", "status=1") in new stack
-- Executing [s@tl-from-outside:3] GotoIf("SIP/aereon-00000008", "1?status_ok") in new stack
-- Goto (tl-from-outside,s,6)
-- Executing [s@tl-from-outside:6] GotoIf("SIP/aereon-00000008", "1?maxcalls_ok") in new stack
-- Goto (tl-from-outside,s,13)
-- Executing [s@tl-from-outside:13] Set("SIP/aereon-00000008", "__DIALED_PUBLIC_NUMBER=61370181002") in new stack
-- Executing [s@tl-from-outside:14] Set("SIP/aereon-00000008", "DIALED_NUMBER=61370181002") in new stack
-- Executing [s@tl-from-outside:15] Set("SIP/aereon-00000008", "__tenant=ausipservice") in new stack
-- Executing [s@tl-from-outside:16] Set("SIP/aereon-00000008", "CDR(userfield)=ausipservice") in new stack
-- Executing [s@tl-from-outside:17] Set("SIP/aereon-00000008", "__MOH=default") in new stack
-- Executing [s@tl-from-outside:18] GotoIf("SIP/aereon-00000008", "0?set_lang") in new stack
-- Executing [s@tl-from-outside:19] Set("SIP/aereon-00000008", "CHANNEL(musicclass)=default") in new stack
-- Executing [s@tl-from-outside:20] GotoIf("SIP/aereon-00000008", "1?global_lang") in new stack
-- Goto (tl-from-outside,s,23)
-- Executing [s@tl-from-outside:23] GotoIf("SIP/aereon-00000008", "1?tenant_lang") in new stack
-- Goto (tl-from-outside,s,25)
-- Executing [s@tl-from-outside:25] GotoIf("SIP/aereon-00000008", "1?set_timezone") in new stack
-- Goto (tl-from-outside,s,27)
-- Executing [s@tl-from-outside:27] GotoIf("SIP/aereon-00000008", "0?global_timezone") in new stack
-- Executing [s@tl-from-outside:28] Set("SIP/aereon-00000008", "__TIMEZONE=Australia/Melbourne") in new stack
-- Executing [s@tl-from-outside:29] Goto("SIP/aereon-00000008", "checkscript") in new stack
-- Goto (tl-from-outside,s,34)
-- Executing [s@tl-from-outside:34] ExecIf("SIP/aereon-00000008", "0?Macro()") in new stack
-- Executing [s@tl-from-outside:35] ExecIf("SIP/aereon-00000008", "0?Gosub(tl-dialing-permissions-inbound,s,1)") in new stack
-- Executing [s@tl-from-outside:36] Return("SIP/aereon-00000008", "") in new stack
-- Executing [61370181002@from-outside-redir:2] Gosub("SIP/aereon-00000008", "tl-allhours-ausipservice,s,1") in new stack
-- Executing [s@tl-allhours-ausipservice:1] ExecIfTime("SIP/aereon-00000008", "*,*,*,*,Australia/Melbourne?Return(1)") in new stack
-- Executing [61370181002@from-outside-redir:3] GotoIf("SIP/aereon-00000008", "1?from-outside-61370181002-tl-allhours-ausipservice,61370181002,1") in new stack
-- Goto (from-outside-61370181002-tl-allhours-ausipservice,61370181002,1)
-- Executing [61370181002@from-outside-61370181002-tl-allhours-ausipservice:1] Macro("SIP/aereon-00000008", "tl-reroute,,5005") in new stack
-- Executing [s@macro-tl-reroute:1] Dial("SIP/aereon-00000008", "Local/500561370181002@outgoing-ausipservice") in new stack
-- Called Local/500561370181002@outgoing-ausipservice
-- Executing [500561370181002@outgoing-ausipservice:1] Macro("Local/500561370181002@outgoing-ausipservice-00000001;2", "tl-dialout-1-trunk,60,SIP/ausipservices")
-- Executing [s@macro-tl-dialout-1-trunk:1] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(CHANNEL(musicclass)=)") in new stack
-- Executing [s@macro-tl-dialout-1-trunk:2] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?dial") in new stack
-- Executing [s@macro-tl-dialout-1-trunk:3] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "__DIALED_NUMBER=500561370181002") in new stack
-- Executing [s@macro-tl-dialout-1-trunk:4] Macro("Local/500561370181002@outgoing-ausipservice-00000001;2", "tl-dialout-base,60,SIP/ausipservices,,,") in new stack
-- Executing [s@macro-tl-dialout-base:1] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1 ?havetenant") in new stack
-- Goto (macro-tl-dialout-base,s,3)
-- Executing [s@macro-tl-dialout-base:3] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?enabled") in new stack
-- Goto (macro-tl-dialout-base,s,6)
-- Executing [s@macro-tl-dialout-base:6] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?allclear") in new stack
-- Goto (macro-tl-dialout-base,s,13)
-- Executing [s@macro-tl-dialout-base:13] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "i=2") in new stack
-- Executing [s@macro-tl-dialout-base:14] Macro("Local/500561370181002@outgoing-ausipservice-00000001;2", "tl-set-myvariables") in new stack
-- Executing [s@macro-tl-set-myvariables:1] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "MY_CHAN=500561370181002@outgoing-ausipservice-00000001;2") in new stack
-- Executing [s@macro-tl-set-myvariables:2] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "THECHANNEL=Local/500561370181002@outgoing-ausipservice-00000001;2") in new stack
-- Executing [s@macro-tl-set-myvariables:3] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "dahdi=0") in new stack
-- Executing [s@macro-tl-set-myvariables:4] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?usechannel") in new stack
-- Goto (macro-tl-set-myvariables,s,12)
-- Executing [s@macro-tl-set-myvariables:12] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "local=1") in new stack
-- Executing [s@macro-tl-set-myvariables:13] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?local") in new stack
-- Goto (macro-tl-set-myvariables,s,20)
-- Executing [s@macro-tl-set-myvariables:20] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?have_user") in new stack
-- Executing [s@macro-tl-set-myvariables:21] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "__MYEXTENSION=500561370181002") in new stack
-- Executing [s@macro-tl-set-myvariables:22] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "__MYID=ausipservice-500561370181002") in new stack
-- Executing [s@macro-tl-set-myvariables:23] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "__CALL_ID=localhost-1597268199.190") in new stack
[2020-08-13 07:36:39] WARNING[31230][C-0000000a]: res_memcached.c:495 mcd_read: MCD() error 16: NOT FOUND
-- Executing [s@macro-tl-set-myvariables:24] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "HASH(_CALLER)=") in new stack
-- Executing [s@macro-tl-set-myvariables:25] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(CDR(user_src)=ausipservice-500561370181002)") in new stack
-- Executing [s@macro-tl-set-myvariables:26] MacroExit("Local/500561370181002@outgoing-ausipservice-00000001;2", "") in new stack
-- Executing [s@macro-tl-dialout-base:15] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?afterperm") in new stack
-- Goto (macro-tl-dialout-base,s,17)
-- Executing [s@macro-tl-dialout-base:17] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "after tl-dialing-permissions") in new stack
-- Executing [s@macro-tl-dialout-base:18] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CHANNEL(amaflags)=billing") in new stack
-- Executing [s@macro-tl-dialout-base:19] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?use_myid_from_channel") in new stack
-- Goto (macro-tl-dialout-base,s,22)
[2020-08-13 07:36:39] WARNING[31230][C-0000000a]: res_memcached.c:495 mcd_read: MCD() error 16: NOT FOUND
-- Executing [s@macro-tl-dialout-base:22] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "HASH(CALLER)=") in new stack
-- Executing [s@macro-tl-dialout-base:23] Gosub("Local/500561370181002@outgoing-ausipservice-00000001;2", "tl-recording-helper,s,1") in new stack
-- Executing [s@tl-recording-helper:1] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?newschema") in new stack
-- Goto (tl-recording-helper,s,31)
-- Executing [s@tl-recording-helper:31] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "New recording schema will be used") in new stack
-- Executing [s@tl-recording-helper:32] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?:recording_sequence_inc") in new stack
-- Executing [s@tl-recording-helper:33] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "__RECORDING_SEQUENCE=1") in new stack
-- Executing [s@tl-recording-helper:34] Goto("Local/500561370181002@outgoing-ausipservice-00000001;2", "recording_sequence_show") in new stack
-- Goto (tl-recording-helper,s,36)
-- Executing [s@tl-recording-helper:36] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "RECORDING_SEQUENCE value is 1") in new stack
-- Executing [s@tl-recording-helper:37] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?star_nine_direction") in new stack
-- Executing [s@tl-recording-helper:38] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLEE_NUMBER=500561370181002") in new stack
-- Executing [s@tl-recording-helper:39] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLER_NUMBER=61419588320") in new stack
-- Executing [s@tl-recording-helper:40] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "RECORD_CALLEE_ALL=") in new stack
-- Executing [s@tl-recording-helper:41] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(RECORD_CALLEE=1):Set(RECORD_CALLEE=0)") in new stack
-- Executing [s@tl-recording-helper:42] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "RECORD_CALLER_ALL=") in new stack
-- Executing [s@tl-recording-helper:43] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(RECORD_CALLER=1):Set(RECORD_CALLER=0)") in new stack
-- Executing [s@tl-recording-helper:44] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?check_direction") in new stack
-- Goto (tl-recording-helper,s,46)
-- Executing [s@tl-recording-helper:46] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?external-incoming") in new stack
-- Executing [s@tl-recording-helper:47] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?external-outgoing") in new stack
-- Executing [s@tl-recording-helper:48] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "Internal Incoming Or Outgoing call") in new stack
-- Executing [s@tl-recording-helper:49] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "RECORD_CALLEE_INT_IN=") in new stack
-- Executing [s@tl-recording-helper:50] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "RECORD_CALLER_INT_OUT=") in new stack
-- Executing [s@tl-recording-helper:51] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(RECORD_CALLER=1)") in new stack
-- Executing [s@tl-recording-helper:52] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(RECORD_CALLEE=1)") in new stack
-- Executing [s@tl-recording-helper:53] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?done:record_new") in new stack
-- Goto (tl-recording-helper,s,74)
-- Executing [s@tl-recording-helper:74] Return("Local/500561370181002@outgoing-ausipservice-00000001;2", "") in new stack
-- Executing [s@macro-tl-dialout-base:24] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLERID(name)=") in new stack
-- Executing [s@macro-tl-dialout-base:25] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(CALLERID(name)=)") in new stack
-- Executing [s@macro-tl-dialout-base:26] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?calleridallowed") in new stack
-- Executing [s@macro-tl-dialout-base:27] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "temp=0") in new stack
-- Executing [s@macro-tl-dialout-base:28] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?accountcodeallowed") in new stack
-- Executing [s@macro-tl-dialout-base:29] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CHANNEL(accountcode)=") in new stack
-- Executing [s@macro-tl-dialout-base:30] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLERID(num)=61370181000") in new stack
-- Executing [s@macro-tl-dialout-base:31] ExecIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?Set(CALLERID(num)=)") in new stack
-- Executing [s@macro-tl-dialout-base:32] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?calleridallowed") in new stack
-- Goto (macro-tl-dialout-base,s,34)
-- Executing [s@macro-tl-dialout-base:34] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CLI=") in new stack
-- Executing [s@macro-tl-dialout-base:35] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?chkcallfwd") in new stack
-- Executing [s@macro-tl-dialout-base:36] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CLI=61370181000") in new stack
-- Executing [s@macro-tl-dialout-base:37] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "INCOMINGCLI=61419588320") in new stack
-- Executing [s@macro-tl-dialout-base:38] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLFWD=") in new stack
-- Executing [s@macro-tl-dialout-base:39] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?dontuseincomingcli") in new stack
-- Goto (macro-tl-dialout-base,s,44)
-- Executing [s@macro-tl-dialout-base:44] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?nocallerid") in new stack
-- Executing [s@macro-tl-dialout-base:45] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLERID(num)=61370181000") in new stack
-- Executing [s@macro-tl-dialout-base:46] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "temp=") in new stack
-- Executing [s@macro-tl-dialout-base:47] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?onetrunk,1") in new stack
-- Goto (macro-tl-dialout-base,onetrunk,1)
-- Executing [onetrunk@macro-tl-dialout-base:1] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "FULLNAME=SIP/ausipservices") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:2] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CDR(trunk)=SIP/ausipservices") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:3] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_NAME=ausipservices") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:4] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?failed,1") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:5] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "HASH(TRUNK)=ausipservices,SIP,0,0020#,0,,,,1,,,,") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:6] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_STATUS=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:7] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?next,1") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:8] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "ROUTE_PREPEND=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:9] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "ROUTE_STRIP=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:10] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "ROUTE_OPTIONS=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:11] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "NUMBER_TO_DIAL=500561370181002") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:12] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_DIALSTRING=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:13] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_PROTOCOL=SIP") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:14] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_STRIP=0") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:15] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_PREPEND=0020#") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:16] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_DIALING_OPTIONS=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:17] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CALLERID(num)=61370181000") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:18] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?end_did_chk") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:19] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "IS_SERVER_DID=0") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:20] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?end_did_chk") in new stack
-- Goto (macro-tl-dialout-base,onetrunk,23)
-- Executing [onetrunk@macro-tl-dialout-base:23] NoOp("Local/500561370181002@outgoing-ausipservice-00000001;2", "") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:24] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "0?dial-CUSTOM,1") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:25] Goto("Local/500561370181002@outgoing-ausipservice-00000001;2", "dial-SIP,1") in new stack
-- Goto (macro-tl-dialout-base,dial-SIP,1)
-- Executing [dial-SIP@macro-tl-dialout-base:1] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "headernum=1") in new stack
-- Executing [dial-SIP@macro-tl-dialout-base:2] SIPRemoveHeader("Local/500561370181002@outgoing-ausipservice-00000001;2", "Alert-Info:") in new stack
-- Executing [dial-SIP@macro-tl-dialout-base:3] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "HEADER=") in new stack
-- Executing [dial-SIP@macro-tl-dialout-base:4] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?dial") in new stack
-- Goto (macro-tl-dialout-base,dial-SIP,8)
-- Executing [dial-SIP@macro-tl-dialout-base:8] Dial("Local/500561370181002@outgoing-ausipservice-00000001;2", "SIP/0020#500561370181002@ausipservices,60,") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called SIP/0020#500561370181002@ausipservices
-- Got SIP response 484 "Address Incomplete" back from 103.106.14.5:5060
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [dial-SIP@macro-tl-dialout-base:9] Goto("Local/500561370181002@outgoing-ausipservice-00000001;2", "dial-CHANUNAVAIL,1") in new stack
-- Goto (macro-tl-dialout-base,dial-CHANUNAVAIL,1)
-- Executing [dial-CHANUNAVAIL@macro-tl-dialout-base:1] Goto("Local/500561370181002@outgoing-ausipservice-00000001;2", "next,1") in new stack
-- Goto (macro-tl-dialout-base,next,1)
-- Executing [next@macro-tl-dialout-base:1] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "i=6") in new stack
-- Executing [next@macro-tl-dialout-base:2] Goto("Local/500561370181002@outgoing-ausipservice-00000001;2", "onetrunk,1") in new stack
-- Goto (macro-tl-dialout-base,onetrunk,1)
-- Executing [onetrunk@macro-tl-dialout-base:1] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "FULLNAME=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:2] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "CDR(trunk)=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:3] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "TRUNK_NAME=") in new stack
-- Executing [onetrunk@macro-tl-dialout-base:4] GotoIf("Local/500561370181002@outgoing-ausipservice-00000001;2", "1?failed,1") in new stack
-- Goto (macro-tl-dialout-base,failed,1)
-- Executing [failed@macro-tl-dialout-base:1] PlayTones("Local/500561370181002@outgoing-ausipservice-00000001;2", "congestion") in new stack
-- Executing [failed@macro-tl-dialout-base:2] Busy("Local/500561370181002@outgoing-ausipservice-00000001;2", "10") in new stack
-- Local/500561370181002@outgoing-ausipservice-00000001;1 is busy
== Everyone is busy/congested at this time (1:1/0/0)
== Spawn extension (macro-tl-dialout-base, failed, 2) exited non-zero on 'Local/500561370181002@outgoing-ausipservice-00000001;2' in macro 'tl-dialout-base'
== Spawn extension (macro-tl-dialout-1-trunk, s, 4) exited non-zero on 'Local/500561370181002@outgoing-ausipservice-00000001;2' in macro 'tl-dialout-1-trunk'
== Spawn extension (outgoing-ausipservice, 500561370181002, 1) exited non-zero on 'Local/500561370181002@outgoing-ausipservice-00000001;2'
Executing [onetrunk@macro-tl
Executing [onetrunk@macro-tl-dialout-base:19] Set("Local/500561370181002@outgoing-ausipservice-00000001;2", "IS_SERVER_DID=0") in new stack
That is the line where the check_did stored procedure is called. Since the result is 0, it is not finding a match.
One thing I did notice is that it appears you have a trunk dialstring that is pretended. I haven't used thirdlane in a while, but I seem to remember when debugging a different issue with local DIDs, that I believe the entire did string that the trunk is intending to dial is what is passed to the stored procedure.
You can check your mysql logs to see what queries are being run to confirm this (you will need to enable all query logging).
You can also just test this out by created a new inbound route with the 0020# in front of the did. However, as a word of warning, asterisk sometimes translate a # into %23 depending on your asterisk configuration.
This is a general limitation of the relatively basic check that thirdlane does to determine if a did is local on the server. I am in the US (where historically you had to dial 1 before making a "long distance" call) and in the past I patched the thirdlane stored procedure because by default it won't find a match if the system is configured for dids without the 1 and a user dials 1 before a number.
Ie 2035550000 is configured in thirdlane, user dials 12035550000, it would route out the trunk as this wouldn't be considered local.
Your problem based on that output is that thirdlane is definitely considering the number that is dialed as a part of the reroute as NOT available on the thirdlane server. The key now is to figure out why. Tracing the sql query will definitely get you exactly what thirdlane is passing, but you can also use a little trial and error based on my past experience.
Thanks @netriplex
Thanks @netriplex
I removed the prefix on outgoing calls and it worked as expected. Thanks for all your help.
Ensure that you have the global variable TL_REROUTE_LOCAL_DIDS set to 1 otherwise thirdlane uses an external trunk even for DIDs local to the system.
There was also a feature request for better options for this type of call flow control so the "hack" of redirecting to a local number was not required, but I do not think it has gone anywhere, https://www.thirdlane.com/forum/call-flow-control.