Browse code

Merge pull request #3 from kamailio/master

merge-03.05.2021

korayvt authored on 03/05/2021 12:46:56 • GitHub committed on 03/05/2021 12:46:56
Showing 222 changed files
... ...
@@ -50,3 +50,6 @@ libiname.lst
50 50
 *.7
51 51
 # vscode tmp files
52 52
 .vscode
53
+# compiling tools files
54
+.clangd
55
+compile_commands.json
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -26,7 +26,7 @@ EXCLUDED_MODULES= java
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
28 28
 # they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid lwcs
30 30
 
31 31
 # module groups that are packaged in seperate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -46,6 +46,7 @@ Build-Depends:
46 46
  libssl-dev,
47 47
  libsystemd-dev,
48 48
  libunistring-dev,
49
+ libwebsockets-dev,
49 50
  libxml2-dev,
50 51
  openssl,
51 52
  pkg-config,
... ...
@@ -840,6 +841,23 @@ Description: contains the secsipid module
840 841
  .
841 842
  This package contains the secsipid Module.
842 843
 
844
+Package: kamailio-lwsc-modules
845
+Architecture: linux-any
846
+Multi-Arch: same
847
+Pre-Depends:
848
+ ${misc:Pre-Depends},
849
+Depends:
850
+ kamailio (= ${binary:Version}),
851
+ ${misc:Depends},
852
+ ${shlibs:Depends},
853
+Description: Libwebsockets module for the Kamailio SIP server
854
+ Kamailio is a very fast and flexible SIP (RFC3261)
855
+ server. Written entirely in C, Kamailio can handle thousands calls
856
+ per second even on low-budget hardware.
857
+ .
858
+ This package contains the lwcs module, which provides a client-side WebSockets
859
+ API through libwebsockets.
860
+
843 861
 Package: kamailio-extra-modules
844 862
 Architecture: linux-any
845 863
 Multi-Arch: same
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwcs
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -26,7 +26,7 @@ EXCLUDED_MODULES= java
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
28 28
 # they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid lwcs
30 30
 
31 31
 # module groups that are packaged in seperate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -31,6 +31,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
31 31
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
32 32
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
33 33
 
34
+# libwebsockets >= 3.1
35
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
36
+	${DIST}/control
37
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
38
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
39
+
34 40
 wrap-and-sort -sat -d ${DIST}
35 41
 
36 42
 # clean backports scripts
... ...
@@ -31,6 +31,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
31 31
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
32 32
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
33 33
 
34
+# libwebsockets >= 3.1
35
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
36
+	${DIST}/control
37
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
38
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
39
+
34 40
 wrap-and-sort -sat -d ${DIST}
35 41
 
36 42
 # clean backports scripts
... ...
@@ -48,6 +48,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
48 48
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
49 49
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
50 50
 
51
+# libwebsockets >= 3.1
52
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
53
+	${DIST}/control
54
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
55
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
56
+
51 57
 wrap-and-sort -sat -d ${DIST}
52 58
 
53 59
 # clean backports scripts
... ...
@@ -91,7 +91,7 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ ruby/' ${DIST}/rules
91 91
 # no python3 for app_python3
92 92
 sed -i -e '/python3-dev/d' -e '/^Package: kamailio-python3-modules/,/^$/d' \
93 93
 	${DIST}/control
94
-# this removes python3 from Package: kamalio
94
+# this removes python3 from Package: kamailio
95 95
 sed -i -e '/python3/d' ${DIST}/control
96 96
 # add that again
97 97
 sed -i '/lsb-base,/a \ python3,' ${DIST}/control
... ...
@@ -111,6 +111,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
111 111
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
112 112
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
113 113
 
114
+# libwebsockets >= 3.1
115
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
116
+	${DIST}/control
117
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
118
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
119
+
114 120
 wrap-and-sort -sat -d ${DIST}
115 121
 
116 122
 # clean backports scripts
... ...
@@ -28,6 +28,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
28 28
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
29 29
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
30 30
 
31
+# libwebsockets >= 3.1
32
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
33
+	${DIST}/control
34
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
35
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
36
+
31 37
 wrap-and-sort -sat -d ${DIST}
32 38
 
33 39
 # clean backports scripts
... ...
@@ -74,6 +74,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
74 74
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
75 75
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
76 76
 
77
+# libwebsockets >= 3.1
78
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
79
+	${DIST}/control
80
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
81
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
82
+
77 83
 wrap-and-sort -sat -d ${DIST}
78 84
 
79 85
 # clean backports scripts
... ...
@@ -91,7 +91,7 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ ruby/' ${DIST}/rules
91 91
 # no python3 for app_python3
92 92
 sed -i -e '/python3-dev/d' -e '/^Package: kamailio-python3-modules/,/^$/d' \
93 93
 	${DIST}/control
94
-# this removes python3 from Package: kamalio
94
+# this removes python3 from Package: kamailio
95 95
 sed -i -e '/python3/d' ${DIST}/control
96 96
 # add that again
97 97
 sed -i '/lsb-base,/a \ python3,' ${DIST}/control
