hnimminh / libresbc

An open source Session Border Controller 🌟 The SBC you dream about 🗽 LibreSBC will help you save thousands of dollars.
https://github.com/hnimminh/libresbc
MIT License
357 stars 80 forks source link

[BUG] Unhandling loopback source when sbc under NAT #55

Closed hnimminh closed 2 years ago

hnimminh commented 2 years ago

trigger by #54

hnimminh commented 2 years ago

fix nat ignore for proxy on loopback network https://github.com/signalwire/freeswitch/pull/1719

Screen Shot 2022-07-17 at 22 42 00

Environment:

Step: make call from UAC (sip phone) [UAC] ---internet ---- [KAMAILIO] --- loopback ---- [FreeSWITCH] ------- [NEXTHOP]

Actual Result:

Expected:

Self-Check: since the NAT check logic in switch_core_media.c always include ignore if remote is loopback as below:

    return (smh->mparams->extsipip &&
            !switch_check_network_list_ip(network_ip, "loopback.auto") &&
            !switch_check_network_list_ip(network_ip, smh->mparams->local_network));

Work Around Override built in loopback.auto by:

        <list name="loopback.auto" default="deny">
          <node type="allow" cidr="127.0.0.1/32"/>
       </list>