[OpenSIPS-Users] How to now if Cflags == NAT ?

Rodrigo Pimenta Carvalho pimenta at inatel.br
Thu Apr 20 14:37:51 EDT 2017


Dear OpenSIPS users,


Every time a SIP UAC registers in my OpenSIPS, if such agent is behind a NAT, the location record receives the NAT flag in the Cflags column. My Opensips configuration file is responsible for that.

For example:


AOR:: 1000
    Contact:: sip:1000 at 192.168.21.5:59047;transport=TLS;ob Q=
        Expires:: 298
        Callid:: ec88647d89564d9b8cf112cb254d0f04
        Cseq:: 34066
        User-agent:: MicroSIP/3.11.0
        Received:: sip:XXXXXXXXXXXX:59047;transport=TLS
        State:: CS_SYNC
        Flags:: 0
        Cflags:: NAT   <<===============  HERE IS THE NAT FLAG.


Now, if a SIP INVITE arrives in my OpenSIPS, from a UAC that is behind a NAT, I need do something like this:

if (Cflags == NAT) {

    fix_nated_sdp("10")

};


What is the correct way to investigate if Cflags is equals to NAT ? I mean, how to program such check in the script file?


Any hint will be very helpful!


Best regards!



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170420/eda01a73/attachment.html>


More information about the Users mailing list