[OpenSIPS-Users] Docker centos

Tito Cumpen tito at xsvoce.com
Mon Jul 16 17:28:24 EDT 2018

For anyone who has to deal with this sort of scenario is added something to
the init script within the start function.

 PUBLICIP=$(curl -s http://whatismyip.akamai.com/)
        echo $PUBLICIP
        sed -i '/^advertised_address/d' /etc/opensips/opensips.m4
        sed -i '/####### Modules Section
########$/i\advertised_address=''\"'$PUBLICIP'\"' /etc/opensips/opensips.m4
        # there is something at end of this output which is needed to
        # report proper [ OK ] status in Fedora scripts
        m4 /etc/opensips/defines.m4 /etc/opensips/opensips.m4 >

This takes the public ip returned by the curl command and modifies the .m4
or cfg script with it.

On Thu, Jul 12, 2018 at 10:27 AM, Tito Cumpen <tito at xsvoce.com> wrote:

> Hello,
> I've made an image of opensips in centos 7 but one of my concerns is that
> docker uses internal IP addresses. With this being the case is there any
> way to make opensips use stun to figure out its public IP? I tried
> referencing the GitHub docker-opensips which runs in Debian but I cannot
> find anything in there addresses this issue.
> Thanks,
> Tito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180716/98e0c13c/attachment.html>

More information about the Users mailing list