SOLVED Wildcard Formatting

atsak

Guru
Joined
Sep 7, 2009
Messages
2,385
Reaction score
439
Routing inbound calls using CID.

Current is _1XXXXXXXXXX
Need to account for CID where the 1 is not provided by the caller (get both kinds)

What's the right format for that?
 

kenn10

Well-Known Member
Joined
Dec 16, 2007
Messages
3,779
Reaction score
2,190
Just create another route with _XXXXXXXXXX (you're just deleting the "1" from the original route.)
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,385
Reaction score
439
Just create another route with _XXXXXXXXXX (you're just deleting the "1" from the original route.)

Mmm there are 300 routes . . . that then means there's 600 routes on my inbound route list. I was hoping for a single route for each area code.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
Normalize your caller IDs before they get to the matching.

You can use the provided [from-pstn-e164-us] context as an example.

Then you will only need one set of either 10-digit or 11-digit matching rules, depending on how you decide to normalize (10-digit would be typical).
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,385
Reaction score
439
Ooo yes good idea - everything is from-trunk but I could change it to the e164-us context. Thanks.
 

billsimon

Well-Known Member
Joined
Jan 2, 2011
Messages
1,540
Reaction score
729
Ooo yes good idea - everything is from-trunk but I could change it to the e164-us context. Thanks.

The e164 context only manipulates numbers that start with +. You will have to copy that idea and make your own to handle caller IDs that start with 1. It should be quite simple. Put it in the extensions_custom.conf file and point your trunk(s) at it.
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,385
Reaction score
439
Oh, um, I just tested this sending a 1NXXXXXXXXX CID and it stripped it. I'm tired today so I can't figure out how that happened.

Here's the outbound leg log lines from the softphone:
-- Executing [s@macro-dialout-trunk:19] ExecIf("SIP/5554-001056c0", "1?Set(CONNECTEDLINE(num,i)=1855mynumber") in new stack
-- Executing [s@macro-dialout-trunk:20] ExecIf("SIP/5554-001056c0", "1?Set(CONNECTEDLINE(name,i)=CID:19474444444)

Here's the inbound leg.

Executing [1855mynumber@from-pstn-e164-us:1] Set("SIP/VI174.30-001056c2", "CALLERID(number)=9474444444") in new stack
-- Executing [1855mynumber@from-pstn-e164-us:2] Goto("SIP/VI174.30-001056c2", "from-pstn,1855mynumber,1") in new stack


Here's the context:


[from-pstn-e164-us]
exten => _+1NXXNXXXXXX/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _+1NXXNXXXXXX/_NXXNXXXXXX,2,Goto(from-pstn,${EXTEN:2},1)
exten => _+1NXXNXXXXXX/_+NX.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _+1NXXNXXXXXX/_011NX.,n,Goto(from-pstn,${EXTEN:2},1)
exten => _+1NXXNXXXXXX,1,Goto(from-pstn,${EXTEN:2},1)
exten => _[0-9+]./_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => _[0-9+]./_1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):1})
exten => _[0-9+]./_NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
exten => _[0-9+]./_+NX.,1,Set(CALLERID(number)=011${CALLERID(number):1})
exten => _[0-9+]./_011NX.,n,Goto(from-pstn,${EXTEN},1)
exten => _[0-9+].,1,Goto(from-pstn,${EXTEN},1)
exten => s/_+1NXXNXXXXXX,1,Set(CALLERID(number)=${CALLERID(number):2})
exten => s/_NXXNXXXXXX,n,Goto(from-pstn,${EXTEN},1)
 

Members online

Forum statistics

Threads
25,810
Messages
167,755
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top