... ...
@@ -111,6 +111,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
111 111
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
112 112
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
113 113
 
114
+# libwebsockets >= 3.1
115
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
116
+	${DIST}/control
117
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
118
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
119
+
114 120
 wrap-and-sort -sat -d ${DIST}
115 121
 
116 122
 # clean backports scripts
... ...
@@ -31,6 +31,12 @@ sed -i -e '/libsecsipid-dev/d' -e '/^Package: kamailio-secsipid-modules/,/^$/d'
31 31
 sed -i -e 's/ secsipid[ ,$]*/ /' ${DIST}/rules
32 32
 sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ secsipid/' ${DIST}/rules
33 33
 
34
+# libwebsockets >= 3.1
35
+sed -i -e '/libwebsockets-dev/d' -e '/^Package: kamailio-lwsc-modules/,/^$/d' \
36
+	${DIST}/control
37
+sed -i -e 's/ lwcs[ ,$]*/ /' ${DIST}/rules
38
+sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ lwcs/' ${DIST}/rules
39
+
34 40
 wrap-and-sort -sat -d ${DIST}
35 41
 
36 42
 # clean backports scripts
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -49,6 +49,7 @@ Build-Depends:
49 49
  libsystemd-dev,
50 50
  libunistring-dev,
51 51
  libval-dev,
52
+ libwebsockets-dev,
52 53
  libxml2-dev,
53 54
  libxmlrpc-c3-dev,
54 55
  openssl,
... ...
@@ -878,6 +879,23 @@ Description: contains the secsipid module
878 879
  .
879 880
  This package contains the secsipid Module.
880 881
 
882
+Package: kamailio-lwsc-modules
883
+Architecture: linux-any
884
+Multi-Arch: same
885
+Pre-Depends:
886
+ ${misc:Pre-Depends},
887
+Depends:
888
+ kamailio (= ${binary:Version}),
889
+ ${misc:Depends},
890
+ ${shlibs:Depends},
891
+Description: Libwebsockets module for the Kamailio SIP server
892
+ Kamailio is a very fast and flexible SIP (RFC3261)
893
+ server. Written entirely in C, Kamailio can handle thousands calls
894
+ per second even on low-budget hardware.
895
+ .
896
+ This package contains the lwcs module, which provides a client-side WebSockets
897
+ API through libwebsockets.
898
+
881 899
 Package: kamailio-extra-modules
882 900
 Architecture: linux-any
883 901
 Multi-Arch: same
... ...
@@ -38,7 +38,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
38 38
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
39 39
 			   sqlite json mono ruby ims sctp java \
40 40
 			   tls outbound websocket autheph dnssec kazoo cnxcc \
41
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid
41
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwcs
42 42
 
43 43
 # module groups to be packaged onto kamailio-extra-modules
44 44
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -46,6 +46,7 @@ Build-Depends:
46 46
  libssl-dev,
47 47
  libsystemd-dev,
48 48
  libunistring-dev,
49
+ libwebsockets-dev,
49 50
  libxml2-dev,
50 51
  openssl,
51 52
  pkg-config,
... ...
@@ -824,6 +825,23 @@ Description: MQTT modules for the Kamailio SIP Server
824 825
  Messages can be published from any point in the routing script. Also
825 826
  the subscriptions can be fully controlled by scripting commands.
826 827
 
828
+Package: kamailio-lwsc-modules
829
+Architecture: linux-any
830
+Multi-Arch: same
831
+Pre-Depends:
832
+ ${misc:Pre-Depends},
833
+Depends:
834
+ kamailio (= ${binary:Version}),
835
+ ${misc:Depends},
836
+ ${shlibs:Depends},
837
+Description: Libwebsockets module for the Kamailio SIP server
838
+ Kamailio is a very fast and flexible SIP (RFC3261)
839
+ server. Written entirely in C, Kamailio can handle thousands calls
840
+ per second even on low-budget hardware.
841
+ .
842
+ This package contains the lwcs module, which provides a client-side WebSockets
843
+ API through libwebsockets.
844
+
827 845
 Package: kamailio-extra-modules
828 846
 Architecture: linux-any
829 847
 Multi-Arch: same
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt 
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt lwcs
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -27,7 +27,7 @@ EXCLUDED_MODULES=
27 27
 # extra modules to skip, because they are not compilable now
28 28
 # - regardless if they go to the main kamailio package or to some module package,
29 29
 # they will be excluded from compile and install of all
30
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc geoip2 phonenum mongodb secsipid
30
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc geoip2 phonenum mongodb secsipid lwcs
31 31
 
32 32
 # module groups that are packaged in seperate packages
33 33
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -26,7 +26,7 @@ EXCLUDED_MODULES=
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
28 28
 # they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec kazoo cnxcc systemd rabbitmq geoip2 phonenum mongodb ruby python3 mqtt secsipid
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec kazoo cnxcc systemd rabbitmq geoip2 phonenum mongodb ruby python3 mqtt secsipid lwcs
30 30
 
