Forums Read-only archive

7 digit and 10-11 digit dialing

2 posts · Brekeke SIP Server Forum

sm8651 Original post
1. Brekeke Product Name and Version:
Brekeke SIP Server , Version 2.4.8.6 Advanced


5. Your problem:
i need a rule that says if the caller is dialing 10 or 11 digits it should go to the carrier as is. but if the customer is dialing 7 digits it should add a 3 digit area code. see below my existing rule, but need the other expressions.

currently it is sending all calls to the deploy rule.
Thanks,

MATCH
$request=^INVITE
To=sip:(.+)@
From=sip:(.+)@

Deploy
$auth=false
From="%2" <sip:%2@google.com;user=phone>
To=sip:%1@111.111.111.111
$session=failover sip:%1@111.111.11.11 sip:%1@222.22.22.22
&failover.timer.inviting=5
&failover.timer.provisional=360
$continue=false
hope
add following dial plan rule on top of current rule
such as 3-digit area code is 111

rule 1:
matching patterns
$request=^INVITE
To=sip:([0-9]{7})@(.+)

Deploy patterns
To = sip:111%1@%2
$target = 127.0.0.1