Dial Pattern Challenges

I am in South Africa and I am trying to setup a simple 10 digit dial pattern.

I tried just the simple XXXXXXXXXX and when I dial out for example 081XXXXXXX I get message “The number you dialed is out of service”

I then tried putting Prefix 0 then 0XXXXXXXXXX and then dial again 0081XXXXXXX I get message “Your call can not be completed as dialed please check the number and dial again”

I also tried Append +27 prefix 0 then XXXXXXXXXX then dialled 081XXXXXXX and get again “Your call can not be completed as dialed please check the number and dial again”

I also tried just putting fullstop . and I will get “The number you dialed is out of service”

If I setup the SIP account directly on the phone, I can call and out without issues, I just dial 081XXXXXXX and the call goes through.

Hi!

Logs while trying to call would be very nice and so does the output of

dialplan show 081XXXXXXXfrom-internal

(where X are actually numbers of course…)

Good luck and have a nice day!

Nick

PS: FreePBX version and FreePBX distro version (if it is the distro) would be nice too…

Thank you for your response,

I put dial pattern 081XXXXXXX and the dial an actual number 081XXXXXXX and the message is the dialed number is not in service.

Below is what i see on the logs as I try to dial

Connected to Asterisk 13.12.1 currently running on localhost (pid = 2076)
[2017-03-01 13:28:41] WARNING[2105]: func_cdr.c:383 cdr_write_callback: CDR requires a value (CDR(variable)=value)
localhost*CLI>

There are two places where this kind of thing happens, and I’m not sure which one you are editing.

In the outbound route (which is how you differentiate your trunks) you can put this in as a dial pattern and then send the call to a “vanilla” trunk.

Also, your warning has nothing to do with this. You’ll probably need to look in the /var/log/asterisk/full file (or review the logfiles from the GUI) and see what happens when the numbers actually makes it to the provider.

Hi!

Trying to call outside produces a lot more lines than that…

Look in the full log or do

asterisk -rvvvvvvvvvvvvvvvvvvvvvvvvvv

at the command line…

please also do the

dialplan show 081XXXXXXX@from-internal

I mentioned earlier…

If you are sure that no call to a 081XXXXXXX works use a phony (hopefully not attributed) number like 0811234567 for your tests…

If this is the number format you want to use then your routes and trunk should not prepend anything, is that the case right now?

Good luck and have a nice day!

Nick

Hi,

I am putting this in the outbound route sending via a “vanilla” trunk
I will check the logs and advise

Connected to Asterisk 13.12.1 currently running on localhost (pid = 2076)
localhost*CLI> dialplan show 081XXXXXXXfrom-internal
There is no existence of ‘081XXXXXXXfrom-internal’ context
Command ‘dialplan show 081XXXXXXXfrom-internal’ failed.

This what shows when I dial