31 31
 # module groups that are packaged in seperate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -47,6 +47,7 @@ Build-Depends:
47 47
  libssl-dev,
48 48
  libsystemd-dev,
49 49
  libunistring-dev,
50
+ libwebsockets-dev,
50 51
  libxml2-dev,
51 52
  openssl,
52 53
  pkg-config,
... ...
@@ -841,6 +842,23 @@ Description: contains the secsipid module
841 842
  .
842 843
  This package contains the secsipid Module.
843 844
 
845
+Package: kamailio-lwsc-modules
846
+Architecture: linux-any
847
+Multi-Arch: same
848
+Pre-Depends:
849
+ ${misc:Pre-Depends},
850
+Depends:
851
+ kamailio (= ${binary:Version}),
852
+ ${misc:Depends},
853
+ ${shlibs:Depends},
854
+Description: Libwebsockets module for the Kamailio SIP server
855
+ Kamailio is a very fast and flexible SIP (RFC3261)
856
+ server. Written entirely in C, Kamailio can handle thousands calls
857
+ per second even on low-budget hardware.
858
+ .
859
+ This package contains the lwcs module, which provides a client-side WebSockets
860
+ API through libwebsockets.
861
+
844 862
 Package: kamailio-extra-modules
845 863
 Architecture: linux-any
846 864
 Multi-Arch: same
... ...
@@ -37,7 +37,7 @@ PACKAGE_GROUPS=mysql postgres berkeley unixodbc radius presence \
37 37
 			   snmpstats carrierroute xmpp cpl redis python geoip geoip2 \
38 38
 			   sqlite json mono ruby ims sctp \
39 39
 			   tls outbound websocket autheph kazoo cnxcc \
40
-			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid
40
+			   erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwcs
41 41
 
42 42
 # module groups to be packaged onto kamailio-extra-modules
43 43
 EXTRA_GROUPS=gzcompress uuid ev jansson http_async
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -27,7 +27,7 @@ EXCLUDED_MODULES=
27 27
 # extra modules to skip, because they are not compilable now
28 28
 # - regardless if they go to the main kamailio package or to some module package,
29 29
 # they will be excluded from compile and install of all
30
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid
30
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec secsipid lwcs
31 31
 
32 32
 # module groups that are packaged in seperate packages
33 33
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -27,7 +27,7 @@ EXCLUDED_MODULES=
27 27
 # extra modules to skip, because they are not compilable now
28 28
 # - regardless if they go to the main kamailio package or to some module package,
29 29
 # they will be excluded from compile and install of all
30
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc systemd geoip2 phonenum mongodb ruby mqtt secsipid
30
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc systemd geoip2 phonenum mongodb ruby mqtt secsipid lwcs
31 31
 
32 32
 # module groups that are packaged in seperate packages
33 33
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -26,7 +26,7 @@ EXCLUDED_MODULES=
26 26
 # extra modules to skip, because they are not compilable now
27 27
 # - regardless if they go to the main kamailio package or to some module package,
28 28
 # they will be excluded from compile and install of all
29
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec kazoo cnxcc systemd rabbitmq geoip2 phonenum mongodb ruby python3 mqtt secsipid
29
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy mi_xmlrpc dnssec kazoo cnxcc systemd rabbitmq geoip2 phonenum mongodb ruby python3 mqtt secsipid lwcs
30 30
 
31 31
 # module groups that are packaged in seperate packages
32 32
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -1,35 +1,5 @@
1
-kamailio (5.5.0~dev5) unstable; urgency=medium
1
+kamailio (5.6.0~dev0) unstable; urgency=medium
2 2
 
3
-  * version set 5.5.0~dev5
3
+  * version set 5.6.0-dev0
4 4
 
5
- -- Victor Seva <vseva@debian.org>  Wed, 24 Mar 2021 12:08:26 +0100
6
-
7
-kamailio (5.5.0~dev4) unstable; urgency=medium
8
-
9
-  * version set 5.5.0~dev4
10
-
11
- -- Victor Seva <vseva@debian.org>  Thu, 11 Feb 2021 13:28:36 +0100
12
-
13
-kamailio (5.5.0~dev3) unstable; urgency=medium
14
-
15
-  * version set 5.5.0~dev3
16
-
17
- -- Victor Seva <vseva@debian.org>  Mon, 19 Oct 2020 11:13:02 +0200
18
-
19
-kamailio (5.5.0~dev2) unstable; urgency=medium
20
-
21
-  * version set 5.5.0~dev2 
22
-
23
- -- Victor Seva <vseva@debian.org>  Tue, 01 Sep 2020 09:13:19 +0200
24
-
25
-kamailio (5.5.0~dev1) unstable; urgency=medium
26
-
27
-  * version set 5.5.0~dev1 
28
-
29
- -- Victor Seva <vseva@debian.org>  Fri, 17 Jul 2020 10:42:10 +0200
30
-
31
-kamailio (5.5.0~dev0) unstable; urgency=medium
32
-
33
-  * version set 5.5.0~dev0
34
-
35
- -- Victor Seva <vseva@debian.org>  Fri, 10 Jul 2020 13:47:04 +0200
5
+ -- Victor Seva <vseva@debian.org>  Fri, 23 Apr 2021 11:27:18 +0200
... ...
@@ -27,7 +27,7 @@ EXCLUDED_MODULES=
27 27
 # extra modules to skip, because they are not compilable now
