Browse code

nathelper: docs - fixed copy/paste extra tags

Daniel-Constantin Mierla authored on 07/07/2021 05:51:31
Showing 1 changed files
... ...
@@ -723,7 +723,6 @@ fix_nated_register();
723 723
 			and D-URI ($du). For replies, it compares host and port in 2nd Via
724 724
 			with received and rport parameters.
725 725
 			</para></listitem>
726
-			<listitem><para>
727 726
 			</itemizedlist>
728 727
 		<para>
729 728
 		All flags can be bitwise combined, the test returns true if any of 
Browse code

nathelper: docs for nat uac test 512

Daniel-Constantin Mierla authored on 06/07/2021 09:53:39
Showing 1 changed files
... ...
@@ -717,6 +717,13 @@ fix_nated_register();
717 717
 			from source IP address. It will work also with multiple connection address
718 718
 			lines.
719 719
 			</para></listitem>
720
+			<listitem><para>
721
+			<emphasis>512</emphasis> -  Test if the target addresses are different
722
+			or over websocket. For requests, it compares host and port in R-URI ($rU)
723
+			and D-URI ($du). For replies, it compares host and port in 2nd Via
724
+			with received and rport parameters.
725
+			</para></listitem>
726
+			<listitem><para>
720 727
 			</itemizedlist>
721 728
 		<para>
722 729
 		All flags can be bitwise combined, the test returns true if any of 
Browse code

nathelper: docs for mode parameter for handle_ruri_alias()

