Set dest Port in From Header

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
tschaikowskinksi
Posts: 23
Joined: Mon Apr 11, 2011 8:10 am

Set dest Port in From Header

Post by tschaikowskinksi »

1. Brekeke Product Name and version: 2.4.8.6/286.3

2. Java version:1.6

3. OS type and the version:Linux

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

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

6. Your problem:

I need to have the destination port included into the From header field:

E.g.

My Phone has set source port to 8090. When I call through Brekeke the other phone needs to know which port to call back. I would like to have this info inside the from header field like:

sip:myphone@mydomain:8090

for that I have inserted the following into the dial plan:

Matching:

From=sip:(.+)
$port=(.+)

Deploy:

From=sip:%1:%2

But the from header is not replaced accordingly.

Any idea?

Thanks!!!
janP
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by janP »

Which SIP phone product are you using?
Are you making your own SIP phone??


> When I call through Brekeke the other phone needs to know which
> port to call back.

Since you are using Brekeke SIP Server as a SIP proxy, you don't have to care about a call-back address/port, because other phone should use the SIP Server's address/port for making a call back.

> I would like to have this info inside the from header field like:

The From header will not be used for this purpose.
According to the RFC, the Contact header should be used.
tschaikowskinksi
Posts: 23
Joined: Mon Apr 11, 2011 8:10 am

Post by tschaikowskinksi »

>Which SIP phone product are you using?
>Are you making your own SIP phone??

I'm using PhonerLite


>Since you are using Brekeke SIP Server as a SIP proxy, you don't >have to care about a call-back address/port, because other phone >should use the SIP Server's address/port for making a call back.

Since I don't use the registration feature, SIP-Server know's nothing about any phone.

>The From header will not be used for this purpose.
>According to the RFC, the Contact header should be
>used.

Do you mean the receiving phone has to extract the info and concatenate the the uri by itselve? Or should it simply use the contact header field?

Thanks

Marco
tschaikowskinksi
Posts: 23
Joined: Mon Apr 11, 2011 8:10 am

Post by tschaikowskinksi »

Here is the INVITE, I see that brekeke changes the contact header to its own IP. Thus from there I cannot get the right callingNumber.
The correct information is located in the second via header (bolt).
Is it possible to have that info also in the sip contact/from?

Thanks marco



Session Initiation Protocol
Request-Line: INVITE sip:customer@10.91.99.10 SIP/2.0
Method: INVITE
[Resent Packet: False]
Message Header
Via: SIP/2.0/UDP 10.91.99.1:5060;rport;branch=z9hG4bK8da34dca886d49ca18d-17a65e66-31da8862
Transport: UDP
Sent-by Address: 10.91.99.1
Sent-by port: 5060
RPort: rport
Branch: z9hG4bK8da34dca886d49ca18d-17a65e66-31da8862
Via: SIP/2.0/UDP 10.56.24.109:5060;branch=z9hG4bK000a6c4a0c6fe0118bd0005056c00001;rport=8090;received=80.128.67.178
Transport: UDP
Sent-by Address: 10.56.24.109
Sent-by port: 5060
Branch: z9hG4bK000a6c4a0c6fe0118bd0005056c00001
RPort: 8090
Received: 80.128.67.178
From: "PhonerLite" <sip:frankfurt-customer@dyndns.tv>;tag=950107253
SIP Display info: "PhonerLite"
SIP from address: sip:frankfurt-customer@dyndns.tv
SIP tag: 950107253
To: <sip:customer@10.91.99.10>
SIP to address: sip:customer@10.91.99.10
Call-ID: 000A6C4A-0C6F-E011-8BCF-005056C00001@10.56.24.109
CSeq: 2 INVITE
Sequence Number: 2
Method: INVITE
Contact: <sip:frankfurt-customer@10.91.99.1:5060>
Contact Binding: <sip:frankfurt-customer@10.91.99.1:5060>
URI: <sip:frankfurt-customer@10.91.99.1:5060>
SIP contact address: sip:frankfurt-customer@10.91.99.1:5060
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 69
Supported: 100rel, replaces
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: <sip:frankfurt-customer@dyndns.tv>
P-Behind-NAT: Yes
Record-Route: <sip:10.91.99.1:5060;lr>
Content-Type: application/sdp
Content-Length: 392
janP
Posts: 336
Joined: Sun Nov 25, 2007 2:55 pm

Post by janP »

From your posts, you may need to modify From header as you planned because your phone doesn't use a register.

Try the DialPlan rule below.
-----------------------------------
[Matching patterns]
$request = ^INVITE
$getUri(From) = (.+)
$port = (.+)

[Deploy Patterns]
From = %1:%2
$continue = true
-----------------------------------
tschaikowskinksi
Posts: 23
Joined: Mon Apr 11, 2011 8:10 am

Post by tschaikowskinksi »

Thank you very much. That does the trick!!!
Post Reply