28 28
 # - regardless if they go to the main kamailio package or to some module package,
29 29
 # they will be excluded from compile and install of all
30
-EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy secsipid
30
+EXTRA_EXCLUDED_MODULES=bdb dbtext oracle pa iptrtpproxy secsipid lwcs
31 31
 
32 32
 # module groups that are packaged in seperate packages
33 33
 # (with the name kamailio-$(group_name)-modules)
... ...
@@ -661,6 +661,16 @@ Lua extensions for Kamailio.
661 661
 %endif
662 662
 
663 663
 
664
+%package    lwsc
665
+Summary:    Websocket client implementation to interact with external systems, similar to http client
666
+Group:      %{PKGGROUP}
667
+Requires:   libwebsockets, kamailio = %ver
668
+BuildRequires:  libwebsockets-devel
669
+
670
+%description    lwsc
671
+Websocket client implementation to interact with external systems, similar to http client.
672
+
673
+
664 674
 %if %{with memcached}
665 675
 %package    memcached
666 676
 Summary:    Memcached configuration file support for Kamailio
... ...
@@ -1178,6 +1188,7 @@ make every-module skip_modules="app_mono db_cassandra db_oracle iptrtpproxy \
1178 1188
 %if %{with lua}
1179 1189
     klua \
1180 1190
 %endif
1191
+    klwsc \
1181 1192
 %if %{with memcached}
1182 1193
     kmemcached \
1183 1194
 %endif
... ...
@@ -1270,6 +1281,7 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
1270 1281
 %if %{with lua}
1271 1282
     klua \
1272 1283
 %endif
1284
+    klwsc \
1273 1285
 %if %{with memcached}
1274 1286
     kmemcached \
1275 1287
 %endif
... ...
@@ -1932,6 +1944,11 @@ fi
1932 1944
 %endif
1933 1945
 
1934 1946
 
1947
+%files      lwsc
1948
+%defattr(-,root,root)
1949
+%doc %{_docdir}/kamailio/modules/README.lwsc
1950
+%{_libdir}/kamailio/modules/lwsc.so
1951
+
1935 1952
 %if %{with memcached}
1936 1953
 %files      memcached
1937 1954
 %defattr(-,root,root)
... ...
@@ -105,9 +105,9 @@ INSTALL_FLAVOUR=$(FLAVOUR)
105 105
 
106 106
 # version number
107 107
 VERSION = 5
108
-PATCHLEVEL = 5
108
+PATCHLEVEL = 6
109 109
 SUBLEVEL =  0
110
-EXTRAVERSION = -dev5
110
+EXTRAVERSION = -dev0
111 111
 
112 112
 # memory manager switcher
113 113
 # 0 - f_malloc (fast malloc)
... ...
@@ -1593,7 +1593,7 @@ static char* addchar(struct str_buf* dst, char c)
1593 1593
 
1594 1594
 static char* addstr(struct str_buf* dst_b, char* src, int len)
1595 1595
 {
1596
-	char *tmp;
1596
+	char *tmp = NULL;
1597 1597
 	unsigned size;
1598 1598
 	unsigned used;
1599 1599
 
... ...
@@ -1612,6 +1612,10 @@ static char* addstr(struct str_buf* dst_b, char* src, int len)
1612 1612
 		dst_b->crt=dst_b->s+used;
1613 1613
 		dst_b->left=size-used;
1614 1614
 	}
1615
+	if(dst_b->crt==NULL) {
1616
+		LM_CRIT("unexpected null dst buffer\n");
1617
+		ksr_exit(-1);
1618
+	}
1615 1619
 	memcpy(dst_b->crt, src, len);
1616 1620
 	dst_b->crt+=len;
1617 1621
 	*(dst_b->crt)=0;
... ...
@@ -1798,13 +1802,14 @@ static int sr_push_yy_state(char *fin, int mode)
1798 1802
 		fp = fopen(newf, "r" );
1799 1803
 		if ( fp==NULL )
1800 1804
 		{
1801
-			pkg_free(newf);
1802 1805
 			if(mode==0)
1803 1806
 			{
1804 1807
 				LM_CRIT("cannot open included file: %s (%s)\n", fbuf, newf);
1808
+				pkg_free(newf);
1805 1809
 				return -1;
1806 1810
 			} else {
1807 1811
 				LM_DBG("importing file ignored: %s (%s)\n", fbuf, newf);
1812
+				pkg_free(newf);
1808 1813
 				return 0;
1809 1814
 			}
1810 1815
 		}
... ...
@@ -1923,11 +1928,16 @@ ksr_ppdefine_t* pp_get_define(int idx)
1923 1928
 	return &pp_defines[idx];
1924 1929
 }
1925 1930
 
