Alias call without modifying To header

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
AllstateTelecom
Posts: 9
Joined: Tue Aug 30, 2011 6:54 pm
Location: Jupiter, FL

Alias call without modifying To header

Post by AllstateTelecom »

1. Brekeke Product Name and version: Sip Server Advanced 2.4.8.6/286.3

2. Java version: 1.7.0

3. OS type and the version: Centos 5.6 (Linux 2.6.18-238.19.1.el5

4. UA (phone), gateway or other hardware/software involved: PBXNSIP IP_PBX

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :

6. Your problem:

Hello,

I just started using SIP Server, coming from OpenSIPS. I'm running into a problem where I need to setup an alias, have it forward to a registered user, but keep the to field as the alias.

Example:
Call comes in to 444-555-6666 which is an alias for 111-222-3333

The header currently reads as follows:

Code: Select all

INVITE: sip:1112223333@xxx.xxx.xxx.xxx:5060
TO: <sip:1112223333@xxx.xxx.xxx.xxx:5060>
The header needs to look as follows:

Code: Select all

INVITE: sip:1112223333@xxx.xxx.xxx.xxx:5060
TO: <sip:4445556666@xxx.xxx.xxx.xxx:5060>
Our PBX determines what extension to send the call to based on the To field. So we need the alias to be displayed in the to field and the registered number to be displayed in the INVITE request-uri. Does anyone know of a way to do this?

The current dial plan rule is as follows:

Matching Pattern:$request=^INVITE
To=sip:(.+)@
$alias.lookup("%1")=(.+)

Deploy Pattern:
To=sip:%2@

Thanks,
Brian[/u]
taitan
Posts: 237
Joined: Sat Mar 15, 2008 10:39 pm

Post by taitan »

Matching Pattern:
$request = ^INVITE
$getUri(To) = sip:(.+)@(.+)
$alias.lookup("%1") = (.+)
$regUri("%3") = (.+)

Deploy Pattern:
$request = INVITE %4 SIP/2.0
To = sip:%1@%2


Modify it as you want.
AllstateTelecom
Posts: 9
Joined: Tue Aug 30, 2011 6:54 pm
Location: Jupiter, FL

Post by AllstateTelecom »

Thanks for the fast reply Taitan.

It doesn't quite work... It throws back a busy signal, but when I $log out all of the lines it gives me the correct info. It almost looks as if the Invite isn't actually leaving the SIP Server. When I look at the logs in the PBX that should be receiving the call, it doesn't show any communication from the SIP Server.

Here is the output from the SIP Server log:

Code: Select all

------------------------------
debug:Hit rule 2 (Route_In)
debug: To sip:5614272244@208.115.60.141:5060
------------------------------
debug: Hit rule 3 (Convert_Alias)
debug:INVITE sip:5617431521@208.115.60.136:5060 SIP/2.0
debug:To=sip:5614272244@208.115.60.141:5060
------------------------------
There is no info on the PBX log to show.

Here is exactly what the rule states:
Matching Pattern

Code: Select all

$request=^INVITE
$getUri(To)=sip:(.+)@(.+)
$alias.lookup("%1")=(.+)
$regUri("%3")=(.+)
Deploy Pattern

Code: Select all

$request=INVITE %4 SIP/2.0
To=sip:%1@%2
$log=------------------------------
$log=debug: Hit rule 3 (Convert_Alias)
$log=debug:INVITE %4 SIP/2.0
$log=debug:To=sip:%1@%2
$log=------------------------------
By the way, I did remove the To=sip%1@%2 in the Deploy Pattern leaving only the invite to see if it would make a difference and it didn't.

Any thoughts?

Thanks again for the fast response,
Brian
taitan
Posts: 237
Joined: Sat Mar 15, 2008 10:39 pm

Post by taitan »

Add $regAddr in the Matching Pattern and add $target in Deploy Pattern


Matching Pattern:
$request = ^INVITE
$getUri(To) = sip:(.+)@(.+)
$alias.lookup("%1") = (.+)
$regUri("%3") = (.+)
$regAddr("%3") = (.+)


Deploy Pattern:
$request = INVITE %4 SIP/2.0
To = sip:%1@%2
$target = %5
$log=------------------------------
$log=debug: Hit rule 3 (Convert_Alias)
$log=debug:INVITE %4 SIP/2.0
$log=debug:To=sip:%1@%2
$log=debug:TargetAddr=%5
$log=------------------------------
AllstateTelecom
Posts: 9
Joined: Tue Aug 30, 2011 6:54 pm
Location: Jupiter, FL

Post by AllstateTelecom »

Thanks Taitan! That worked great.

Brian
Post Reply