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 >
/etc/opensips/opensips.cfg




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 <[email protected]> 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
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to