– Executing [0812641154@from-internal:1] Macro(“PJSIP/2003-00000039”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“PJSIP/2003-00000039”, “TOUCH_MONITOR=1488446203.57”) in new stack
– Executing [s@macro-user-callerid:2] Set(“PJSIP/2003-00000039”, “AMPUSER=2003”) in new stack
– Executing [s@macro-user-callerid:3] GotoIf(“PJSIP/2003-00000039”, “0?report”) in new stack
– Executing [s@macro-user-callerid:4] ExecIf(“PJSIP/2003-00000039”, “1?Set(REALCALLERIDNUM=2003)”) in new stack
– Executing [s@macro-user-callerid:5] Set(“PJSIP/2003-00000039”, “AMPUSER=2003”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“PJSIP/2003-00000039”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:7] Set(“PJSIP/2003-00000039”, “AMPUSERCIDNAME=Gregory”) in new stack
– Executing [s@macro-user-callerid:8] GotoIf(“PJSIP/2003-00000039”, “0?report”) in new stack
– Executing [s@macro-user-callerid:9] Set(“PJSIP/2003-00000039”, “AMPUSERCID=2003”) in new stack
– Executing [s@macro-user-callerid:10] Set(“PJSIP/2003-00000039”, “__DIAL_OPTIONS=Ttr”) in new stack
– Executing [s@macro-user-callerid:11] Set(“PJSIP/2003-00000039”, “CALLERID(all)=“Gregory” <2003>”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“PJSIP/2003-00000039”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:13] ExecIf(“PJSIP/2003-00000039”, “1?Set(GROUP(concurrency_limit)=2003)”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/2003-00000039”, “0?Set(CHANNEL(language)=)”) in new stack
– Executing [s@macro-user-callerid:15] GotoIf(“PJSIP/2003-00000039”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,29)
– Executing [s@macro-user-callerid:29] Set(“PJSIP/2003-00000039”, “CALLERID(number)=2003”) in new stack
– Executing [s@macro-user-callerid:30] Set(“PJSIP/2003-00000039”, “CALLERID(name)=Gregory”) in new stack
– Executing [s@macro-user-callerid:31] GotoIf(“PJSIP/2003-00000039”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:32] Set(“PJSIP/2003-00000039”, “CDR(cnam)=Gregory”) in new stack
– Executing [s@macro-user-callerid:33] Set(“PJSIP/2003-00000039”, “CDR(cnum)=2003”) in new stack
– Executing [s@macro-user-callerid:34] Set(“PJSIP/2003-00000039”, “CHANNEL(language)=en_GB”) in new stack
– Executing [0812641154@from-internal:2] Gosub(“PJSIP/2003-00000039”, “sub-record-check,s,1(out,0812641154,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“PJSIP/2003-00000039”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“PJSIP/2003-00000039”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“PJSIP/2003-00000039”, “NOW=1488446203”) in new stack
– Executing [s@sub-record-check:4] Set(“PJSIP/2003-00000039”, “__DAY=02”) in new stack
– Executing [s@sub-record-check:5] Set(“PJSIP/2003-00000039”, “__MONTH=03”) in new stack
– Executing [s@sub-record-check:6] Set(“PJSIP/2003-00000039”, “__YEAR=2017”) in new stack
– Executing [s@sub-record-check:7] Set(“PJSIP/2003-00000039”, “__TIMESTR=20170302-091643”) in new stack
– Executing [s@sub-record-check:8] Set(“PJSIP/2003-00000039”, “__FROMEXTEN=2003”) in new stack
– Executing [s@sub-record-check:9] Set(“PJSIP/2003-00000039”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“PJSIP/2003-00000039”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“PJSIP/2003-00000039”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“PJSIP/2003-00000039”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“PJSIP/2003-00000039”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“PJSIP/2003-00000039”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“PJSIP/2003-00000039”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“PJSIP/2003-00000039”, “Outbound Recording Check from 2003 to 0812641154”) in new stack
– Executing [out@sub-record-check:2] Set(“PJSIP/2003-00000039”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“PJSIP/2003-00000039”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“PJSIP/2003-00000039”, “recordcheck,1(dontcare,out,0812641154)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/2003-00000039”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/2003-00000039”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“PJSIP/2003-00000039”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“PJSIP/2003-00000039”, “”) in new stack
– Executing [0812641154@from-internal:3] ExecIf(“PJSIP/2003-00000039”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [0812641154@from-internal:4] Set(“PJSIP/2003-00000039”, “MOHCLASS=default”) in new stack
– Executing [0812641154@from-internal:5] Set(“PJSIP/2003-00000039”, “_NODEST=”) in new stack
– Executing [0812641154@from-internal:6] Macro(“PJSIP/2003-00000039”, “dialout-trunk,1,0812641154,off”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/2003-00000039”, “DIAL_TRUNK=1”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“PJSIP/2003-00000039”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“PJSIP/2003-00000039”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“PJSIP/2003-00000039”, “DIAL_NUMBER=0812641154”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“PJSIP/2003-00000039”, “DIAL_TRUNK_OPTIONS=Ttr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“PJSIP/2003-00000039”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“PJSIP/2003-00000039”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [s@macro-dialout-trunk:9] GotoIf(“PJSIP/2003-00000039”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“PJSIP/2003-00000039”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“PJSIP/2003-00000039”, “outbound-callerid,1”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:3] ExecIf(“PJSIP/2003-00000039”, “0?Set(REALCALLERIDNUM=2003)”) in new stack
– Executing [s@macro-outbound-callerid:4] GotoIf(“PJSIP/2003-00000039”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,7)
– Executing [s@macro-outbound-callerid:7] Set(“PJSIP/2003-00000039”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“PJSIP/2003-00000039”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] Set(“PJSIP/2003-00000039”, “TRUNKOUTCID=0872884271”) in new stack
– Executing [s@macro-outbound-callerid:10] GotoIf(“PJSIP/2003-00000039”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,15)
– Executing [s@macro-outbound-callerid:15] ExecIf(“PJSIP/2003-00000039”, “1?Set(CALLERID(all)=0872884271)”) in new stack
– Executing [s@macro-outbound-callerid:16] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:17] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:18] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:19] ExecIf(“PJSIP/2003-00000039”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:20] Set(“PJSIP/2003-00000039”, “CDR(outbound_cnum)=0872884271”) in new stack
– Executing [s@macro-outbound-callerid:21] Set(“PJSIP/2003-00000039”, “CDR(outbound_cnam)=”) in new stack
[2017-03-02 09:16:43] WARNING[2105]: func_cdr.c:383 cdr_write_callback: CDR requires a value (CDR(variable)=value)
– Executing [s@macro-dialout-trunk:12] GosubIf(“PJSIP/2003-00000039”, “0?sub-flp-1,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“PJSIP/2003-00000039”, “OUTNUM=0812641154”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“PJSIP/2003-00000039”, “custom=PJSIP”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“PJSIP/2003-00000039”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
– Executing [s@macro-dialout-trunk:16] ExecIf(“PJSIP/2003-00000039”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
– Executing [s@macro-dialout-trunk:17] Macro(“PJSIP/2003-00000039”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“PJSIP/2003-00000039”, “”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“PJSIP/2003-00000039”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:19] ExecIf(“PJSIP/2003-00000039”, “1?Set(CONNECTEDLINE(num,i)=0812641154)”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“PJSIP/2003-00000039”, “1?Set(CONNECTEDLINE(name,i)=CID:0872884271)”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“PJSIP/2003-00000039”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)0872884271)”) in new stack
– Executing [s@macro-dialout-trunk:22] GotoIf(“PJSIP/2003-00000039”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:23] Dial(“PJSIP/2003-00000039”, “PJSIP/0812641154@our-Trunk,300,T”) in new stack
– Called PJSIP/0812641154@our-Trunk
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:24] NoOp(“PJSIP/2003-00000039”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 1”) in new stack
– Executing [s@macro-dialout-trunk:25] GotoIf(“PJSIP/2003-00000039”, “0?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“PJSIP/2003-00000039”, “RC=1”) in new stack
– Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“PJSIP/2003-00000039”, “1,1”) in new stack
– Goto (macro-dialout-trunk,1,1)
– Executing [1@macro-dialout-trunk:1] Goto(“PJSIP/2003-00000039”, “s-INVALIDNMBR,1”) in new stack
– Goto (macro-dialout-trunk,s-INVALIDNMBR,1)
– Executing [s-INVALIDNMBR@macro-dialout-trunk:1] NoOp(“PJSIP/2003-00000039”, “Dial failed due to trunk reporting Address Incomplete - giving up”) in new stack
– Executing [s-INVALIDNMBR@macro-dialout-trunk:2] Progress(“PJSIP/2003-00000039”, “”) in new stack
– Executing [s-INVALIDNMBR@macro-dialout-trunk:3] Playback(“PJSIP/2003-00000039”, “ss-noservice,noanswer”) in new stack
– <PJSIP/2003-00000039> Playing ‘ss-noservice.ulaw’ (language ‘en_GB’)
> 0x7f2fac13dde0 – Probation passed - setting RTP source address to 192.168.2.203:58516
– Executing [s-INVALIDNMBR@macro-dialout-trunk:4] Busy(“PJSIP/2003-00000039”, “20”) in new stack
== Spawn extension (macro-dialout-trunk, s-INVALIDNMBR, 4) exited non-zero on ‘PJSIP/2003-00000039’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 0812641154, 6) exited non-zero on ‘PJSIP/2003-00000039’
– Executing [h@from-internal:1] Macro(“PJSIP/2003-00000039”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/2003-00000039”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/2003-00000039”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“PJSIP/2003-00000039”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/2003-00000039’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘PJSIP/2003-00000039’
localhostCLI> Connected to Asterisk 13.12.1 currently running on localhost (pid = 2076)
localhost
CLI> localhostCLI> dialplan show 081XXXXXXXfrom-internal
localhost
CLI> There is no existence of ‘081XXXXXXXfrom-internal’ context
localhostCLI> Command ‘dialplan show 081XXXXXXXfrom-internal’ failed.
No such command ‘Connected to Asterisk 13.12.1 currently running on localhost (pid = 2076)’ (type ‘core show help Connected to’ for other possible commands)
No such command 'localhost
CLI> dialplan show 081XXXXXXXfrom-internal’ (type 'core show help localhostCLI> dialplan’ for other possible commands)
No such command ‘There is no existence of ‘081XXXXXXXfrom-internal’ context’ (type ‘core show help There is’ for other possible commands)
No such command ‘Command ‘dialplan show 081XXXXXXXfrom-internal’ failed.’ (type 'core show help Command ‘dialplan’ for other possible commands)
localhost
CLI>

Hi thank for your assistance. For now I actually want to dial any 10 digit number, all of them starting with 0, I was just using 081XXXXXXX as a test

Hi!

I will have to leave for work in a few minutes so I could only take a quick glance but it looks like the problem might be with your trunk definition.

Could you please do screen captures of every (trunk) screen where you filled in some information.

Please don’t forget to mask your username, password and possible caller id.

If you feel generous :wink: you could throw in your outbound route(s) definition but what I am more interested in is your trunk…

By the way, is your trunk considered up? What does the dashboard say (or sip show peers)?

Good luck and have a nice day!

Nick

Hi Nick,

Thank you for all your help it is very much appreciated.

Below are the screenshots of the trunk:

  1. General Tab
    http://pasteboard.co/EWrBgnLCc.png

2.Dial Number Manipulation Rules Tab
http://pasteboard.co/EWxYsllyb.png

3.PJSIP Settings

did not change anything under Adavanced and Codec left the defaults

OUTBOUND Route
Route Settings

Current Dial Plan

Thank you

Hi Gregory!

Sorrrry for the delayed reply…

I just noticed that there was something missing in the dialplan command I had you type. There was supposed to be a @ in front of from-internal

ie

dialplan show 081XXXXXXX@from-internal

Sorrrry, I guess something wrong happened when I cut & pasted it…

Please replace the X with actual numbers too, like this

dialplan show 0811234567@from-internal

I kind of doubt the problem is with the dial plan now but let’s make sure of it…

Good luck and have a nice day!

Nick

Hi Gregory!

I have looked at your screenshots and everything seems OK…

You are however using PJSIP which is something I am less familar with, I still use Chan_SIP (PJSIP seems to not yet be entirely stable) so if there is something not OK with that part of your configuration I might not have spotted it…

That said I setup a PJSIP trunk here to have a better feel of how it works…

What does your dashboard say about the status of your trunk, does it see it as being up?

Could you also try

pjsip show registrations

This seems to be the right command to see if your PJSIP trunk is actually registered and it gave the intended result with mine…

As I said earlier your dialplan seems fine, it looks like it is when it is trying to use the trunk that something goes wrong so let’s try to see if it is properly registered and recheck what you put in there…

By the way, is your PBX installed in a DMZ or in anything which could limit its access to the Internet?

Good luck and have a nice day!

Nick

Gregory, I do have a question about your dialplan…

You have two patterns, XXXXXXX and XXXXXXXXXX…

Now is your provider supposed to be able to make sense out of both?

Here, in North America, I would have to prepend numbers to a number in the XXXXXXX format to transform it into the XXXXXXXXXX format.

(actually it’s a little more complex than that but it’s the general idea)

Is your provider supposed to support both formats and make sense out of them? Did they give you guidelines as to how numbers should be dialed?

Good luck and have a nice day!

Nick

XXXXXXX will time out after a default 5 seconds, XXXXXXXXXX will match immediately and complete without delay so no real problem there.

NANP dialplans are well defined where N = 2-9 completely so

1 (the country code) NXX (no area codes start with 0 or 1) NXXXXXX ( no office code starts with 0 or 1 either)

Asterisk understands all that but also accepts a prepend of _ if the string is “OPEN” and ends with a . after it but will wait 5 seconds to parse. If you have an ! at any-point , then the match is accepted immediately and no more digits will be waited for.

Ultimately, there is NEVER, EVER a reason to use either of those constructs in NANP land.

Now, depending on your location dialling will be colloquially NXXXXXX (local) or NXXNXXXXXX or 1NXXNXXXXXX if LD (and seriously XXXX is still usable on some ‘mom-and-pop’ landlines) you can use those if you want for 10 or 11 digit dialling as appropriate, but 7 digit dialling over most VSP’s will require that you at least prepend your area code.

Your local white page directory will normally clarify what the dialling “colloquialisms” are, your vsp will let you know if 10 digits are accepted, or if you need e164 (11 digit dialling for NANP)

Dicko, he is in South Africa, not NANPA land… While his problem is not related to the presence of the shorter entry I wonder if it is of any use and if he could confirm with his provider what they actually expect him to dial…

If he was in NANPA land, more specifically here, the shorter way to dial has not been used in over 10 years… It’s not the case for him but I wonder if his provider actually accepts this…

Like I said though this is not his main problem…

Have a nice day,

Nick

Suggests 0[1-8]XXXXXXXX would cover all normal calls 10XXX would cover operator and emergency calls. And 00ZX. For international calls.

1 Like

Thank you Nick

I tried also using DIAL Patterns suggested by Dicko but getting the same result. The pjsip shows that it is up. We also receiving calls I am sure that should mean the trunk is up. The PBX is not in a DMZ, there is no limit to the Internet. I ran the command that you recommend and the result is below.

Connected to Asterisk 13.12.1 currently running on localhost (pid = 2131)
localhost*CLI> dialplan show 0812641154@from-internal
[ Included context ‘outrt-6’ created by ‘pbx_config’ ]
’_0[1-8]XXXXXXXX’ => 1. Macro(user-callerid,LIMIT,EXTERNAL,) [pbx_config]
2. Gosub(sub-record-check,s,1(out,${EXTEN},dontcare)) [pbx_config]
3. ExecIf($[ “${CALLEE_ACCOUNCODE}” != “” ] ?Set(CDR(accountcode)=${CALLEE_ACCOUNCODE})) [pbx_config]
4. Set(MOHCLASS=${IF($["${MOHCLASS}"=""]?default:${MOHCLASS})}) [pbx_config]
5. ExecIf($["${KEEPCID}"!=“TRUE” & ${LEN(${DB(AMPUSER/${AMPUSER}/outboundcid)})}=0 & ${LEN(${TRUNKCIDOVERRIDE})}=0]?Set(TRUNKCIDOVERRIDE=0872884271)) [pbx_config]
6. Set(_NODEST=) [pbx_config]
7. Macro(dialout-trunk,1,${EXTEN},off) [pbx_config]
8. Macro(outisbusy,) [pbx_config]

[ Included context ‘bad-number’ created by ‘pbx_config’ ]
’_X.’ => 1. ResetCDR() [pbx_config]
2. NoCDR() [pbx_config]
3. Progress() [pbx_config]
4. Wait(1) [pbx_config]
5. Playback(silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer) [pbx_config]
6. Wait(1) [pbx_config]
7. Congestion(20) [pbx_config]
8. Hangup() [pbx_config]

-= 2 extensions (16 priorities) in 2 contexts. =-
localhost*CLI>

I had put two patterns just for testing. The service provider said you just dial the number directly, no special number to dial first. When I put the SIP details on directly, it works. I just dial any number directly and it goes through

Hi Gregory!

As expected with the logs you had provided after the issue does not appear to be one of dial plan/route but something most likely wrong with your trunk or a networking related issue…

What do you have as firewall/router? Does it have anything that could get in the way such as SIP alg?

Can you try to do a PJSIP trace while you place a call using the following information:

https://blogs.asterisk.org/2016/02/24/debugging-sip-message-traffic-with-pjsip-history/

Essentially it’s something along the lines of

pjsip set history on
pjsip set logger

Then place a call followed by

pjsip set history off
pjsip show history

Please post the list it shows and anything that stands out like the 401 Unauthorized in the example.

(Do a pjsip show history entry followed by the line number on which it is (1 based).)

Hopefully we are going to find something in there which might explain what is happening…

Good luck and have a nice day!

Nick