Menu

#345 Multiple accounts and NAT/STUN/public IP

Fixed
nobody
None
Medium
Enhancement
2012-08-07
2010-11-05
Anonymous
No

Originally created by: karnevil...@gmail.com
Originally owned by: r3gis...@gmail.com

What steps will reproduce the problem?
1. Create two accounts: the first has server in same subnet of wifi link, the second is on internet, reached via router that apply NAT on internal addresses
2. beginning with both account disabled, enable first the internet one, then the local one
3. activating only the local one then there's no problem (after restarting csipsimple)

What is the expected output? What do you see instead?
The local one will not register, tracing sip packets in each field it report the external router address instead of local one and then local server cannot reach it

What version of the product are you using? On what operating system?
HTC Wildfire 2.1 Eclair

Please provide any additional information below.

Those are two fields taken from REGISTER packet:

Via: SIP/2.0/UDP 89.120.100.63:5060;rport;branch=z9hG4bKPjbQcWcHljyI18MvElx8y6uC6xAv.XvMpG
Contact: <sip:65@89.120.100.63:5060>

The 89.120.100.63 should be 10.0.1.9.

Related

Tickets: #1251
Tickets: #1447
Tickets: #1464
Tickets: #390
Tickets: #481
Tickets: #536
Tickets: #774
Tickets: #820
Tickets: #920