Daniel-Constantin Mierla authored on 01/06/2021 07:29:10
Showing 1 changed files
... ...
@@ -794,17 +794,21 @@ if(is_rfc1918("$rd")) {
794 794
 
795 795
 	<section id="nathelper.f.handle_ruri_alias">
796 796
 		<title>
797
-		<function moreinfo="none">handle_ruri_alias()</function>
797
+		<function moreinfo="none">handle_ruri_alias([mode])</function>
798 798
 		</title>
799 799
 		<para>
800 800
 		Checks if the Request URI has an <quote>alias</quote>
801 801
 		parameter and if so, removes it and sets the <quote>$du</quote> based
802
-		on its value.  Note that this means that routing of request is based on 
803
-		<quote>;alias</quote> parameter value of the Request URI rather than 
802
+		on its value. Note that this means that routing of request is based on
803
+		<quote>;alias</quote> parameter value of the Request URI rather than
804 804
 		the Request URI itself. If you call <function>handle_ruri_alias()</function>
805 805
 		on a request, make sure that you screen the alias parameter value of
806
-		Request URI the same way as you would screen the
807
-		Request URI itself.
806
+		Request URI the same way as you would screen the Request URI itself.
807
+		</para>
808
+		<para>
809
+		The optional parameter mode can be 0 to consume first alias parameter,
810
+		otherwise it consumes the last alias parameter. If the parameter mode is
811
+		not provided, it consumes the first parameter.
808 812
 		</para>
809 813
 		<para>
810 814
 		Returns <emphasis>1</emphasis> if <quote>;alias</quote> parameter was
Browse code

nathelper: docs - fixed typos

Bastian Triller authored on 16/10/2020 10:41:00 • Henning Westerholt committed on 16/10/2020 12:10:45
Showing 1 changed files
... ...
@@ -562,7 +562,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
562 562
 				<listitem>
563 563
 					<para><emphasis>0x02</emphasis> - rewrite media
564 564
 					&ip; address (c=) with source address of the message
565
-					or the provided IP address. (a=rtpc) param will be rewritten if exists. (the provided IP address take
565
+					or the provided IP address. (a=rtcp) param will be rewritten if exists. (the provided IP address take
566 566
 					precedence over the source address).</para>
567 567
 				</listitem>
568 568
 				<listitem>
... ...
@@ -572,7 +572,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
572 572
 				<listitem>
573 573
 					<para><emphasis>0x08</emphasis> - rewrite IP from
574 574
 					origin description (o=) with source address of the message
575
-					or the provided IP address. (a=rtpc) param will be rewritten if exists. (the provided IP address take
575
+					or the provided IP address. (a=rtcp) param will be rewritten if exists. (the provided IP address take
576 576
 					precedence over the source address).</para>
577 577
 				</listitem>
578 578
 			</itemizedlist>
... ...
@@ -582,7 +582,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
582 582
 			If not specified, the received signalling IP will be used. The
583 583
 			parameter allows pseudo-variables usage. NOTE: For the IP to be
584 584
 			used, you need to use 0x02 or 0x08 flags, otherwise it will have
585
-			no effect. Must be IPv4 address family. 
585
+			no effect. Must be IPv4 address family.
586 586
 			</para>
587 587
 			</listitem>
588 588
 		</itemizedlist>
Browse code

nathelper: docs - updated notes for fix_nated_sdp. few typos fixed [skip ci]

Arsen Semenov authored on 06/10/2020 06:40:27 • Daniel-Constantin Mierla committed on 06/10/2020 09:51:24
Showing 1 changed files
... ...
@@ -562,7 +562,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
562 562
 				<listitem>
563 563
 					<para><emphasis>0x02</emphasis> - rewrite media
564 564
 					&ip; address (c=) with source address of the message
565
-					or the provided IP address (the provide IP address take
565
+					or the provided IP address. (a=rtpc) param will be rewritten if exists. (the provided IP address take
566 566
 					precedence over the source address).</para>
567 567
 				</listitem>
568 568
 				<listitem>
... ...
@@ -572,7 +572,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
572 572
 				<listitem>
573 573
 					<para><emphasis>0x08</emphasis> - rewrite IP from
574 574
 					origin description (o=) with source address of the message
575
-					or the provided IP address (the provide IP address take
575
+					or the provided IP address. (a=rtpc) param will be rewritten if exists. (the provided IP address take
576 576
 					precedence over the source address).</para>
577 577
 				</listitem>
578 578
 			</itemizedlist>
... ...
@@ -582,7 +582,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
582 582
 			If not specified, the received signalling IP will be used. The
583 583
 			parameter allows pseudo-variables usage. NOTE: For the IP to be
584 584
 			used, you need to use 0x02 or 0x08 flags, otherwise it will have
585
-			no effect.
585
+			no effect. Must be IPv4 address family. 
586 586
 			</para>
587 587
 			</listitem>
588 588
 		</itemizedlist>
Browse code

nathelper: add optional set_contact_alias([trim]) parameter

Emmanuel Schmidbauer authored on 03/07/2020 18:00:57
Showing 1 changed files
... ...
@@ -842,7 +842,7 @@ if(is_rfc1918("$rd")) {
842 842
 
843 843
 	<section id="nathelper.set_contact_alias">
844 844
 		<title>
845
-		<function moreinfo="none">set_contact_alias()</function>
845
+		<function moreinfo="none">set_contact_alias([trim])</function>
846 846
 		</title>
847 847
 		<para>
848 848
 		Adds an <quote>;alias=ip~port~transport</quote> parameter to the
... ...
@@ -850,6 +850,16 @@ if(is_rfc1918("$rd")) {
850 850
 		The new contact URI is immediately visible to other modules in the
851 851
 		way the <function>fix_nated_contact()</function> does it.
852 852
 		</para>
853
+		<para>Meaning of parameters:</para>
854
+		<itemizedlist>
855
+			<listitem>
856
+				<para>
857
+					<emphasis>trim</emphasis> - by default, set_contact_alias() will not detect and trim an
858
+					already existing alias parameter. If this optional parameter is set to "1", set_contact_alias()
859
+					will trim the existing alias before adding a new one.
860
+				</para>
861
+			</listitem>
862
+		</itemizedlist>
853 863
 		<para>
854 864
 		This function can be used from
855 865
 		REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, and FAILURE_ROUTE.
Browse code

Revert "nathelper: add optional set_contact_alias([trim]) parameter"

Emmanuel Schmidbauer authored on 03/07/2020 17:22:16 • GitHub committed on 03/07/2020 17:22:16
Showing 1 changed files
... ...
@@ -842,7 +842,7 @@ if(is_rfc1918("$rd")) {
842 842
 
843 843
 	<section id="nathelper.set_contact_alias">
844 844
 		<title>
845
-		<function moreinfo="none">set_contact_alias([trim])</function>
845
+		<function moreinfo="none">set_contact_alias()</function>
846 846
 		</title>
847 847
 		<para>
848 848
 		Adds an <quote>;alias=ip~port~transport</quote> parameter to the
... ...
@@ -850,16 +850,6 @@ if(is_rfc1918("$rd")) {
850 850
 		The new contact URI is immediately visible to other modules in the
851 851
 		way the <function>fix_nated_contact()</function> does it.
852 852
 		</para>
853
-		<para>Meaning of parameters:</para>
854
-		<itemizedlist>
855
-			<listitem>
856
-				<para>
857
-					<emphasis>trim</emphasis> - by default, set_contact_alias() will not detect and trim an
858
-					already existing alias parameter. If this optional parameter is set to "1", set_contact_alias()
859
-					will trim the existing alias before adding a new one.
860
-				</para>
861
-			</listitem>
862
-		</itemizedlist>
863 853
 		<para>
864 854
 		This function can be used from
865 855
 		REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, and FAILURE_ROUTE.
Browse code

nathelper: add optional set_contact_alias([trim]) parameter

Emmanuel Schmidbauer authored on 02/07/2020 15:43:45
Showing 1 changed files
... ...
@@ -842,7 +842,7 @@ if(is_rfc1918("$rd")) {
842 842
 
843 843
 	<section id="nathelper.set_contact_alias">
844 844
 		<title>
845
-		<function moreinfo="none">set_contact_alias()</function>
845
+		<function moreinfo="none">set_contact_alias([trim])</function>
846 846
 		</title>
847 847
 		<para>
848 848
 		Adds an <quote>;alias=ip~port~transport</quote> parameter to the
... ...
@@ -850,6 +850,16 @@ if(is_rfc1918("$rd")) {
850 850
 		The new contact URI is immediately visible to other modules in the
851 851
 		way the <function>fix_nated_contact()</function> does it.
852 852
 		</para>
853
+		<para>Meaning of parameters:</para>
854
+		<itemizedlist>
855
+			<listitem>
856
+				<para>
857
+					<emphasis>trim</emphasis> - by default, set_contact_alias() will not detect and trim an
858
+					already existing alias parameter. If this optional parameter is set to "1", set_contact_alias()
859
+					will trim the existing alias before adding a new one.
860
+				</para>
861
+			</listitem>
862
+		</itemizedlist>
853 863
 		<para>
854 864
 		This function can be used from
855 865
 		REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, and FAILURE_ROUTE.
Browse code

nathelper: update flag documenation

Henning Westerholt authored on 22/04/2020 12:52:12
Showing 1 changed files
... ...
@@ -173,13 +173,13 @@ modparam("nathelper", "natping_interval", 10)
173 173
 		<title><varname>ping_nated_only</varname> (integer)</title>
174 174
 		<para>
175 175
 		If this parameter is set to 1 then only contacts that have
176
-		<quote>behind_NAT</quote> flag in user location database set will
177
-		get ping.
176
+		the behind NAT <quote>nat_bflag</quote> flag in user location
177
+		database set will get ping.
178 178
 		</para>
179 179
 		<para>
180
-		If it is 0 and sipping_flag is not set, then the 4-bytes UDP ping is
181
-		sent to all contacts. If it is 0 and sipping_flag parameter is set, then
182
-		SIP-request-based pinging is sent to all contacts.
180
+		If it is 0 and sipping_bflag is not set, then the 4-bytes UDP ping
181
+		is sent to all contacts. If it is 0 and sipping_bflag parameter
182
+		is set, then SIP-request-based pinging is sent to all contacts.
183 183
 		</para>
184 184
 		<para>
185 185
 		<emphasis>
Browse code

nathelper: docs - fix ending tags issues introduced with previous commit

Daniel-Constantin Mierla authored on 16/04/2020 09:58:23
Showing 1 changed files
... ...
@@ -477,26 +477,26 @@ modparam("nathelper", "filter_server_id", 1)
477 477
 		<itemizedlist>
478 478
 			<listitem>
479 479
 				<para>10.0.0.0/8</para>
480
-			<listitem>
480
+			</listitem>
481 481
 			<listitem>
482 482
 				<para>172.16.0.0/12</para>
483
-			<listitem>
483
+			</listitem>
484 484
 			<listitem>
485 485
 				<para>192.168.0.0/16</para>
486
-			<listitem>
486
+			</listitem>
487 487
 			<listitem>
488 488
 				<para>100.64.0.0/10 - RFC6598 - Carrier Grade NAT</para>
489
-			<listitem>
489
+			</listitem>
490 490
 			<listitem>
491 491
 				<para>192.0.0.0/29 - RFC7335 - IPv4 Service Continuity Prefix</para>
492
-			<listitem>
493
-		<itemizedlist>
492
+			</listitem>
493
+		</itemizedlist>
494 494
 		<para>Reserved net addresses are:</para>
495 495
 		<itemizedlist>
496 496
 			<listitem>
497 497
 				<para>192.0.0.0/24 - RFC7335 - IETF Protocol Assignments</para>
498
-			<listitem>
499
-		<itemizedlist>
498
+			</listitem>
499
+		</itemizedlist>
500 500
 		<para>
501 501
 		<emphasis>
502 502
 			Default value is <quote>1</quote>.
Browse code

nathelper: docs for nat_addr_mode parameter

Daniel-Constantin Mierla authored on 16/04/2020 07:54:48
Showing 1 changed files
... ...
@@ -466,6 +466,52 @@ modparam("nathelper", "filter_server_id", 1)
466 466
 		</example>
467 467
 	</section>
468 468
 
469
+	<section id="nathelper.p.nat_addr_mode">
470
+		<title><varname>nat_addr_mode</varname> (int)</title>
471
+		<para>
472
+			If set to 0, only default private net addresses are checked by
473
+			nat_uac_test(). If set to 1, other reserved net addresses are
474
+			checked by nat_uac_test() as well.
475
+		</para>
476
+		<para>Default private net addresses are:</para>
477
+		<itemizedlist>
478
+			<listitem>
479
+				<para>10.0.0.0/8</para>
480
+			<listitem>
481
+			<listitem>
482
+				<para>172.16.0.0/12</para>
483
+			<listitem>
484
+			<listitem>
485
+				<para>192.168.0.0/16</para>
486
+			<listitem>
487
+			<listitem>
488
+				<para>100.64.0.0/10 - RFC6598 - Carrier Grade NAT</para>
489
+			<listitem>
490
+			<listitem>
491
+				<para>192.0.0.0/29 - RFC7335 - IPv4 Service Continuity Prefix</para>
492
+			<listitem>
493
+		<itemizedlist>
494
+		<para>Reserved net addresses are:</para>
495
+		<itemizedlist>
496
+			<listitem>
497
+				<para>192.0.0.0/24 - RFC7335 - IETF Protocol Assignments</para>
498
+			<listitem>
499
+		<itemizedlist>
500
+		<para>
501
+		<emphasis>
502
+			Default value is <quote>1</quote>.
503
+		</emphasis>
504
+		</para>
505
+		<example>
506
+		<title>Set <varname>nat_addr_mode</varname> parameter</title>
507
+		<programlisting format="linespecific">
508
+...
509
+modparam("nathelper", "nat_addr_mode", 0)
510
+...
511
+</programlisting>
512
+		</example>
513
+	</section>
514
+
469 515
 	</section>
470 516
 
471 517
 
Browse code

nathelper: small spelling fix in docs

Henning Westerholt authored on 25/11/2019 19:45:46
Showing 1 changed files
... ...
@@ -829,7 +829,7 @@ if(is_rfc1918("$rd")) {
829 829
 		</title>
830 830
 		<para>
831 831
 		Reads <quote>;alias=ip~port~transport</quote> from Contact header then
832
-		writes to target avp as a sip uri.
832
+		writes to target pseudo-variable as a sip uri.
833 833
 		</para>
834 834
 		<para>
835 835
 		This function can be used from
Browse code

nathelper : set_alias_to_avp is renamed to set_alias_to_pv

set_alias_to_avp renamed to set_alias_to_pv

Yasin CANER authored on 21/11/2019 17:57:25 • Henning Westerholt committed on 25/11/2019 19:33:30
Showing 1 changed files
... ...
@@ -823,9 +823,9 @@ if(is_rfc1918("$rd")) {
823 823
 		</programlisting>
824 824
 		</example>
825 825
 	</section>
826
-		<section id="nathelper.set_alias_to_avp">
826
+		<section id="nathelper.set_alias_to_pv">
827 827
 		<title>
828
-		<function moreinfo="none">set_alias_to_avp(target_avp)</function>
828
+		<function moreinfo="none">set_alias_to_pv(target_avp)</function>
829 829
 		</title>
830 830
 		<para>
831 831
 		Reads <quote>;alias=ip~port~transport</quote> from Contact header then
... ...
@@ -836,10 +836,10 @@ if(is_rfc1918("$rd")) {
836 836
 		REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, and FAILURE_ROUTE.
837 837
 		</para>
838 838
 		<example>
839
-		<title><function>set_alias_to_avp</function> usage</title>
839
+		<title><function>set_alias_to_pv</function> usage</title>
840 840
 		<programlisting format="linespecific">
841 841
 ...
842
-		set_alias_to_avp("$avp(aliasuri)");
842
+		set_alias_to_pv("$avp(aliasuri)");
843 843
 ...
844 844
 		</programlisting>
845 845
 		</example>
Browse code

nathelper : added doc for set_alias_to_avp

added documents for set_alias_to_avp function

Yasin CANER authored on 12/11/2019 17:09:38 • Henning Westerholt committed on 25/11/2019 19:33:30
Showing 1 changed files
... ...
@@ -823,6 +823,27 @@ if(is_rfc1918("$rd")) {
823 823
 		</programlisting>
824 824
 		</example>
825 825
 	</section>
826
+		<section id="nathelper.set_alias_to_avp">
827
+		<title>
828
+		<function moreinfo="none">set_alias_to_avp(target_avp)</function>
829
+		</title>
830
+		<para>
831
+		Reads <quote>;alias=ip~port~transport</quote> from Contact header then
832
+		writes to target avp as a sip uri.
833
+		</para>
834
+		<para>
835
+		This function can be used from
836
+		REQUEST_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, and FAILURE_ROUTE.
837
+		</para>
838
+		<example>
839
+		<title><function>set_alias_to_avp</function> usage</title>
840
+		<programlisting format="linespecific">
841
+...
842
+		set_alias_to_avp("$avp(aliasuri)");
843
+...
844
+		</programlisting>
845
+		</example>
846
+	</section>
826 847
 
827 848
 	</section>
828 849
 
Browse code

nathelper: docs - added missing xml tags for the new nat test option

Daniel-Constantin Mierla authored on 03/09/2019 22:19:38
Showing 1 changed files
... ...
@@ -666,6 +666,7 @@ fix_nated_register();
666 666
 			URI port differs from the source port of the request (Warning: this is
667 667
 			might be legal or even intended combination in non NATted scenarios)
668 668
 			</para></listitem>
669
+			<listitem><para>
669 670
 			<emphasis>256</emphasis> -  Test if the SDP connection address is different
670 671
 			from source IP address. It will work also with multiple connection address
671 672
 			lines.
Browse code

nathelper: extend nat_uac_test() to test for mismatch between connection and source IP (GH #2045)

- extend nat_uac_test function to test for mismatch between connection and source IP
- add documentation for this new flag 256 to module docs as well
- based on pull request GH #2045 with smaller adaptions

Yasin Caner authored on 03/09/2019 21:14:16 • Henning Westerholt committed on 03/09/2019 21:14:16
Showing 1 changed files
... ...
@@ -666,6 +666,10 @@ fix_nated_register();
666 666
 			URI port differs from the source port of the request (Warning: this is
667 667
 			might be legal or even intended combination in non NATted scenarios)
668 668
 			</para></listitem>
669
+			<emphasis>256</emphasis> -  Test if the SDP connection address is different
670
+			from source IP address. It will work also with multiple connection address
671
+			lines.
672
+			</para></listitem>
669 673
 			</itemizedlist>
670 674
 		<para>
671 675
 		All flags can be bitwise combined, the test returns true if any of 
Browse code

nathelper: docs - note about the behavior of ping_nated_only=0 with sipping_flag set

Daniel-Constantin Mierla authored on 11/07/2018 16:39:19
Showing 1 changed files
... ...
@@ -172,11 +172,16 @@ modparam("nathelper", "natping_interval", 10)
172 172
 	<section id="nathelper.p.ping_nated_only">
173 173
 		<title><varname>ping_nated_only</varname> (integer)</title>
174 174
 		<para>
175
-		If this variable is set then only contacts that have 
176
-		<quote>behind_NAT</quote> flag in user location database set will 
175
+		If this parameter is set to 1 then only contacts that have
176
+		<quote>behind_NAT</quote> flag in user location database set will
177 177
 		get ping.
178 178
 		</para>
179 179
 		<para>
180
+		If it is 0 and sipping_flag is not set, then the 4-bytes UDP ping is
181
+		sent to all contacts. If it is 0 and sipping_flag parameter is set, then
182
+		SIP-request-based pinging is sent to all contacts.
183
+		</para>
184
+		<para>
180 185
 		<emphasis>
181 186
 			Default value is 0.
182 187
 		</emphasis>
Browse code

nathelper: small docs addition related to nat_uac_test()

Henning Westerholt authored on 21/03/2018 07:22:27
Showing 1 changed files
... ...
@@ -632,7 +632,8 @@ fix_nated_register();
632 632
 			<listitem><para>
633 633
 			<emphasis>2</emphasis> -  the "received" test is used: address
634 634
 			in the <quote>Via</quote> header is compared against source
635
-			IP address of signaling
635
+			IP address of signaling. If the <quote>Via</quote> header contains
636
+			no port, it uses the default SIP port 5060
636 637
 			</para></listitem>
637 638
 			<listitem><para>
638 639
 			<emphasis>4</emphasis> -  The Top Most <quote>Via</quote> is searched 
... ...
@@ -643,8 +644,9 @@ fix_nated_register();
643 644
 			RFC1918 or RFC6598 addresses
644 645
 			</para></listitem>
645 646
 			<listitem><para>
646
-			<emphasis>16</emphasis> -  Test if the source port is different
647
-			from the port in the <quote>Via</quote> header
647
+			<emphasis>16</emphasis> -  Test if the source port is different from the port
648
+			in the <quote>Via</quote> header. If the <quote>Via</quote> header contains
649
+			no port, it uses the default SIP port 5060
648 650
 			</para></listitem>
649 651
 			<listitem><para>
650 652
 			<emphasis>32</emphasis> -  Test if the source IP address of
Browse code

nathelper: docs - mention UDP for SIP nat pinging contact addresses

Daniel-Constantin Mierla authored on 13/03/2018 13:41:14
Showing 1 changed files
... ...
@@ -70,7 +70,7 @@
70 70
 		<listitem>
71 71
 			<para>
72 72
 			<emphasis>SIP request</emphasis> - a stateless SIP request is 
73
-			sent to the contact address.
73
+			sent to the UDP contact address.
74 74
 			</para>
75 75
 			<itemizedlist>
76 76
 				<listitem>
Browse code

nathelper: Fix typos in module documentation

Florian Floimair authored on 27/02/2018 17:00:33 • Daniel-Constantin Mierla committed on 28/02/2018 17:00:48
Showing 1 changed files
... ...
@@ -54,7 +54,7 @@
54 54
 			</para>
55 55
 			<itemizedlist>
56 56
 				<listitem>
57
-				<para><emphasis>Advantages:</emphasis> low bandwitdh traffic,
57
+				<para><emphasis>Advantages:</emphasis> low bandwidth traffic,
58 58
 				easy to generate by &kamailio;;
59 59
 				</para>
60 60
 				</listitem>
... ...
@@ -81,7 +81,7 @@
81 81
 				</para>
82 82
 				</listitem>
83 83
 				<listitem>
84
-				<para><emphasis>Disadvantages:</emphasis> higher bandwitdh 
84
+				<para><emphasis>Disadvantages:</emphasis> higher bandwidth 
85 85
 				traffic, more expensive (as time) to generate by &kamailio;;
86 86
 				</para>
87 87
 				</listitem>
... ...
@@ -374,7 +374,7 @@ modparam("nathelper", "nortpproxy_str", "a=sdpmangled:yes\r\n")
374 374
 	<section id="nathelper.p.keepalive_timeout">
375 375
 		<title><varname>keepalive_timeout</varname> (int)</title>
376 376
 		<para>
377
-		The parameter sets the interval in secods after which a natted
377
+		The parameter sets the interval in seconds after which a natted
378 378
 		contact is removed from location table if it does not reply to SIP
379 379
 		keepalives (usually OPTIONS ping requests).
380 380
 		</para>
... ...
@@ -491,8 +491,8 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
491 491
 		<function moreinfo="none">fix_nated_sdp(flags [, ip_address])</function>
492 492
 		</title>
493 493
 		<para>
494
-		Alters the SDP information in orer to facilitate NAT traversal. What
495
-		changes to be performed may be controled via the 
494
+		Alters the SDP information in order to facilitate NAT traversal. What
495
+		changes to be performed may be controlled via the 
496 496
 		<quote>flags</quote> parameter. Return value is -1 if error occurred,
497 497
 		1 if ip's were replaced, 2 if no ip's were replaced.
498 498
 		</para>
... ...
@@ -527,7 +527,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_contact();};
527 527
 			</itemizedlist>
528 528
 			</listitem>
529 529
 			<listitem><para>
530
-			<emphasis>ip_address</emphasis> - IP to be used for rewritting SDP.
530
+			<emphasis>ip_address</emphasis> - IP to be used for rewriting SDP.
531 531
 			If not specified, the received signalling IP will be used. The
532 532
 			parameter allows pseudo-variables usage. NOTE: For the IP to be
533 533
 			used, you need to use 0x02 or 0x08 flags, otherwise it will have
Browse code

nathelper: documented the use of add_rcv_param() for Contact URI case

Daniel-Constantin Mierla authored on 24/01/2018 10:58:45
Showing 1 changed files
... ...
@@ -554,11 +554,15 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_sdp("3");};
554 554
 		</title>
555 555
 		<para>
556 556
 		Add a received parameter to the <quote>Contact</quote> header fields
557
-		or the Contact URI. The parameter will contain the URI created from the
558
-		source IP, port, and protocol of the packet containing the SIP message.
559
-		The parameter can be then processed by another registrar. This is useful,
560
-		for example, when replicating register messages using <function>t_replicate</function>
561
-		function to another registrar.
557
+		(available for all transports) or to the Contact URI (available only
558
+		for UDP traffic).
559
+		</para>
560
+		<para>
561
+		The parameter will contain the URI created from the
562
+		source IP, port, and protocol (if different than UDP) of the packet
563
+		containing the SIP message. The parameter can be then processed by
564
+		another registrar. This is useful, for example, when replicating register
565
+		messages using <function>t_replicate</function> function to another registrar.
562 566
 		</para>
563 567
 		<para>Meaning of the parameters is as follows:</para>
564 568
 		<itemizedlist>
... ...
@@ -566,7 +570,7 @@ if (search("User-Agent: Cisco ATA.*") {fix_nated_sdp("3");};
566 570
 			<emphasis>flag</emphasis> - flags to indicate if the parameter
567 571
 			should be added to Contact URI or Contact header. If the flag is
568 572
 			non-zero, the parameter will be added to the Contact URI. If not
569
-			used or equal to zero, the parameter will go to the Contact 
573
+			used or equal to zero, the parameter will go to the Contact
570 574
 			header.
571 575
 			</para></listitem>
572 576
 		</itemizedlist>
Browse code

nathelper: allow port to be specified in force_socket, fixes #1298

Timmo Verlaan authored on 13/01/2018 09:43:06
Showing 1 changed files
... ...
@@ -128,8 +128,7 @@
128 128
 		<title><varname>force_socket</varname> (string)</title>
129 129
 		<para>
130 130
 		Socket to be used when sending NAT pings for UDP communication.
131
-		It uses the first socket it finds based on the IP address. If
132
-		no one specified, the OS will choose a socket.
131
+		If no one specified, the OS will choose a socket.
133 132
 		</para>
134 133
 		<para>
135 134
 		<emphasis>
... ...
@@ -140,7 +139,7 @@
140 139
 		<title>Set <varname>force_socket</varname> parameter</title>
141 140
 		<programlisting format="linespecific">
142 141
 ...
143
-modparam("nathelper", "force_socket", "127.0.0.1")
142
+modparam("nathelper", "force_socket", "127.0.0.1:5060")
144 143
 ...
145 144
 </programlisting>
146 145
 		</example>
Browse code

nathelper: fix force_socket documentation

Timmo Verlaan authored on 10/01/2018 15:30:04
Showing 1 changed files
... ...
@@ -128,7 +128,8 @@
128 128
 		<title><varname>force_socket</varname> (string)</title>
129 129
 		<para>
130 130
 		Socket to be used when sending NAT pings for UDP communication.
131
-		If no one specified, the OS will choose a socket.
131
+		It uses the first socket it finds based on the IP address. If
132
+		no one specified, the OS will choose a socket.
132 133
 		</para>
133 134
 		<para>
134 135
 		<emphasis>
... ...
@@ -139,7 +140,7 @@
139 140
 		<title>Set <varname>force_socket</varname> parameter</title>
140 141
 		<programlisting format="linespecific">
141 142
 ...
142
-modparam("nathelper", "force_socket", "localhost:33333")
143
+modparam("nathelper", "force_socket", "127.0.0.1")
143 144
 ...
144 145
 </programlisting>
145 146
 		</example>
Browse code

modules/nathelper: check also transport protocol when determining if ;alias parameter needs to be added by add_contact_alias() call

Juha Heinanen authored on 24/11/2017 08:18:33
Showing 1 changed files
... ...
@@ -707,8 +707,8 @@ if(is_rfc1918("$rd")) {
707 707
 		the contact URI containing either received ip, port, and
708 708
 		transport protocol or those given as parameters.  If called
709 709
 		without parameters, <quote>;alias</quote> parameter is
710
-		only added if received ip and port differ from those in
711
-		contact URI.
710
+		only added if received ip, port, or transport protocol differs
711
+        from that in contact URI.
712 712
 		</para>
713 713
 		<para>
714 714
 		This function can be used from
Browse code

nathelper: fix documentation typo

Mikko Lehto authored on 09/08/2017 13:47:11
Showing 1 changed files
... ...
@@ -592,7 +592,7 @@ add_rcv_param("1"); # add the parameter to the Contact URI
592 592
 		The function creates a URI consisting of the source IP, port, and 
593 593
 		protocol and stores the URI in an Attribute-Value-Pair. The URI will 
594 594
 		be appended as "received" parameter to Contact in 200 OK and 
595
-		registrar will store it in the received cloumn in the location table.
595
+		registrar will store it in the received column in the location table.
596 596
 		</para>
597 597
 		<para>
598 598
 		Note: You have to set the <quote>received_avp</quote> parameter of the
Browse code

modules/nathelper: add undocumented filter_server_id [skip ci]

Mikko Lehto authored on 11/04/2017 15:29:03
Showing 1 changed files
... ...
@@ -439,6 +439,28 @@ modparam("nathelper", "append_sdp_oldmediaip", 1)
439 439
 </programlisting>
440 440
 		</example>
441 441
 	</section>
442
+
443
+	<section id="nathelper.p.filter_server_id">
444
+		<title><varname>filter_server_id</varname> (int)</title>
445
+		<para>
446
+		Filter contacts by <quote>server_id</quote> core parameter.
447
+		Use this parameter to limit pinging. When set to <quote>1</quote>,
448
+		only proxy instances which send packets are those where core server_id
449
+		matches server_id saved in usrloc.
450
+		<emphasis>
451
+			Default value is <quote>0</quote> (disabled).
452
+		</emphasis>
453
+		</para>
454
+		<example>
455
+		<title>Set <varname>filter_server_id</varname> parameter</title>
456
+		<programlisting format="linespecific">
457
+...
458
+modparam("nathelper", "filter_server_id", 1)
459
+...
460
+</programlisting>
461
+		</example>
462
+	</section>
463
+
442 464
 	</section>
443 465
 
444 466
 
Browse code

nathelper: implemented rpc command nathelper.enable_ping

- removed mi command

Daniel-Constantin Mierla authored on 02/01/2017 21:23:11
Showing 1 changed files
... ...
@@ -11,21 +11,21 @@
11 11
 <!-- Module User's Guide -->
12 12
 
13 13
 <chapter>
14
-	
14
+
15 15
 	<title>&adminguide;</title>
16
-	
16
+
17 17
 	<section>
18 18
 	<title>Overview</title>
19 19
 	<para>
20 20
 		This is a module to help with &nat; traversal and reuse
21
-		of <acronym>TCP</acronym> connections. In particular, 
22
-		it helps symmetric &ua;s that don't advertise they are symmetric 
23
-		and are not able to determine their public address. 
21
+		of <acronym>TCP</acronym> connections. In particular,
22
+		it helps symmetric &ua;s that don't advertise they are symmetric
23
+		and are not able to determine their public address.
24 24
 	</para>
25 25
 	<para>
26 26
 		The function <function>fix_nated_contact()</function> rewrites the <quote>Contact</quote>
27 27
 		header field with request's source address:port pair. The function
28
-		<function>fix_nated_sdp()</function> adds the active direction indication 
28
+		<function>fix_nated_sdp()</function> adds the active direction indication
29 29
 		to &sdp; (flag 0x01) and updates the source &ip; address too (flag 0x02). The function
30 30
 		<function>fix_nated_register()</function> exports exports the request's source
31 31
 		address:port into an AVP to be used during <function>save()</function> and should
... ...
@@ -831,21 +831,21 @@ if(is_rfc1918("$rd")) {
831 831
 	</section>
832 832
 
833 833
 	<section>
834
-		<title><acronym>MI</acronym> Commands</title>
835
-		<section id="nathelper.m.nh_enable_ping">
836
-			<title><function moreinfo="none">nh_enable_ping</function></title>
834
+		<title>RPC Commands</title>
835
+		<section id="nathelper.r.enable_ping">
836
+			<title><function moreinfo="none">nathelper.enable_ping</function></title>
837 837
 			<para>
838
-			Enables natping if parameter value greater than 0.
838
+			Enables natping if parameter value different than 0.
839 839
 			Disables natping if parameter value is 0.
840 840
 			</para>
841 841
 			<para>
842 842
 			The function takes only one parameter - a number in decimal format.
843 843
 			</para>
844 844
 			<example>
845
-			<title><function moreinfo="none">nh_enable_ping</function> usage</title>
845
+			<title><function moreinfo="none">nathelper.enable_ping</function> usage</title>
846 846
 			<programlisting format="linespecific">
847 847
 ...
848
-$ &ctltool; fifo nh_enable_ping 1
848
+$ &kamcmd; nathelper.enable_ping 1
849 849
 ...
850 850
 			</programlisting>
851 851
 			</example>
Browse code

doc, modules: updated the path to docbook entities and spec files

Daniel-Constantin Mierla authored on 07/12/2016 14:24:32
Showing 1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 4
 
5 5
 <!-- Include general documentation entities -->
6
-<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
6
+<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
7 7
 %docentities;
8 8
 
9 9
 ]>
Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,879 @@
1
+<?xml version="1.0" encoding='ISO-8859-1'?>
2
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4
+
5
+<!-- Include general documentation entities -->
6
+<!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
7
+%docentities;
8
+
9
+]>
10
+
11
+<!-- Module User's Guide -->
12
+
13
+<chapter>
14
+	
15
+	<title>&adminguide;</title>
16
+	
17
+	<section>
18
+	<title>Overview</title>
19
+	<para>
20
+		This is a module to help with &nat; traversal and reuse
21
+		of <acronym>TCP</acronym> connections. In particular, 
22
+		it helps symmetric &ua;s that don't advertise they are symmetric 
23
+		and are not able to determine their public address. 
24
+	</para>
25
+	<para>
26
+		The function <function>fix_nated_contact()</function> rewrites the <quote>Contact</quote>
27
+		header field with request's source address:port pair. The function
28
+		<function>fix_nated_sdp()</function> adds the active direction indication 
29
+		to &sdp; (flag 0x01) and updates the source &ip; address too (flag 0x02). The function
30
+		<function>fix_nated_register()</function> exports exports the request's source
31
+		address:port into an AVP to be used during <function>save()</function> and should
32
+		be used for <quote>REGISTER</quote> requests.
33
+	</para>
34
+        <para>
35
+		Note: <function>fix_nated_contact</function> changes the <quote>Contact</quote>
36
+		header, thus it breaks the RFC. Although usually this is not an issue, it may
37
+		cause problems with strict SIP clients.  An alternative is to use
38
+		<function>add_contact_alias()</function> that together with
39
+		the <function>handle_ruri_alias()</function> is standards conforming and also
40
+		supports reuse of TCP/TLS connections.
41
+	</para>
42
+	</section>
43
+
44
+	<section>
45
+	<title>NAT pinging types</title>
46
+	<para>
47
+		Currently, the nathelper module supports two types of NAT pings:
48
+	</para>
49
+	<itemizedlist>
50
+		<listitem>
51
+			<para>
52
+			<emphasis>UDP packet</emphasis> - 4 bytes (zero filled) UDP 
53
+			packets are sent to the contact address.
54
+			</para>
55
+			<itemizedlist>
56
+				<listitem>
57
+				<para><emphasis>Advantages:</emphasis> low bandwitdh traffic,
58
+				easy to generate by &kamailio;;
59
+				</para>
60
+				</listitem>
61
+				<listitem>
62
+				<para><emphasis>Disadvantages:</emphasis> unidirectional 
63
+				traffic through NAT (inbound - from outside to inside); As 
64
+				many NATs do update the bind timeout only on outbound traffic,
65
+				the bind may expire and closed.
66
+				</para>
67
+				</listitem>
68
+			</itemizedlist>
69
+		</listitem>
70
+		<listitem>
71
+			<para>
72
+			<emphasis>SIP request</emphasis> - a stateless SIP request is 
73
+			sent to the contact address.
74
+			</para>
75
+			<itemizedlist>
76
+				<listitem>
77
+				<para><emphasis>Advantages:</emphasis> bidirectional traffic
78
+				through NAT, since each PING request from &kamailio; (inbound 
79
+				traffic) will force the SIP client to generate a SIP reply 
80
+				(outbound traffic) - the NAT bind will be surely kept open.
81
+				</para>
82
+				</listitem>
83
+				<listitem>
84
+				<para><emphasis>Disadvantages:</emphasis> higher bandwitdh 
85
+				traffic, more expensive (as time) to generate by &kamailio;;
86
+				</para>
87
+				</listitem>
88
+			</itemizedlist>
89
+		</listitem>
90
+	</itemizedlist>
91
+	</section>
92
+
93
+	<section>
94
+	<title>Dependencies</title>
95
+	<section>
96
+		<title>&kamailio; Modules</title>
97
+		<para>
98
+		The following modules must be loaded before this module:
99
+			<itemizedlist>
100
+			<listitem>
101
+			<para>
102
+				<emphasis>usrloc</emphasis> module - only if the NATed 
103
+				contacts are to be pinged.
104
+			</para>
105
+			</listitem>
106
+			</itemizedlist>
107
+		</para>
108
+	</section>
109
+	<section>
110
+		<title>External Libraries or Applications</title>
111
+		<para>
112
+		The following libraries or applications must be installed before 
113
+		running &kamailio; with this module loaded:
114
+			<itemizedlist>
115
+			<listitem>
116
+			<para>
117
+				<emphasis>None</emphasis>.
118
+			</para>
119
+			</listitem>
120
+			</itemizedlist>
121
+		</para>
122
+	</section>
123
+	</section>
124
+
125
+	<section>
126
+	<title>Parameters</title>
127
+	<section id="nathelper.p.force_socket">
128
+		<title><varname>force_socket</varname> (string)</title>
129
+		<para>
130
+		Socket to be used when sending NAT pings for UDP communication.
131
+		If no one specified, the OS will choose a socket.
132
+		</para>
133
+		<para>
134
+		<emphasis>
135
+			Default value is <quote>NULL</quote>.
136
+		</emphasis>
137
+		</para>
138
+		<example>
139
+		<title>Set <varname>force_socket</varname> parameter</title>
140
+		<programlisting format="linespecific">
141
+...
142
+modparam("nathelper", "force_socket", "localhost:33333")
143
+...
144
+</programlisting>
145
+		</example>
146
+	</section>
147
+	<section id="nathelper.p.natping_interval">
148
+		<title><varname>natping_interval</varname> (integer)</title>
149
+		<para>
150
+		Period of time in seconds between sending the NAT pings to all 
151
+		currently registered &ua;s to keep their &nat; bindings alive. 
152
+		Value of 0 disables this functionality.
153
+		</para>
154
+		<note><para>
155
+		Enabling the NAT pinging functionality will force the module to
156
+		bind itself to USRLOC module.
157
+		</para></note>
158
+		<para>
159
+		<emphasis>
160
+			Default value is 0.
161
+		</emphasis>
162
+		</para>
163
+		<example>
164
+		<title>Set <varname>natping_interval</varname> parameter</title>
165
+		<programlisting format="linespecific">
166
+...
167
+modparam("nathelper", "natping_interval", 10)
168
+...
169
+</programlisting>
170
+		</example>
171
+	</section>
172
+	<section id="nathelper.p.ping_nated_only">
173
+		<title><varname>ping_nated_only</varname> (integer)</title>
174
+		<para>
175
+		If this variable is set then only contacts that have 
176
+		<quote>behind_NAT</quote> flag in user location database set will 
177
+		get ping.
178
+		</para>
179
+		<para>
180
+		<emphasis>
181
+			Default value is 0.
182
+		</emphasis>
183
+		</para>
184
+		<example>
185
+		<title>Set <varname>ping_nated_only</varname> parameter</title>
186
+		<programlisting format="linespecific">
187
+...
188
+modparam("nathelper", "ping_nated_only", 1)
189
+...
190
+</programlisting>
191
+		</example>
192
+	</section>
193
+	<section id="nathelper.p.natping_processes">
194
+		<title><varname>natping_processes</varname> (integer)</title>
195
+		<para>
196
+		How many timer processes should be created by the module for the
197
+		exclusive task of sending the NAT pings.
198
+		</para>
199
+		<para>
200
+		<emphasis>
201
+			Default value is 1.
202
+		</emphasis>
203
+		</para>
204
+		<example>
205
+		<title>Set <varname>natping_processes</varname> parameter</title>
206
+		<programlisting format="linespecific">
207
+...
208
+modparam("nathelper", "natping_processes", 3)
209
+...
210
+</programlisting>
211
+		</example>
212
+	</section>
213
+	<section id="nathelper.p.natping_socket">
214
+		<title><varname>natping_socket</varname> (string)</title>
215
+		<para>
216
+		Spoof the natping's source-ip to this address. Works only for IPv4.
217
+		</para>
218
+		<para>
219
+		<emphasis>
220
+			Default value is NULL.
221
+		</emphasis>
222