How to manipulate FROM in the dialplan

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
lsantos
Posts: 9
Joined: Mon Jan 20, 2020 11:40 am
Location: Porto Alegre - Brazil

How to manipulate FROM in the dialplan

Post by lsantos »

1. Brekeke Product Name and Version:
3.9.4.3/517-1
2. Java version:
11.05
3. OS type and the version:
Ubuntu Server 18.04
4. UA (phone), gateway or other hardware/software involved:
Zoiper 3.0
5. Your problem:
Hello, I am using multiple domains in my BSS, however when making calls the BSS is sending FROM the number + the domain, and with that the PSTN refuses the call.

How can I manipulate my FROM in my dialplan? I tried several modus to no avail.
Example:
5135000101@teste - wrong (Domain)
5135000101 - right way

Thanks.
Mohney
Posts: 79
Joined: Tue Nov 20, 2007 12:05 pm

Post by Mohney »

Do you want to remove a domain name part from the From URI?
Is it SIP-URL? or Tel-URL?

How does the SIP server connect to PSTN? Are you using an FXO gateway? or are you using a telephony provider?
lsantos
Posts: 9
Joined: Mon Jan 20, 2020 11:40 am
Location: Porto Alegre - Brazil

Post by lsantos »

I work at a telephone provider.
BSS connects to a BorderNet 4000 - Dialogic, however it cannot receive @domain together with FROM.

I tried to manipulate the dial plan as follows:

Deploy Patterns:
From =%{$ str.replace ("%{From}", "@test", "")}
To = sip:% 1@IP-Dialogic:5000

However, this way he only sends @test, I just need the opposite.
I'm checking out other ways.

Ideas are welcome.
lsantos
Posts: 9
Joined: Mon Jan 20, 2020 11:40 am
Location: Porto Alegre - Brazil

Post by lsantos »

We are using domain resource at brekeke, by this ways we have 2 domains, there are: flytelecom and lowtelecom

We are registering the user 111@flytelecom with softphone zoiper at brekeke from ip 172.17.108.122.

When we trying to make calls with this user, the From becomes at brekeke:

111%40flytelecom@172.17.108.122

Before forward to another sip server that will make the call externaly, we need to remove the string "%40flytelecom" from de From field, sending the From with 111@172.17.108.122

We tried by this way:

matching patterns:

$request = ^INVITE
To = sip:(.+)@
$str.contain($getSIPuser(From),"%40flytelecom") = true

deploy patterns:

From/uri = sip:%{$str.remove(%{$From},"%40flytelecom")}@%{$addr}
To = sip:%{$getSIPuser(To)}@172.30.51.10:5999

When make this call, the brekeke changes do From field before send call to my external sip server:

sip:,"%40flytelecom")}@172.17.108.122;transport=UDP

The function str.remove appear not working to remove the string "%40flytelecom".

Can We doing some mistake?

Thanks in advance
Mohney
Posts: 79
Joined: Tue Nov 20, 2007 12:05 pm

Post by Mohney »

> 111%40flytelecom@172.17.108.122

It is weird.
Does REGISTER packet sent from Zoiper indicate such a URL in Contact header?
If so, it will be a configuration issue at Zoiper.


I'm not sure the following DialPlan rule works or not.. but let you try.
Matching Patterns
$request = ^INVITE
$getSIPuser(From) = sip:(.+)%40
To = sip:(.+)@

Deploy Pattern
From = sip:%1@%{$ifAddr("172.30.51.10")}
To = sip:%2@172.30.51.10:5999
lsantos
Posts: 9
Joined: Mon Jan 20, 2020 11:40 am
Location: Porto Alegre - Brazil

Post by lsantos »

Hello,

It was really a problem in the zoiper :shock: , when testing on a grandstream ip phone he sent the SIP ID correctly.
Thank you. :D
Post Reply