Discussion

  • Anonymous

    Anonymous - 2010-11-05

    Originally posted by: karnevil...@gmail.com

    Sorry, forget adding csipsimple revision: 0.00-15-09

     
  • Anonymous

    Anonymous - 2010-11-06

    Originally posted by: r3gis...@gmail.com

    Yes unfortunately that's a back side of pjsip behavior.
    As it try to get rid of NATed network detecting your public IP (as if you activate stun), it try to always use it's public IP for all account.

    The sip stack consider you have an unique public IP and as consequence as soon as it detect a public IP for one account it consider this IP is valid for all account. It has advantages (speed of registration in standard cases) but also disavantages (your use case is typically one big disavantange of this approach).
    But that's the behavior of the stack CSipSimple is relying on.

    I'll check if there is not an extra option in pjsip that could help to solve this kind of issue (if so, I'll add an option in settings).
    Anyway, if you have the complete hand on your network, what I can advise to you is :

    * Assign a static dhcp lease to your mobile device inside the enterprise
    * Use expert wizard for your enterprise account (you can switch from existing wizard using menu > choose wizard)
    * Use "Force contact" field and fill it with display name <sip:username@10.0.1.xxx>
    where 10.0.1.xxx is the static dhcp lease.
    I don't know if it will help for via field but at least for contact it will solve your problem.
    That's a temporary hack.

    If your need is to be registered only with your enterprise ip-pbx on your local network and with the public on the public network, another more user friendly solution would be something that activate/deactivate account according to the current android setting/configuration state.
    It has been discussed in another issue here (about intent to activate/deactivate accounts and Locale application)

    So open point for me : I'll check if there is any way to bypass this behavior in pjsip.

    Else will probably linked to the issue about activation/deactivation of account according device state (if the use case is OK for you, and if you don't actually need both account to be registered while in your local network... but I guess that in this case your local sip server can be a good sip proxy for your requests to another sip server).

    Status: Accepted

     
  • Anonymous

    Anonymous - 2010-11-08

    Originally posted by: karnevil...@gmail.com

    Ok, this is not big problem for us now, it's only an add-on as my main target is using it in our enterprise ip-pbx (and I don't exclude that in future I could publish it on internet in order that our terminals could get connected to it also around the world).

     
  • Anonymous

    Anonymous - 2011-01-08

    Originally posted by: r3gis...@gmail.com

    Seems to be taken into account for pjsip-2.0.

    So CSipSimple will automatically benefit it as soon as I'll move to pjsip-2.0 :
    For reference ticket : http://trac.pjsip.org/repos/ticket/539

    It will also improve battery life according to the ticket :)

     
  • Anonymous

    Anonymous - 2011-01-10

    Originally posted by: karnevil...@gmail.com

    That's good, but, about battery life, the main problem is the partial wake-lock.

    After weeks of testing, definitively it's the big difference in standby battery life.

    Without partial wake-lock, standby time is not so less by having CSipSimple active or not, for usual activity of the phone I don't see difference. But in this case the problem is that Register timeout is not honoured, so looking at asterisk log, phone will re-register with random time, most of the time when timeout is expired (thus it doesn't answer to incoming call).

    With partial wake-lock I have to recharge each day, also with few minutes of calls. But in this case register timeout is honoured, thus always answer incoming call.

    No other functionality are affected by this settings (in all my testing).

     
  • Anonymous

    Anonymous - 2011-09-02

    Originally posted by: zugsch...@gmail.com

    If this bug tracking system allows to edit the subject of an issue, this one should be change to contain STUN in its subject. There are duplicates filed monthly, and I for sure know that #1251 wouldn't have been filed if I found this issue while searching for STUN ;)

     
  • Anonymous

    Anonymous - 2011-09-02

    Originally posted by: r3gis...@gmail.com

    Done :)

    But no problem with the duplicate don't worry ;)

    I'm also often lost with all open issues. I should take time to treat all issues and merge duplicates/obsolete. (But for now I've not enough times to do so, when I got little time for csipsimple, I prefer to actually produce code ;) ).

    Summary: Multiple accounts and NAT/STUN/public IP

     
  • Anonymous

    Anonymous - 2011-11-05

    Originally posted by: r3gis...@gmail.com

    For reference, a new more precise ticket has been created on pjsip project about this particular point for pjsip-2.0 : https://trac.pjsip.org/repos/ticket/1412

    BTW, I've already a working patch for this special use case, but I will wait for pjsip implementation in their official 2.0 release.
    A release of csipsimple will be done soon based on pjsip 1.x with current trunk (which is freezed and waits for stability feedback). Once this release will be done, the nightly builds will be based on pjsip-2.0 and it will be possible to have either what was added by pjsip guys or my patch.

    Owner: r3gis...@gmail.com
    Status: Started

     
  • Anonymous

    Anonymous - 2012-01-08

    Originally posted by: laurent....@gmail.com

    Hello,
    Same behaviour here with a Freebox SIP account (public IP) and a Aastra Nexspan (private network).

    In my case it seems that if the private IP account registers first, it works.

     
  • Anonymous

    Anonymous - 2012-01-08

    Originally posted by: r3gis...@gmail.com

    Yes indeed. The sip stack as only one "global" ip address. So if the first account to register is the private one it will work for first registration. However, re-registration will be broken then.
    I really hope pjsip guys will take the point into account.

     
  • Anonymous

    Anonymous - 2012-03-14

    Originally posted by: SpiderErrol

    For those experiencing the problem, I have had success buy turning on NAT support for the account on the *server* on the private network (or all servers).

    This sounds backwards as there is no NAT going on for that link, but it makes the server ignore the Via header and use the packet's origin so allows multiple accounts to work until the issue is fixed!

     
  • Anonymous

    Anonymous - 2012-03-19

    Originally posted by: szims...@gmail.com

    The https://trac.pjsip.org/repos/ticket/1412 issue is now 5 months old. I can't see any process in https://trac.pjsip.org/repos/log/pjproject :(

    Is there a chance that it'll be solved soon?

     
  • Anonymous

    Anonymous - 2012-03-19

    Originally posted by: r3gis...@gmail.com

    You should ask on pjsip dev mailing list ;).

    I personally have no news about this enhancement request we did.
    If I get some time to propose a patch to pjsip guys I'll do, but I'm more focused on stuff on CSipSimple/android side for now.
    So we wait for pjsip developers to implement that, and then csipsimple (and all other apps based on pjsip) will automatically have the feature. (I'll have some low effort to do to reflect the setting in the expert wizard, but can be done quickly once the feature is in the sip stack).

     
  • Anonymous

    Anonymous - 2012-08-07

    Originally posted by: r3gis...@gmail.com

    Good news, it's now in pjsip. (cf https://trac.pjsip.org/repos/changeset/4218)
    I just started the work to integrate that in csipsimple user interface. Will land soon :)

    Labels: -Type-Defect Type-Enhancement

     

Log in to post a comment.