Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Dial Plan-Match on 2 Variables
Author Message
tlsoren
Brekeke Addict


Joined: 15 Feb 2012
Posts: 32
Location: Raleigh, NC

PostPosted: Tue Mar 05, 2024 10:02 am    Post subject: Dial Plan-Match on 2 Variables Reply with quote

1. Brekeke Product Name and Version: 3.14.5.17/563.2

2. Java version: 11.0.15

3. OS type and the version: Server 2012R2

4. UA (phone), gateway or other hardware/software involved: R5 Alerts out via SIP to Middleware

5. Your problem: Looking for Dial Plan Assistance. I need to add 3 new dial rules to 3 existing Dial rules to match of off 2 variables within the SIP Header, and replace one of those variables in the Deploy, and keep he existing rules active.

Existing Dial Plan Example:
Matching: Deploy:
$Request=^Invite To=sip%1@10.10.10.10
$registered=false
To=sip:(8888)@

New rule needs to Match on 8888 destination and also match on if SIP Header contains the string GGGxx. In the deploy, we still send to 8888 and also replace GGGxx string with GGG in the SIP Header.

I am not sure of the syntax to match on 2 variables, and how to replace the GGGxx part in the deploy.

Thank you in advance for any assistance.

_________________
TLS
Back to top
View user's profile
tlsoren
Brekeke Addict


Joined: 15 Feb 2012
Posts: 32
Location: Raleigh, NC

PostPosted: Tue Mar 05, 2024 11:58 am    Post subject: Reply with quote

This what we have created to try.

Matching: Deploy:
$Request=^Invite To=sip%1@10.10.10.10
$registered=false From=GGG
To=sip:(8888)@
From=GGGxx

Not sure if if the Deploy will replace the whole From Header, we just need it to replace GGGxx with GGG

An input would be appreciated. We cannot test this unfortunately until a test on the live system is scheduled.

Issue: New rule needs to Match on 8888 destination and also match on if SIP Header contains the string GGGxx. In the deploy, we still send to 8888 and also replace GGGxx string with GGG in the SIP Header.

_________________
TLS
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Tue Mar 05, 2024 12:31 pm    Post subject: Reply with quote

Can you try the DialPlan rule like this?
Matching Patterns
$request = ^INVITE
$registered = false
To = sip:(8888)@
$getdisplayname(From) = GGGxx
Deploy Patterns
To = sip:%1@10.10.10.10
From/displayname = GGG
Back to top
View user's profile
tlsoren
Brekeke Addict


Joined: 15 Feb 2012
Posts: 32
Location: Raleigh, NC

PostPosted: Tue Mar 05, 2024 4:14 pm    Post subject: Reply with quote

Thank you Laurie! We will have testing scheduled tomorrow and I will update the results.

We also just got an additional request from the customer, to Match on the incoming dial back destination string 50* (To) and replace that string before deploying to 150*

Using your help in the dial plan above, I have created this rule. Please let me know if it looks good.

Matching: Deploy:
$addr = ^192\.168\. To = sip%1@10.10.10.10
$Request = ^Invite To/displayname = 150*
To=sip:(.+)@
$getdisplayname(To) = 50*

_________________
TLS
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Tue Mar 05, 2024 11:06 pm    Post subject: Reply with quote

If it is a dialed number, you don't have to use a displayname.
Matching Patterns
$request = ^INVITE
$addr = ^192\.168\.
To = sip:50\*(.+)@
Deploy Patterns
To = sip:150\*%1@10.10.10.10
Back to top
View user's profile
tlsoren
Brekeke Addict


Joined: 15 Feb 2012
Posts: 32
Location: Raleigh, NC

PostPosted: Wed Mar 06, 2024 11:03 am    Post subject: Reply with quote

Hello Laurie,

We tested this outbound dial plan, and it failed.
Matching Patterns
$request = ^INVITE
$registered = false
To = sip:(8888)@
$getdisplayname(From) = GGGxx
Deploy Patterns
To = sip:%1@10.10.10.10
From/displayname = GGG

The Invite did Match to the rule, and did strip away the xx, but it also stripped away the rest of the information in the From. We were only looking to Match on GGGxx, and replace with GGG while keeping the rest of the From field intact.

Here is the From field for these Alert prior to hitting the rule:
From: GGGxxC556_1 Patient<sip:R5_RGS@10.68.32.41:5060> ;tag=1db25e65-66995d8a-1c95ed-62b1748-2020440a-13c4-759
SIP from display info: 5GJxxC556_1 Patient

Here is the From after hitting the above rule:
From: "GGG" <sip:R5_RGS@10.68.32.41:5060>;tag=b18f865e4s
SIP from display info: "5GJ"

Can you help with matching to GGGxx, but only replacing it to GGG and keeping the rest of the From intact?

_________________
TLS
Back to top
View user's profile
tlsoren
Brekeke Addict


Joined: 15 Feb 2012
Posts: 32
Location: Raleigh, NC

PostPosted: Wed Mar 06, 2024 11:41 am    Post subject: Reply with quote

I had a typo in that last post, here is the correct overview:

Here is the From field for these Alert prior to hitting the rule:
From: GGGxxC556_1 Patient<sip:R5_RGS@10.68.32.41:5060> ;tag=1db25e65-66995d8a-1c95ed-62b1748-2020440a-13c4-759
SIP from display info: GGGxxC556_1 Patient

Here is the From after hitting the above rule:
From: "GGG" <sip:R5_RGS@10.68.32.41:5060>;tag=b18f865e4s

Can you help with matching to GGGxx, but only replacing it to GGG and keeping the rest of the From intact?SIP from display info: "GGG"

_________________
TLS
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Wed Mar 06, 2024 8:17 pm    Post subject: Reply with quote

How about this?
Matching Patterns
$request = ^INVITE
$registered = false
To = sip:(8888)@
$getdisplayname(From) = GGGxx(.+)
Deploy Patterns
To = sip:%1@10.10.10.10
From/displayname = GGG%2
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1