1926
-static int pp_lookup(int len, const char * text)
1931
+static int pp_lookup(int len, const char *text)
1927 1932
 {
1928 1933
 	str var = {(char *)text, len};
1929 1934
 	int i;
1930 1935
 
1936
+	if(len<=0 || text==NULL) {
1937
+		LM_ERR("invalid parameters");
1938
+		return -1;
1939
+	}
1940
+
1931 1941
 	for (i=0; i<pp_num_defines; i++)
1932 1942
 		if (STR_EQ(pp_defines[i].name, var))
1933 1943
 			return i;
... ...
@@ -1941,10 +1951,15 @@ int pp_define_set_type(int type)
1941 1951
 	return 0;
1942 1952
 }
1943 1953
 
1944
-int pp_define(int len, const char * text)
1954
+int pp_define(int len, const char *text)
1945 1955
 {
1946 1956
 	int ppos;
1947 1957
 
1958
+	if(len<=0 || text==NULL) {
1959
+		LM_ERR("invalid parameters");
1960
+		return -1;
1961
+	}
1962
+
1948 1963
 	LM_DBG("defining id: %.*s\n", len, text);
1949 1964
 
1950 1965
 	if (pp_num_defines == MAX_DEFINES) {
... ...
@@ -2006,7 +2021,7 @@ int pp_define_set(int len, char *text)
2006 2021
 		LM_BUG("BUG: the index in define table not set yet\n");
2007 2022
 		return -1;
2008 2023
 	}
2009
-	if(len<=0) {
2024
+	if(len<=0 || text==NULL) {
2010 2025
 		LM_DBG("no define value - ignoring\n");
2011 2026
 		return 0;
2012 2027
 	}
... ...
@@ -2042,7 +2057,7 @@ int pp_define_set(int len, char *text)
2042 2057
 	return 0;
2043 2058
 }
2044 2059
 
2045
-int pp_define_env(const char * text, int len)
2060
+int pp_define_env(const char *text, int len)
2046 2061
 {
2047 2062
 	char *r;
2048 2063
 	str defname;
... ...
@@ -2083,7 +2098,7 @@ int pp_define_env(const char * text, int len)
2083 2098
 	return 0;
2084 2099
 }
2085 2100
 
2086
-str *pp_define_get(int len, const char * text)
2101
+str *pp_define_get(int len, const char *text)
2087 2102
 {
2088 2103
 	str var = {(char *)text, len};
2089 2104
 	int i;
... ...
@@ -2125,7 +2140,7 @@ static int pp_ifdef_type(int type)
2125 2140
  * ifndef defined   -> 0
2126 2141
  * ifndef undefined -> 1
2127 2142
  */
2128
-static void pp_ifdef_var(int len, const char * text)
2143
+static void pp_ifdef_var(int len, const char *text)
2129 2144
 {
2130 2145
 	pp_ifdef_stack[pp_sptr] ^= (pp_lookup(len, text) < 0);
2131 2146
 }
... ...
@@ -284,7 +284,11 @@ static int cfg_update_defaults(cfg_group_meta_t	*meta,
284 284
 				meta->array = array;
285 285
 				clone_done = 1;
286 286
 			}
287
-			memcpy(ginst->vars + var->offset, new_val, cfg_var_size(var));
287
+			if(ginst->vars + var->offset) {
288
+				memcpy(ginst->vars + var->offset, new_val, cfg_var_size(var));
289
+			} else {
290
+				LM_ERR("invalid variable offset\n");
291
+			}
288 292
 		}
289 293
 	}
290 294
 	return 0;
... ...
@@ -1122,6 +1126,10 @@ int cfg_commit(cfg_ctx_t *ctx)
1122 1126
 			}
1123 1127
 			p = group_inst->vars + changed->var->offset;
1124 1128
 		}
1129
+		if(p==NULL) {
1130
+			LM_ERR("failed to resolve valid variable offset\n");
1131
+			goto error;
1132
+		}
1125 1133
 
1126 1134
 		if (((changed->group_id_set && !changed->del_value
1127 1135
 						&& CFG_VAR_TEST_AND_SET(group_inst, changed->var))
... ...
@@ -96,6 +96,7 @@
96 96
 #define MY_BRANCH ";branch="
97 97
 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
98 98
 
99
+#define MAX_PORT_VAL 65535
99 100
 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
100 101
 
101 102
 #define CRLF "\r\n"
... ...
@@ -3011,25 +3011,30 @@ inline static int dns_srv_resolve_ip(struct dns_srv_handle* h,
3011 3011
 {
3012 3012
 	int ret;
3013 3013
 	str host;
3014
+	unsigned short vport;
3014 3015
 
3015 3016
 	host.len=0;
3016 3017
 	host.s=0;
3018
+	if(port) vport =*port;
3019
+	else vport = 0;
3020
+
3017 3021
 	do{
3018 3022
 		if (h->a==0){
3019 3023
 #ifdef DNS_SRV_LB
3020 3024
 			if ((ret=dns_srv_resolve_nxt(&h->srv,
3021 3025
 								(flags & DNS_SRV_RR_LB)?&h->srv_tried_rrs:0,
3022 3026
 								&h->srv_no,
3023
-								name, &host, port))<0)
3027
+								name, &host, &vport))<0)
3024 3028
 				goto error;
3025 3029
 #else
3026 3030
 			if ((ret=dns_srv_resolve_nxt(&h->srv, &h->srv_no,
3027
-								name, &host, port))<0)
3031
+								name, &host, &vport))<0)
3028 3032
 				goto error;
