@@ -772,16 +772,16 @@ fix_nated_register();
772
772
<function >nat_uac_test(flags)</function >
773
773
</title >
774
774
<para >
775
- Tries to guess if client's request originated behind a nat.
776
- The parameter determines what heuristics is used .
775
+ Determines whether the received SIP message originated behind a NAT,
776
+ using one or more pre-defined checks .
777
777
</para >
778
- <para >Meaning of the <emphasis >flags (string) </emphasis > parameter
779
- is as follows:</para >
778
+ <para >The <emphasis >flags</emphasis > (string) parameter denotes a
779
+ comma-separated list of checks to be performed, as follows:</para >
780
780
<itemizedlist >
781
781
<listitem ><para >
782
782
<emphasis >private-contact</emphasis > - (old <emphasis >1</emphasis > flag)
783
783
Contact header field is searched for occurrence of RFC1918 / RFC6598
784
- addresses.
784
+ addresses
785
785
</para ></listitem >
786
786
<listitem ><para >
787
787
<emphasis >diff-ip-src-via</emphasis > - (old <emphasis >2</emphasis > flag)
@@ -812,17 +812,26 @@ fix_nated_register();
812
812
<listitem ><para >
813
813
<emphasis >carrier-grade-nat</emphasis > - (old <emphasis >128</emphasis >
814
814
flag) also include RFC 6333 addresses in the checks for
815
- <emphasis >ct </emphasis >, <emphasis >via </emphasis > and
816
- <emphasis >sdp </emphasis > flags.
815
+ <emphasis >Contact </emphasis >, <emphasis >Via </emphasis > and
816
+ <emphasis >SDP </emphasis >
817
817
</para ></listitem >
818
818
</itemizedlist >
819
819
<para >
820
- A CSV of the above flags can be provided, the test returns true if any of
821
- the tests identified a NAT.
820
+ <emphasis role =' bold' >Returns true if any of the tests passed</emphasis >.
822
821
</para >
823
822
<para >
824
823
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.
825
824
</para >
825
+ <example >
826
+ <title ><function >nat_uac_test</function > usage</title >
827
+ <programlisting format =" linespecific" >
828
+ ...
829
+ # check for private Contact or SDP media IP addresses
830
+ if (nat_uac_test("private-contact,private-sdp"))
831
+ xlog("SIP message is NAT'ed (Call-ID: $ci)\n");
832
+ ...
833
+ </programlisting >
834
+ </example >
826
835
</section >
827
836
</section >
828
837
0 commit comments