Hello,
I am considering to release Kamailio v5.1.7 later this week, likely on
Thursday, January 31, 2019.
As usual, here come the notice to report any issue that you are aware of
and not yet registered on the bug tracker in order to give them a chance
to be analyzed and eventually fixed before the release. Also, take a
look at the branch 5.1 in git and check if there are any missing commits
from those you expected to be backported.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com
Kamailio Advanced Training - Mar 4-6, 2019 in Berlin; Mar 25-27, 2019, in Washington, DC, USA -- www.asipto.com
Module: kamailio
Branch: master
Commit: d61b570c21200bb90cb00d8203f62997c6035bdb
URL: https://github.com/kamailio/kamailio/commit/d61b570c21200bb90cb00d8203f6299…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-01-30T13:39:04+01:00
core: added command line option --alias=val
* set an alias from command line
* example: kamailio --alias=udp:kamailio.org:5060 ...
---
Modified: src/main.c
---
Diff: https://github.com/kamailio/kamailio/commit/d61b570c21200bb90cb00d8203f6299…
Patch: https://github.com/kamailio/kamailio/commit/d61b570c21200bb90cb00d8203f6299…
---
diff --git a/src/main.c b/src/main.c
index f1a26359f6..4e3b9112e4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -155,6 +155,8 @@ Usage: " NAME " [options]\n\
Options:\n\
-a mode Auto aliases mode: enable with yes or on,\n\
disable with no or off\n\
+ --alias=val Add an alias, the value has to be '[proto:]hostname[:port]'\n\
+ (like for 'alias' global parameter)\n\
-A define Add config pre-processor define (e.g., -A WITH_AUTH)\n\
-b nr Maximum receive buffer size which will not be exceeded by\n\
auto-probing procedure even if OS allows\n\
@@ -170,7 +172,7 @@ Options:\n\
-g gid Change gid (group id)\n\
-G file Create a pgid file\n\
-h This help message\n\
- --help Same as `-h`\n\
+ --help Long option for `-h`\n\
-I Print more internal compile flags and options\n\
-K Turn on \"via:\" host checking when forwarding replies\n\
-l address Listen on the specified address/interface (multiple -l\n\
@@ -209,8 +211,9 @@ Options:\n\
" -T Disable tcp\n"
#endif
" -u uid Change uid (user id)\n\
- -v (-V) Version number\n\
- --version Same as `-v`\n\
+ -v Version number\n\
+ --version Long option for `-v`\n\
+ -V Alternative for `-v`\n\
-x name Specify internal manager for shared memory (shm)\n\
- can be: fm, qm or tlsf\n\
-X name Specify internal manager for private memory (pkg)\n\
@@ -1878,9 +1881,13 @@ int main(int argc, char** argv)
int option_index = 0;
+#define KARGOPTVAL 1024
static struct option long_options[] = {
+ /* long options with short variant */
{"help", no_argument, 0, 'h'},
{"version", no_argument, 0, 'v'},
+ /* long options without short variant */
+ {"alias", required_argument, 0, KARGOPTVAL},
{0, 0, 0, 0 }
};
@@ -2101,6 +2108,21 @@ int main(int argc, char** argv)
case 's':
case 'Y':
break;
+
+ /* long options */
+ case KARGOPTVAL:
+ if(parse_phostport(optarg, &tmp, &tmp_len,
+ &port, &proto)!=0) {
+ fprintf(stderr, "Invalid alias value '%s'\n", optarg);
+ goto error;
+ }
+ if(add_alias(tmp, tmp_len, port, proto)<0) {
+ fprintf(stderr, "Failed to add alias value '%s'\n", optarg);
+ goto error;
+ }
+ break;
+
+ /* special cases */
case '?':
if (isprint(optopt)) {
fprintf(stderr, "Unknown option '-%c'."
@@ -2122,6 +2144,7 @@ int main(int argc, char** argv)
optopt, option_index);
}
goto error;
+
default:
fprintf(stderr, "Invalid option code '0x%x'", c);
return -1;
### Description
I use kazoo and postgres modules on my host. I found that many database operation generates error like
```
19(150) exec: *** cfgtrace:request_route=[kazoo:consumer-event-presence-dialog-update] c=[//etc/kamailio/presence-role.cfg] l=270 a=32 n=kazoo_pua_publish_presence
17(148) exec: *** cfgtrace:request_route=[kazoo:consumer-event-presence-dialog-update] c=[//etc/kamailio/presence-role.cfg] l=271 a=27 n=pres_refresh_watchers
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
17(148) ERROR: presence_xml [notify_body.c:551]: agregate_xmls(): while parsing xml body message
17(148) ERROR: presence_xml [notify_body.c:156]: pres_agg_nbody(): while aggregating body
19(150) exec: *** cfgtrace:request_route=[kazoo:consumer-event-presence-dialog-update] c=[//etc/kamailio/presence-role.cfg] l=271 a=27 n=pres_refresh_watchers
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
19(150) ERROR: presence_xml [notify_body.c:551]: agregate_xmls(): while parsing xml body message
19(150) ERROR: presence_xml [notify_body.c:156]: pres_agg_nbody(): while aggregating body
18(149) exec: *** cfgtrace:request_route=[kazoo:consumer-event-nodes-advertise] c=[//etc/kamailio/nodes-role.cfg] l=66 a=63 n=assign
18(149) exec: *** cfgtrace:request_route=[kazoo:consumer-event-nodes-advertise] c=[//etc/kamailio/nodes-role.cfg] l=74 a=16 n=if
18(149) exec: *** cfgtrace:request_route=[kazoo:consumer-event-nodes-advertise] c=[//etc/kamailio/nodes-role.cfg] l=74 a=16 n=if
18(149) exec: *** cfgtrace:request_route=[kazoo:consumer-event-nodes-advertise] c=[//etc/kamailio/nodes-role.cfg] l=75 a=27 n=mq_add
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
17(148) ERROR: presence_xml [notify_body.c:551]: agregate_xmls(): while parsing xml body message
17(148) ERROR: presence_xml [notify_body.c:156]: pres_agg_nbody(): while aggregating body
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
19(150) ERROR: presence_xml [notify_body.c:551]: agregate_xmls(): while parsing xml body message
19(150) ERROR: presence_xml [notify_body.c:156]: pres_agg_nbody(): while aggregating body
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
17(148) ERROR: presence_xml [notify_body.c:551]: agregate_xmls(): while parsing xml body message
17(148) ERROR: presence_xml [notify_body.c:156]: pres_agg_nbody(): while aggregating body
17(148) exec: *** cfgtrace:request_route=[kazoo:consumer-event-presence-dialog-update] c=[//etc/kamailio/presence-role.cfg] l=276 a=26 n=xlog
17(148) INFO: <script>: 3O75Qw3gqR3ZNla5RfCgQLVW0-8KKbrT|log|finished processing dialog update for sip:2496@rcsnet.ru state confirmed from sip:217.12.247.98:11000 at 1506632313/1506632313/1506632313
Entity: line 1: parser error : Start tag expected, '<' not found
\x3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38223f3e3c
^
```
After some debugging i found that kamailio wants save to database xml string like this as BLOB object
```
<?xml version="1.0" encoding="UTF-8"?><presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:c="urn:ietf:params:xml:ns:pidf:cipid" entity="2496"> <tuple xmlns="urn:ietf:params:xml:ns:pidf" id="t8No1hQnp65U33jS1oqFMgxbIRPq-iFP"><status><basic>open</basic></status></tuple><note xmlns="urn:ietf:params:xml:ns:pidf">On the Phone</note><dm:person xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" id="1"><rpid:activities><rpid:on-the-phone/></rpid:activities><dm:note>On the Phone</dm:note></dm:person></presence>
```
And later tries to read. But when this XML read reverse conversion of BLOB to string is not take place. And late used BLOB as is. This breaks presentation logic completely.
#### Reproduction
Configure kamailio on kazoo cluster to use PostgreSQL database
On phone create subscribe to second
>From second phone create new call.
#### Operating System
CentOS 7
Linux node2.docker.rcsnet.ru 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1255