TIPS Interconnecting Asterisk: How to pass prefixes to make outgoing calls

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
Server 1
Incredible PBX 13-13 for Centos 6
Server 2
Incredible PBX 13-13 for Centos 6

Server 1 Prefixes Outbound calls using 4801-48XX

Server 2 is connected to Server 1 Via IAX

Server 2 needs to pass the prefixes to Server 1 For Outbound Calls

Server 2 is currently failing to pass the prefixes
 

atsak

Guru
Joined
Sep 7, 2009
Messages
1,849
Reaction score
196
Put your trunk configuration here, likely context needs to be changed to from-internal or from-trunk or something like that.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
Try something like this in your outbound route ( I have something like it for adding area codes when 7 digit dialing)

This is going to assume you have a prefix on server 2 as 8801
8801 | 4801 + NXXNXXXXXX / [blank cid field] and for trunks, choose the joining IAX trunk to pass.

What the above line does is Strips 8801 from the number dialed but adds the 4801 to the beginning of the dialed number.

Now if both servers use the 4801 prefix an easier pattern would be:

[Blank prefix] | [Blank Prepend] / 4801NXXNXXXXXX

This would force the prefix to be dialed along with a 10 digit phone number as follows: 48012318882424

I cannot say this will work or not but it's a place to start
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
Put your trunk configuration here, likely context needs to be changed to from-internal or from-trunk or something like that.
Server 1
Incredible PBX 13-13 for Centos 6
Server 2
Incredible PBX 13-13 for Centos 6

Server 1 trunk config
trunk name:
incredible-pbx1
peer details:
host=server2
username=piaf-main
secret=example
type=friend
context=from-internal
requirecalltoken=no
qualify=yes
fromuser=piaf-main
canreinvite=no
insecure=port,invite
nat=no
dtmfmode=rfc2833
disallow=all
allow=ulaw,alaw,gsm

Server 2 trunk config
trunk name:
piaf-main
peer details:
host=server1
username=incredible-pbx1
secret=example
type=friend
context=from-internal
requirecalltoken=no
qualify=yes
fromuser=incredible-pbx1
canreinvite=no
insecure=port,invite
nat=no
dtmfmode=rfc2833
disallow=all
allow=ulaw,alaw,gsm
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
Try something like this in your outbound route ( I have something like it for adding area codes when 7 digit dialing)

This is going to assume you have a prefix on server 2 as 8801
8801 | 4801 + NXXNXXXXXX / [blank cid field] and for trunks, choose the joining IAX trunk to pass.

What the above line does is Strips 8801 from the number dialed but adds the 4801 to the beginning of the dialed number.

Now if both servers use the 4801 prefix an easier pattern would be:

[Blank prefix] | [Blank Prepend] / 4801NXXNXXXXXX

This would force the prefix to be dialed along with a 10 digit phone number as follows: 48012318882424

I cannot say this will work or not but it's a place to start
Server 1 Outbound Route Config
1 | 4801 | NXXNXXXXXX
[Blank Prepend] | 4801 | 1NXXNXXXXXX
Continued through to 4805

Server 2 Outbound Route Config
Settings are currently the same
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
And what does the Asterisk console say when the call comes in to the receiving server?

The way I read your Outbound on Server 1 is as follows:
If dial pattern matches 4801 (Prefix) NXXNXXXXXX (10 digit NANPA number IE: 2125551212) add a 1 (Prepend) and send 12125551212 to Server 2. Server 2 would need an Outbound route that matches this dial string.
EDIT: re-read your post, please remember, prefixes are *removed* from the dial string. Prefixes are used to remove digits IE:"Press 9 to dial out", 9 would be a prefix that needs to be stripped before sending the 10/11/7 digits on to the telco.
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
And what does the Asterisk console say when the call comes in to the receiving server?

The way I read your Outbound on Server 1 is as follows:
If dial pattern matches 4801 (Prefix) NXXNXXXXXX (10 digit NANPA number IE: 2125551212) add a 1 (Prepend) and send 12125551212 to Server 2. Server 2 would need an Outbound route that matches this dial string.
EDIT: re-read your post, please remember, prefixes are *removed* from the dial string. Prefixes are used to remove digits IE:"Press 9 to dial out", 9 would be a prefix that needs to be stripped before sending the 10/11/7 digits on to the telco.
Server 1 would be the outbound route for server 2 for all NXXNXXXXXX (10 digit NANPA number IE: 2125551212)
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
OK, well you say you have the same dial pattern on Server 2, pointed to Server 1, so my case still stands. Using your dial pattern you're sending 12125551212 to Server 1. Does Server 1 have a NXXNXXXXXX route to your carrier?

