Asterisk-16.7.0 crash if 'pjsip set logger on'
I've experienced an issue where Asterisk exists/crashes when 'pjsip set logger on' is set in the Asterisk CLI. This happens with the asterisk-16.7.0 in alpine:3.12.0 and asterisk-15.7.4 in alpine:3.9.3. The problem occurs when the above is set and asterisk receives a new call. It works fine if the above is not set.
The same happens if PJSIP tries to parse a call with a faulty SIP-header so I guess it might be related. There is no error unfortunately but this is the output I get while calling to it with 'pjsip set logger on' set.
/ # asterisk -vvvvvvvvvvvvvvvvvvvvr
Asterisk 16.7.0, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 16.7.0 currently running on HP-EliteBook (pid = 8)
HP-EliteBook*CLI> pjsip set logger on
PJSIP Logging enabled
HP-EliteBook*CLI>
HP-EliteBook*CLI>
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":34,"callid":""},"logmsg":{"location":{"filename":"res_pjsip_logger.c","function":"logging_on_rx_msg","line":104},"level":"VERBOSE","message":"<--- Received SIP request (474 bytes) from UDP:127.0.0.1:5061 --->\nINVITE sip:echo-bot-se@127.0.0.1:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 127.0.0.1:5061\r\nFrom: sipp <sip:sipp@127.0.0.15061>;tag=1\r\nTo: echo-bot <sip:echo-bot-se@127.0.0.1:5060>\r\nCall-ID: 1-7@127.0.0.1\r\nCseq: 1 INVITE\r\nContact: sip:sipp@127.0.0.1:5061\r\nMax-Forwards: 70\r\nSubject: Performance Test\r\nContent-Type: application/sdp\r\nContent-Length: 129\r\n\r\nv=0\r\no=user1 53655765 2353687637 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\nc=IN IP4 127.0.0.1\r\nm=audio 6000 RTP/AVP 8\r\na=rtpmap:8 PCMA/8000\r\n\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":35,"callid":""},"logmsg":{"location":{"filename":"pbx_variables.c","function":"pbx_builtin_setvar_helper","line":1115},"level":"VERBOSE","message":"Setting global variable 'SIPDOMAIN' to '127.0.0.1'\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":35,"callid":""},"logmsg":{"location":{"filename":"res_pjsip_logger.c","function":"logging_on_tx_msg","line":83},"level":"VERBOSE","message":"<--- Transmitting SIP response (263 bytes) to UDP:127.0.0.1:5061 --->\nSIP/2.0 100 Trying\r\nVia: SIP/2.0/UDP 127.0.0.1:5061;rport=5061;received=127.0.0.1\r\nCall-ID: 1-7@127.0.0.1\r\nFrom: \"sipp\" <sip:sipp@127.0.0.15061>;tag=1\r\nTo: \"echo-bot\" <sip:echo-bot-se@127.0.0.1>\r\nCSeq: 1 INVITE\r\nServer: Asterisk PBX 16.7.0\r\nContent-Length: 0\r\n\r\n\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":59,"callid":"[C-00000001]"},"logmsg":{"location":{"filename":"pbx.c","function":"pbx_extension_helper","line":2940},"level":"VERBOSE","message":"Executing [echo-bot-se@inbound:1] NoOp(\"PJSIP/anonymous-00000000\", \"\") in new stack\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":59,"callid":"[C-00000001]"},"logmsg":{"location":{"filename":"pbx.c","function":"pbx_extension_helper","line":2940},"level":"VERBOSE","message":"Executing [echo-bot-se@inbound:2] EAGI(\"PJSIP/anonymous-00000000\", \"main\") in new stack\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:01","identifiers":{"lwp":59,"callid":"[C-00000001]"},"logmsg":{"location":{"filename":"res_agi.c","function":"launch_script","line":2296},"level":"VERBOSE","message":"Launched AGI Script /var/lib/asterisk/agi-bin/main\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:02","identifiers":{"lwp":35,"callid":""},"logmsg":{"location":{"filename":"res_rtp_asterisk.c","function":"ast_rtp_remote_address_set","line":8051},"level":"VERBOSE","message":"0x557ec287c020 -- Strict RTP learning after remote address set to: 127.0.0.1:6000\n"}}
{"hostname":"","timestamp":"Sep 1 14:49:02","identifiers":{"lwp":35,"callid":""},"logmsg":{"location":{"filename":"res_pjsip_logger.c","function":"logging_on_tx_msg","line":83},"level":"VERBOSE","message":"<--- Transmitting SIP response (693 bytes) to UDP:127.0.0.1:5061 --->\nSIP/2.0 200 OK\r\nVia: SIP/2.0/UDP 127.0.0.1:5061;rport=5061;received=127.0.0.1\r\nCall-ID: 1-7@127.0.0.1\r\nFrom: \"sipp\" <sip:sipp@127.0.0.15061>;tag=1\r\nTo: \"echo-bot\" <sip:echo-bot-se@127.0.0.1>;tag=mLJYvgSGETo4B9HLu57UOS6WrQNXN3QK\r\nCSeq: 1 INVITE\r\nServer: Asterisk PBX 16.7.0\r\nContact: <sip:127.0.0.1:5060>\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER\r\nSupported: 100rel, timer, replaces, norefersub\r\nContent-Type: application/sdp\r\nContent-Length: 173\r\n\r\nv=0\r\no=- 53655765 2353687639 IN IP4 127.0.0.1\r\ns=Asterisk\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\nm=audio 15670 RTP/AVP 8\r\na=rtpmap:8 PCMA/8000\r\na=ptime:20\r\na=maxptime:150\r\na=sendrecv\r\n\n
HP-EliteBook*CLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups
With:
HP-EliteBook*CLI> pjsip show version
PJPROJECT version currently running against: 2.9