3029 3033
 #endif
3030
-			h->port=*port; /* store new port */
3034
+			h->port=vport; /* store new port */
3035
+			if(port) *port=vport;
3031 3036
 		}else{
3032
-			*port=h->port; /* return the stored port */
3037
+			if(port) *port=h->port; /* return the stored port */
3033 3038
 		}
3034 3039
 		if ((ret=dns_ip_resolve(&h->a, &h->ip_no, &host, ip, flags))<0){
3035 3040
 			/* couldn't find any good ip for this record, try the next one */
... ...
@@ -3257,6 +3262,7 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,  str* name,
3257 3262
 	char n_proto, origproto;
3258 3263
 	str srv_name;
3259 3264
 	int ret;
3265
+	int res;
3260 3266
 	int try_lookup_naptr = 0;
3261 3267
 
3262 3268
 	ret=-E_DNS_NO_NAPTR;
... ...
@@ -3302,7 +3308,7 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,  str* name,
3302 3308
 
3303 3309
 	if (!try_lookup_naptr) {
3304 3310
 		if(proto) *proto=origproto;
3305
-		int res = dns_srv_sip_resolve(h, name, ip, port, proto, flags);
3311
+		res = dns_srv_sip_resolve(h, name, ip, port, proto, flags);
3306 3312
 		if (res) {
3307 3313
 			mark_skip_current_naptr(e->rr_lst, h->srv);
3308 3314
 			if (have_more_active_naptr(e->rr_lst)) {
... ...
@@ -3324,8 +3330,8 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,  str* name,
3324 3330
 				LM_DBG("(%.*s, %d, %d), srv0, ret=%d\n",
3325 3331
 								name->len, name->s, h->srv_no, h->ip_no, ret);
3326 3332
 				dns_hash_put(e);
3327
-				*proto=n_proto;
3328
-				h->proto=*proto;
3333
+				if(proto) *proto=n_proto;
3334
+				h->proto=n_proto;
3329 3335
 				return ret;
3330 3336
 			}
3331 3337
 		}
... ...
@@ -4012,7 +4018,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4012 4018
 	size = e->total_size;
4013 4019
 	if (rdata_size) {
4014 4020
 		/* we have to extend the entry */
4015
-		rounded_size = ROUND_POINTER(size); /* size may not have been 
4021
+		rounded_size = ROUND_POINTER(size); /* size may not have been
4016 4022
 												rounded previously */
4017 4023
 		switch (e->type) {
4018 4024
 			case T_A:
... ...
@@ -4064,7 +4070,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4064 4070
 	/* fix the pointers inside the rr structures */
4065 4071
 	last_rr = NULL;
4066 4072
 	for (rr=new->rr_lst; rr; rr=rr->next) {
4067
-		rr->rdata = (void*)translate_pointer((char*)new, (char*)e, 
4073
+		rr->rdata = (void*)translate_pointer((char*)new, (char*)e,
4068 4074
 												(char*)rr->rdata);
4069 4075
 		if (rr->next)
4070 4076
 			rr->next = (struct dns_rr*)translate_pointer((char*)new, (char*)e,
... ...
@@ -4074,6 +4080,10 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4074 4080
 
4075 4081
 		switch(e->type){
4076 4082
 			case T_NAPTR:
4083
+				if(rr->rdata==NULL) {
4084
+					LM_WARN("null rdata filed for type: %u\n", e->type);
4085
+					break;
4086
+				}
4077 4087
 				/* there are pointers inside the NAPTR rdata stucture */
4078 4088
 				((struct naptr_rdata*)rr->rdata)->flags =
4079 4089
 					translate_pointer((char*)new, (char*)e,
... ...
@@ -4092,6 +4102,10 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4092 4102
 						((struct naptr_rdata*)rr->rdata)->repl);
4093 4103
 				break;
4094 4104
 			case T_TXT:
4105
+				if(rr->rdata==NULL) {
4106
+					LM_WARN("null rdata filed for type: %u\n", e->type);
4107
+					break;
4108
+				}
4095 4109
 				/* there are pointers inside the TXT structure */
4096 4110
 				for (i=0; i<((struct txt_rdata*)rr->rdata)->cstr_no; i++){
4097 4111
 					((struct txt_rdata*)rr->rdata)->txt[i].cstr=
... ...
@@ -4100,6 +4114,10 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4100 4114
 				}
4101 4115
 				break;
4102 4116
 			case T_EBL:
4117
+				if(rr->rdata==NULL) {
4118
+					LM_WARN("null rdata filed for type: %u\n", e->type);
4119
+					break;
4120
+				}
4103 4121
 				/* there are pointers inside the EBL structure */
4104 4122
 				((struct ebl_rdata*)rr->rdata)->separator =
4105 4123
 					translate_pointer((char*)new, (char*)e,
... ...
@@ -4118,7 +4136,9 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4118 4136
 		new_rr->rdata = (void*)((char*)new_rr+rr_size);
4119 4137
 		new_rr->expire = now + S_TO_TICKS(ttl);
4120 4138
 		/* link the rr to the previous one */
4121
-		last_rr->next = new_rr;
4139
+		if(last_rr) {
4140
+			last_rr->next = new_rr;
4141
+		}
4122 4142
 
4123 4143
 		/* fix the total_size and expires values */
4124 4144
 		new->total_size=rounded_size+rr_size+rdata_size;
... ...
@@ -4140,7 +4160,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4140 4160
  * If there is an existing record with the same name and value
4141 4161
  * (ip address in case of A/AAAA record, name in case of SRV record)
4142 4162
  * only the remaining fields are updated.
4143
- * 
4163
+ *
4144 4164
  * Note that permanent records cannot be overwritten unless
4145 4165
  * the new record is also permanent. A permanent record
4146 4166
  * completely replaces a non-permanent one.
... ...
@@ -4384,7 +4404,7 @@ int dns_cache_add_record(unsigned short type,
4384 4404
 
4385 4405
 				if (*rr_iter != new_rr->next) {
4386 4406
 					/* unlink rr from the list */
4387
-					*rr_p = (*rr_p)->next;
4407
+					*rr_p = (*rr_p)?(*rr_p)->next:NULL;
4388 4408
 					/* link it before *rr_iter */
4389 4409
 					new_rr->next = *rr_iter;
4390 4410
 					*rr_iter = new_rr;
... ...
@@ -860,7 +860,6 @@ int msg_get_src_addr(sip_msg_t *msg, str *uri, int mode)
860 860
 		p += TRANSPORT_PARAM_LEN;
861 861
 
862 862
 		memcpy(p, proto.s, proto.len);
863
-		p += proto.len;
864 863
 	}
865 864
 
866 865
 	uri->s = buf;
... ...
@@ -1113,6 +1112,130 @@ int uri_trim_rcv_alias(str *uri, str *nuri)
1113 1112
 	return 1;
1114 1113
 }
1115 1114
 
1115
+/**
1116
+ * encode sip uri to uri alias parameter format
1117
+ * - param: iuri - input sip uri
1118
+ * - param: ualias - output uri alias value in format: address~port~proto
1119
+ *   * ualias->s must point to a buffer of size ualias->len, at least iuri->len
1120
+ *   * ualias->len is adjusted to the output value length
1121
+ * - return 0 on success, negative on error
1122
+ */
1123
+int ksr_uri_alias_encode(str *iuri, str *ualias)
1124
+{
1125
+	sip_uri_t puri;
1126
+	char *p;
1127
+
1128
+	if (parse_uri (iuri->s, iuri->len, &puri) < 0) {
1129
+		LM_ERR("failed to parse uri [%.*s]\n", iuri->len, iuri->s);
1130
+		return -1;
1131
+	}
1132
+
1133
+	/*host~port~proto*/
1134
+	if(puri.host.len + 16 >= ualias->len) {
1135
+		LM_ERR("not enough space to build uri alias - buf size: %d\n",
1136
+				ualias->len);
1137
+		return -1;
1138
+	}
1139
+	p = ualias->s;
1140
+	memcpy(p, puri.host.s, puri.host.len);
1141
+	p += puri.host.len;
1142
+	*p++ = '~';
1143
+	if(puri.port.len>0) {
1144
+		memcpy(p, puri.port.s, puri.port.len);
1145
+		p += puri.port.len;
1146
+	} else {
1147
+		if(puri.proto==PROTO_TLS || puri.proto==PROTO_WSS) {
1148
+			memcpy(p, "5061", 4);
1149
+		} else {
1150
+			memcpy(p, "5060", 4);
1151
+		}
1152
+		p += 4;
1153
+	}
1154
+	*p++ = '~';
1155
+	*p++ = ((puri.proto)?puri.proto:1) + '0';
1156
+	ualias->len = p - ualias->s;
1157
+	ualias->s[ualias->len] = '\0';
1158
+
1159
+	LM_DBG("encoded <%.*s> => [%.*s]\n",
1160
+			iuri->len, iuri->s, ualias->len, ualias->s);
1161
+
1162
+	return 0;
1163
+}
1164
+
1165
+/**
1166
+ * decode uri alias parameter to a sip uri
1167
+ * - param: ualias - uri alias value in format: address~port~proto
1168
+ * - param: ouri - output uri - ouri->s must point to a buffer of size ouri->len
1169
+ *   * ouri->len is adjusted to the output value length
1170
+ * - return 0 on success, negative on error
1171
+ */
1172
+int ksr_uri_alias_decode(str *ualias, str *ouri)
1173
+{
1174
+	int n;
1175
+	char *p;
1176
+	int nproto;
1177
+	str sproto;
1178
+
1179
+	/* 24 => sip:...;transport=sctp */
1180
+	if(ualias->len + 24 >= ouri->len) {
1181
+		LM_ERR("received uri alias is too long: %d\n", ualias->len);
1182
+		return -1;
1183
+	}
1184
+
1185
+	/* received=ip~port~proto */
1186
+	memcpy(ouri->s, "sip:", 4);
1187
+	memcpy(ouri->s + 4, ualias->s, ualias->len);
1188
+	ouri->s[4 + ualias->len] = '\0';
1189
+	p = ouri->s + 4;
1190
+	n = 0;
1191
+	while(*p!='\0') {
1192
+		if(*p=='~') {
1193
+			n++;
1194
+			if(n==1) {
1195
+				/* port */
1196
+				*p = ':';
1197
+			} else if(n==2) {
1198
+				/* proto */
1199
+				*p = ';';
1200
+				p++;
1201
+				if(*p=='\0') {
1202
+					LM_ERR("invalid received format\n");
1203
+					goto error;
1204
+				}
1205
+				nproto = *p - '0';
1206
+				if(nproto == PROTO_NONE) {
1207
+					nproto = PROTO_UDP;
1208
+				}
1209
+				if (nproto != PROTO_UDP) {
1210
+					proto_type_to_str(nproto, &sproto);
1211
+					if (sproto.len == 0) {
1212
+						LM_ERR("unknown proto in received param\n");
1213
+						goto error;
1214
+					}
1215
+					memcpy(p, "transport=", 10);
1216
+					p += 10;
1217
+					memcpy(p, sproto.s, sproto.len);
1218
+					p += sproto.len;
1219
+				} else {
1220
+					/* go back one byte to overwrite ';' */
1221
+					p--;
1222
+				}
1223
+				ouri->len = (int)(p - ouri->s);
1224
+				ouri->s[ouri->len] = '\0';
1225
+				break;
1226
+			} else {
1227
+				LM_ERR("invalid number of separators (%d)\n", n);
1228
+				goto error;
1229
+			}
1230
+		}
1231
+		p++;
1232
+	}
1233
+	return 0;
1234
+
1235
+error:
1236
+	return -1;
1237
+}
1238
+
1116 1239
 /* address of record (aor) management */
1117 1240
 
1118 1241
 /* address of record considered case sensitive
... ...
@@ -285,6 +285,8 @@ int setbflagsval(unsigned int branch, flag_t val);
285 285
 int uri_add_rcv_alias(sip_msg_t *msg, str *uri, str *nuri);
286 286
 int uri_restore_rcv_alias(str *uri, str *nuri, str *suri);
287 287
 int uri_trim_rcv_alias(str *uri, str *nuri);
288
+int ksr_uri_alias_encode(str *iuri, str *ualias);
289
+int ksr_uri_alias_decode(str *ualias, str *ouri);
288 290
 
289 291
 int init_dst_set(void);
290 292
 
... ...
@@ -2143,6 +2143,11 @@ static int sr_kemi_hdr_insert(sip_msg_t *msg, str *txt)
2143 2143
 	if(txt==NULL || txt->s==NULL || msg==NULL)
2144 2144
 		return -1;
2145 2145
 
2146
+	if ((parse_headers(msg, HDR_EOH_F, 0) == -1) || (msg->headers == NULL)) {
2147
+		LM_ERR("error while parsing message\n");
2148
+		return -1;
2149
+	}
2150
+
2146 2151
 	LM_DBG("insert hf: %.*s\n", txt->len, txt->s);
2147 2152
 	hdr = (char*)pkg_malloc(txt->len);
2148 2153
 	if(hdr==NULL) {
... ...
@@ -2188,7 +2193,7 @@ static int sr_kemi_hdr_insert_before(sip_msg_t *msg, str *txt, str *hname)
2188 2193
 		return -1;
2189 2194
 	}
2190 2195
 
2191
-	if (parse_headers(msg, HDR_EOH_F, 0) == -1) {
2196
+	if ((parse_headers(msg, HDR_EOH_F, 0) == -1) || (msg->headers == NULL)) {
2192 2197
 		LM_ERR("error while parsing message\n");
2193 2198
 		return -1;
2194 2199
 	}
... ...
@@ -380,7 +380,7 @@ int lval_assign(struct run_act_ctx* h, struct sip_msg* msg,
380 380
 	struct rvalue* rv;
381 381
 	int ret;
382 382
 
383
-	ret=0;
383
+	ret=-1;
384 384
 	rv=rval_expr_eval(h, msg, rve);
385 385
 	if (unlikely(rv==0)){
386 386
 		LM_ERR("rval expression evaluation failed (%d,%d-%d,%d)\n",
... ...
@@ -404,9 +404,7 @@ int lval_assign(struct run_act_ctx* h, struct sip_msg* msg,
404 404
 		LM_ERR("assignment failed at pos: (%d,%d-%d,%d)\n",
405 405