Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
sip server change contact ip address to its private address
Author Message
sesci
Brekeke Member


Joined: 13 Jan 2014
Posts: 10
Location: TÜRKİYE

PostPosted: Mon Aug 07, 2017 2:28 am    Post subject: sip server change contact ip address to its private address Reply with quote

1. Brekeke Product Name and Version:
Brekeke sip server 3.7.4.8
2. Java version:

3. OS type and the version:
windows 10
4. UA (phone), gateway or other hardware/software involved:
pjsip s,p phone, x-lite
5. Your problem:
I have a 2 sip server which connect to internet over firewall/NAT device. sip server 2 is behind checkpoint firewall, sip server 1 is behind the another brand firewall. And I have 2 sip phone which connect to internet over NAT(DSL modem or 4G modem) device. sip phones located separetly locations.
When sip phones call each other over sip server 2, everything works. if they call each other over server 1, 200 ok and ACK messages goes to wrong ip. sip phone 1 send invite message to server, server send this invite message to sipphone 2 . during calls, invite messages which comes from sip phones to server, are almost same. but sip server send this invite message to other phone, sip server 1 change invite message contact ip to its private ip , sip server 2 change invite message contact ip to its public ip. because of that, sip phone 2 try to send 200ok message to sip server 1 private ip address and sip server 2 public ip address. sip server 2 can get 200ok message but sip server 1 cannot get 200ok message. how can I solve this problem. both sip server version and configuration are same. Could I push sip server to use its public ip for invite message contact information.
PS: RTP packets goes over TURN server which connect to internet directly.
Back to top
View user's profile
taitan
Brekeke Master Guru


Joined: 15 Mar 2008
Posts: 237

PostPosted: Mon Aug 07, 2017 9:03 am    Post subject: Reply with quote

Go to [Status]->[SIP Server] status page and find the [interface] filed.
Does it show the SIP Server's public IP address?

If not, set the public IP address at [Configuration]->[System] page -> [Interface address 1] field, and then restart the SIP Server.

Refer the following wiki topic.
http://wiki.brekeke.com/wiki/Set-port-forwarding


If you don't have the above setting at the SIP server 2 too, I suppose the firewall has the SIP-ALG function which replaces Contact header of INVITE with the public IP address.
SIP-ALG is a challenging function but it will not cover all of SIP situations so I recommend that you disable SIP-ALG at the firewall.
Back to top
View user's profile
sesci
Brekeke Member


Joined: 13 Jan 2014
Posts: 10
Location: TÜRKİYE

PostPosted: Mon Aug 07, 2017 10:53 pm    Post subject: Reply with quote

I have already set the public address and when I checked from status section, I see the both public and private address. Both sip server configs are same.
on the other hand, when I analyze packets which comes and goes from sip server, "contact" information change at sip server not at firewall. So, in my opinion, firewall sip-alg function is not effect this situation.
I changed sip server locations and the IP address, same thing is occur. maybe, sip server 1 firewall has change the first invite message some fields which comes to the sip server and because of this change, sip server is add its private address to contact field which goes from sip server. But I couldn't find what changed.
Back to top
View user's profile
taitan
Brekeke Master Guru


Joined: 15 Mar 2008
Posts: 237

PostPosted: Tue Aug 08, 2017 5:26 pm    Post subject: Reply with quote

Which firewall product are you using for SIP Server 1?

Can you go to [Dial Plan]->[History] page after you make a test call over the Server 1?

And then click the latest field number which indicates "INVITE".
If so, the both Incoming and Outgoing packets are shown.

At the Outgoing packet, check "Contact:" header to see whether it is a private IP address or public IP address.
Back to top
View user's profile
sesci
Brekeke Member


Joined: 13 Jan 2014
Posts: 10
Location: TÜRKİYE

PostPosted: Wed Aug 09, 2017 12:46 am    Post subject: Reply with quote

I couldnt say firewall brand.
I checked incoming and outgoing invite messages from server 1, outgoing contact field is server 1 private ip. server 2 outgoing invite message contact field is public ip.
when I check these messages, I saw that, server 1 invite message -incoming and outgoing both of them- message header order is "via-contact-to-from", server 2 invite message message header order is "via-from-to-contact". sip phones send invite message message header order is "via-from-to-contact". During invite message arriving to server from sipphone, this order changing. Is this order cause this problem?
Back to top
View user's profile
taitan
Brekeke Master Guru


Joined: 15 Mar 2008
Posts: 237

PostPosted: Wed Aug 09, 2017 9:00 pm    Post subject: Reply with quote

Generally an order of these SIP headers are not important.

Is it the same sipphone 2 at both server1 and server 2 testings?

If so, is it the same IP address from server 1 and server 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