And again, what does the Askerisk console spit out when you attempt this?
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
OK, well you say you have the same dial pattern on Server 2, pointed to Server 1, so my case still stands. Using your dial pattern you're sending 12125551212 to Server 1. Does Server 1 have a NXXNXXXXXX route to your carrier?

And again, what does the Askerisk console spit out when you attempt this?
This is the call log of server 2 calls to server 1 for outbound nanpa https://pastebin.com/WZ6eFRs7
This is the call log of server 1 received call from server 2 for outbound nanpa https://pastebin.com/dQ3vGQWt
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
If you want to the prefix to be sent then add it in dialed number 4802NXXNXXXXXX. Using prefix explicitly means remove these digits.

As for pastebin, do you have "Intra Company" checked off in the route?
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
If you want to the prefix to be sent then add it in dialed number 4802NXXNXXXXXX. Using prefix explicitly means remove these digits.

As for pastebin, do you have "Intra Company" checked off in the route?
No I didn't have "Intra Company" checked, if i add 4802NXXNXXXXXX, does that mean that i would have to dial [Prepend Blank] | [4802] | 4802NXXNXXXXXX,
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
Your Prefix will also be blank. If you want 4802 sent to Server 1, you either need it in the "match pattern" if you expect users to dial "4802NXXNXXXXXX" *OR* if they are going to dial "NXXNXXXXXX" but you want to PREPEND 4802 to it and send "4802NXXNXXXXXX" to server 1, then add 4802 to prepend.
We really need to know what you are trying to dial (or expect a user to dial) and what you expect the other server to receive.

You can read what the Intra Company option does in the help popup.
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
To analyze your pastebin:
Server 2 sent to Server 1:

Code:
    -- Called IAX2/piaf-main/17732025000
    -- Call accepted by xxx.xxx.xxx.xxx:4569 (format ulaw)
    -- Format for call is (ulaw)
    -- IAX2/piaf-main-1449 is making progress passing it to SIP/75000-00000297
       > 0x7fdf58364df0 -- Strict RTP switching to RTP target address xxx.xxx.xxx.xxx:6236 as source
       > 0x7fdf58364df0 -- Strict RTP learning complete - Locking on source address xxx.xxx.xxx.xxx:6236
    -- IAX2/piaf-main-1449 is circuit-busy
Server 1 then tried sending to Skytel:

Code:
        -- Executing [[email protected]:24] Dial("IAX2/incredible-pbx1-3882", "SIP/Skyetel-NW/17732025000,300,T") in new stack
[2019-10-24 12:11:09] WARNING[10928][C-0000021c]: app_dial.c:2527 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [[email protected]:25] NoOp("IAX2/incredible-pbx1-3882", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20") in new stack
And failed.

Which lead to my other question, can phones on Server 1 dial 1NXXNXXXXXX and end up on Skytel?
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
Missed this one:

Code:
    -- Executing [[email protected]:24] Dial("IAX2/incredible-pbx1-3882", "SIP/Skyetel-1/17732025000,300,T") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Called SIP/Skyetel-1/17732025000
[2019-10-24 12:11:09] WARNING[2621][C-0000021c]: chan_sip.c:24069 handle_response_invite: Received response: "Forbidden" from '"75000" <sip:[email protected]>;tag=as49473758'
  == Everyone is busy/congested at this time (1:0/0/1)
I'm guessing Skytel doesn't like seeing the CID/From as "75000"?
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
The sq bracket means any of 4 or 8 or 0 or 2
Just saying.
Really? This I did not know. That may be the source of his issue right there. I figured he was using square brackets just to denote the different fields.

Look at that, right in the help file:
Code:
[1237-9]    matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
 

sstasterisk

Member
Joined
Jul 12, 2019
Messages
38
Reaction score
0
Really? This I did not know. That may be the source of his issue right there. I figured he was using square brackets just to denote the different fields.

Look at that, right in the help file:
Code:
[1237-9]    matches any digit or letter in the brackets (in this example, 1,2,3,7,8,9)
Server 2 Outbound Nanpa: Solved: Passing prefix like: [prepend=4802] | [prefix=4802] | [match=1NXXNXXXXXX]
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
698
Reaction score
93
Location
Ottawa, Canada
Server 2 Outbound Nanpa: Solved: Passing prefix like: [prepend=4802] | [prefix=4802] | [match=1NXXNXXXXXX]
:)
Essentially stripping 4802 and then inserting it again. A cleaner solution is to make your match string 48021NXXNXXXXXX with no prepend or prefix. But whatever works for you I guess.
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,560
Messages
138,866
Members
14,669
Latest member
cleron