Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Cannot turn to P2P when ICE enabled
Author Message
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Fri Nov 06, 2015 12:50 am    Post subject: Cannot turn to P2P when ICE enabled Reply with quote

1. Brekeke Product Name and Version:
Brekeke SIP Server, Version 3.5.2.8, Evaluation

2. Java version:
1.7.0_65 (OpenJDK 64-Bit Server VM)

3. OS type and the version:
CentOS Linux release 6.0 (Final)
Linux 2.6.32-279.14.1.el6.x86_64

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

5. Your problem:
I enabled ICE and there were two UAs behind the same NAT. UA-1 made a call to UA-2. After the session was set up, an "UPDATE" request was sent from UA-1 to SIP server with SDP containing
Code:
c=IN IP4 192.168.0.108

and two candidates lines:
Code:
a=candidate:Hc0a8006c 1 UDP 2130706431 192.168.0.108 57166 typ host
a=candidate:Hc0a8006c 2 UDP 2130706430 192.168.0.108 48759 typ host

But when the SIP server forwarded the UPDATE request, the "c=" line is modified:
Code:
c=IN IP4 117.22.xxx.xxx

where "117.22.xxx.xxx" was the server's IP address, while the candidate lines remained the same as before. So this failed the P2P communicating.
Some of the SIP server's configurations are listed here:
Code:
SIP / NAT traversal
Keep address/port mapping: on
Interval (ms): 12000
Method: OPTIONS 
Add 'rport' parameter (Send): off
Add 'rport' parameter (Receive): off

RTP / RTP exchanger
RTP relay: auto 
RTP relay (UA on this machine): off
RTP relay even with ICE: no
Send UA's remote address: auto 
Send before receiving (behind NAT): no

Is there anything wrong with the configurations?
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Fri Nov 06, 2015 4:49 pm    Post subject: Reply with quote

Add $rtp=off in the DialPlan's DeployPattern.
It disables RTP-relay even if the SIP Server detects NAT.
Back to top
View user's profile
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Sun Nov 08, 2015 8:34 pm    Post subject: Reply with quote

Laurie wrote:
Add $rtp=off in the DialPlan's DeployPattern.
It disables RTP-relay even if the SIP Server detects NAT.

How should I set the "Matching Patterns"? I just left it empty and it just did not work. I could not set "$request" to "^UPDATE". Thanks.
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Sun Nov 08, 2015 9:55 pm    Post subject: Reply with quote

Is it an UPDATE sent within an INVITE's dialog?
If so, set $request = ^INVITE.
Back to top
View user's profile
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Sun Nov 08, 2015 10:57 pm    Post subject: Reply with quote

Laurie wrote:
Is it an UPDATE sent within an INVITE's dialog?
If so, set $request = ^INVITE.

Yes. The original "UPDATE" request contains
Code:
c=192.168.0.108

and the forwarded "UPDATE" contains
Code:
c=117.22.xx.xx

That's what I am confused.
There is only one dialplan. The "Match Pattern" is :
Code:
$request = ^INVITE

and the "Deploy Patterns" are:
Code:
$rtp = false
$nat = false
Back to top
View user's profile
taitan
Brekeke Master Guru


Joined: 15 Mar 2008
Posts: 237

PostPosted: Mon Nov 09, 2015 9:32 pm    Post subject: Reply with quote

Are you sure the above DialPlan rule is executed?
It seems $rtp=false is not called.

Check it at the DialPlan History page.


> c=117.22.xx.xx

Is it the caller side's global IP address?
Or is it the SIP Server's IP address?
Back to top
View user's profile
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Mon Nov 09, 2015 10:49 pm    Post subject: Reply with quote

taitan wrote:
Are you sure the above DialPlan rule is executed?
It seems $rtp=false is not called.

Check it at the DialPlan History page.


> c=117.22.xx.xx

Is it the caller side's global IP address?
Or is it the SIP Server's IP address?

From the DialPlan History, the above was executed on "INVITE" request, but not "UPDATE" request. "117.22.xx.xx" is the SIP Server's IP address.
Back to top
View user's profile
taitan
Brekeke Master Guru


Joined: 15 Mar 2008
Posts: 237

PostPosted: Tue Nov 10, 2015 10:52 pm    Post subject: Reply with quote

Are INVITE and UPDATE using a same Call-ID?
Back to top
View user's profile
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Wed Nov 11, 2015 12:36 am    Post subject: Reply with quote

taitan wrote:
Are INVITE and UPDATE using a same Call-ID?

Yes. Same Call-ID. I donot know how to attach a file to this thread and I can figoure out that:
    1. If the server's IP is 192.168.6.xxx, and the UAs' IP are 192.168.0.xxx which are behind a Router that is at the same subnet as the SIP server, say the SIP server's IP is 192.168.6.2 and the Router's IP is 192.168.6.3, the SIP server would not modify the "c=" line in the SDP, although the SIP server and UAs are not in the same subnet.

    2. If not, the SIP server would change the "c=" line whatever.
Back to top
View user's profile
Laurie
Brekeke Master Guru


Joined: 07 Jan 2008
Posts: 241

PostPosted: Wed Nov 11, 2015 10:35 am    Post subject: Reply with quote

Have you pushed the [Apply Rules] button after you modified the DialPlan?

There is no other DialPlan rules. Is it correct?
Back to top
View user's profile
roy.zhang
Brekeke Junior Member


Joined: 28 Oct 2015
Posts: 8
Location: China, Shaanxi

PostPosted: Wed Nov 11, 2015 6:21 pm    Post subject: Reply with quote

Laurie wrote:
Have you pushed the [Apply Rules] button after you modified the DialPlan?

Yes, I have. And from the history page, I can see the Rule has already taken effect, but on "INVITE" requests. My sessions were modified through "UPDATE" in-dialog and the rule just did not impact them.

Laurie wrote:
There is no other DialPlan rules. Is it correct?

Yes. Exactly ONE rule.
Back to top
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 494

PostPosted: Wed Nov 11, 2015 11:52 pm    Post subject: Reply with quote

Does the SIP server replace INVITE's "c=" line too even if you use "$rtp=false" in the DialPlan?
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