#545 b2b uses socket instead of advertised address in Contact

modules (454)

I have been using the built in B2B scenario "top hiding" while running on Amazon EC2 with an associated Elastic IP. EC2 uses a 1 to 1 nat, So I have set the opensips advertised_address to my public elastic IP address.

When b2b init request is used, the proxy sends out a new invite and uses the advertised address in the Via header, but it uses the locally bound socket IP in the Contact header. This obviously causes problems because the local socket IP is a private ip address within EC2.

I have captured a SIP trace of this behaviour which you can find here.


I have tested this against 1.8 tarball, and opensips_head from svn as of 7/29/2012


  • Comment has been marked as spam. 

    You can see all pending comments posted by this user  here

    Anonymous - 2012-08-01

    NOTE: Because this is a 1 to 1 NAT situation, not a multi NIC setup, I can not call force_send_socket with the public IP address, because it does not exist on the box.

  • Anca Vamanu

    Anca Vamanu - 2012-08-05

    Hi Eric!

    I have investigated this and I have committed a fix that should provide a solution for your use case.
    Please update your code to rev 9165 or port this patch http://opensips.svn.sourceforge.net/opensips/?rev=9165&view=rev.
    Then you need to edit your configuration file and add an advertised address for the listen directive corresponding to the interface where the B2BUA receives the requests. It will look something like this:

    listen= as

    Here is the documentation for this parameter: http://www.opensips.org/Resources/DocsCoreFcn#toc54.

    Let us know the results.

    Anca Vamanu

  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> anca_vamanu
    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks