[OpenSIPS-Users] Opensips not setting public ip when using mid_registrar module

Aqs Younas aqsyounas at gmail.com
Fri Jul 6 14:21:44 EDT 2018


Greeting list,

I have opensips behind the nat and using mid_registrar module with below
configuration.

listen=udp:10.111.222.4:5060 as 25.96.10.146:5060

loadmodule "mid_registrar.so"
modparam("mid_registrar", "mode", 0)
modparam("mid_registrar", "default_expires", 120)
modparam("mid_registrar", "max_expires", 120)
modparam("mid_registrar", "outgoing_expires", 7200)
modparam("mid_registrar", "received_avp", "$avp(received)")

And my Registration block.

      if (is_method("REGISTER")) {

                $du = "sip:41.76.34.144:5060";
mid_registrar_save("location");
                switch ($retcode) {
                case 1:
                        route(RELAY);
                        break;
                default:
                        xlog("L_INFO", "Failed");
                }
                exit;
        }

But I see Register leaving the server like below.

2018/07/06 18:11:59.343873 10.111.222.4:5060 -> 41.76.34.144:5060
REGISTER sip:captiveplanning.3cx.us:5060 SIP/2.0
Via: SIP/2.0/UDP 23.96.10.146:5060;branch=z9hG4bK7466.7191fac5.0
Via: SIP/2.0/UDP
10.0.0.125;rport=23144;received=x`;branch=z9hG4bKa981b751692BBD0A
From: "Debra Gaglioti" <sip:4245 at captiveplanning.3cx.us
>;tag=952308D0-E63A880D
To: <sip:4245 at captiveplanning.3cx.us>
CSeq: 333 REGISTER
Call-ID: da22e9a02781dcf350e2b1a5a313e358
*Contact: <sip:4245 at 10.111.222.4:5060;ctid=1716504776725769150>;expires=120*
User-Agent: PolycomVVX-VVX_301-UA/5.6.0.17325
Accept-Language: en-us,en;q=0.9
Proxy-Authorization: Digest username="devcmys", realm="3CXPhoneSystem",
nonce="414d535c115041d173:6dd675ef072ae25029323dd3d0e0bb11", uri="sip:
captiveplanning.3cx.us:5060", response="56c88b4
99d9e7da6dca69cfebdb23e", algorithm=MD5
Max-Forwards: 69
Expires: 120
Content-Length: 0

You can see contact header contains the IP of opensips listening interface
not the public ip as advertised.

Am i missing something or it is intended behavior?

Any suggestion is much appreciated.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20180706/14ff9fee/attachment.html>


More information about the Users mailing list