[Home]

Summary:ASTERISK-28323: pjsip: sip.conf to pjsip.conf conversion script fails
Reporter:Guido Weckwerth (engiadina)Labels:pjsip
Date Opened:2019-03-04 07:01:36.000-0600Date Closed:2019-03-05 08:55:47.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Contrib/General
Versions:15.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux UbuntuAttachments:( 0) sip_callcentric_post.conf
( 1) sip_DTAG_post.conf
( 2) sip_NetVoip_post.conf
( 3) sip_SipGate_post.conf
( 4) sip_woopla_post.conf
( 5) sip.conf
Description:When I run the conversion script for converting SIP.CONF to PJSIP.CONF the script only produces a few lines and stops without any error. The major part of the config file (with six include files) is just ignored.

This is the complete output (network addresses obscured):

;--
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements start
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[general]
bindport = 5060

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Non mapped elements end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--;


[transport-udp]
type = transport
protocol = udp
bind = 192.168.5.111:5060
external_media_address = xx.xxx.245.203
external_signaling_address = xx.xxx.245.203
local_net = 192.168.5.0/255.255.255.0
local_net = 192.168.50.0/255.255.255.0
local_net = 192.168.146.0/255.255.255.0

[transport-tcp]
type = transport
protocol = tcp
bind = 192.168.5.111:5060
external_media_address = xx.xxx.245.203
external_signaling_address = xx.xxx.245.203
local_net = 192.168.5.0/255.255.255.0
local_net = 192.168.50.0/255.255.255.0
local_net = 192.168.146.0/255.255.255.0
Comments:By: Asterisk Team (asteriskteam) 2019-03-04 07:01:37.441-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-03-04 07:08:30.171-0600

Asterisk 15 is no longer supported. If you try the script in Asterisk 16 does it provide additional information about failure or work? If not you'll need to provide the sip.conf which exhibits the problem so we can see what precisely is causing it not to work as expected.

By: Guido Weckwerth (engiadina) 2019-03-04 07:49:53.122-0600

I checked with version 16.2.1 - no change

I'll provide my SIP.conf




By: Guido Weckwerth (engiadina) 2019-03-04 08:16:50.111-0600

Ok, I prepared my sip.conf to upload and will do.


By: Guido Weckwerth (engiadina) 2019-03-04 08:18:12.198-0600

Here is the compressed collection of sip.conf

By: Sean Bright (seanbright) 2019-03-04 12:17:47.764-0600

[~engiadina] - the sequence {{;--}} begins a multiline comment block. Once the parser reaches line 67 of [^sip.conf], it finds that sequence and effectively ignores in the remainder of the file.

Are these files being read completely by your current version of Asterisk today? If so, I think there might be a bug in the configuration parsing within Asterisk itself. {{sip_to_pjsip.py}} appears to be working correctly.

By: Sean Bright (seanbright) 2019-03-04 12:22:37.209-0600

After reviewing the code in {{main/config.c}}, it looks like {{;--}} should only start a multiline comment if it is not immediately followed by another {{\-}}. So the {{sip_to_pjsip.py}} script is not performing the same as the Asterisk config parser.

By: Guido Weckwerth (engiadina) 2019-03-04 13:05:48.319-0600

The files are read completely by asterisk as they are. So I had no clue that the script is actually interpreting the rest of my file as a comment.


By: Friendly Automation (friendly-automation) 2019-03-05 08:55:48.346-0600

Change 11091 merged by Friendly Automation:
sip_to_pjsip: Make multiline comment parsing consistent with Asterisk

[https://gerrit.asterisk.org/c/asterisk/+/11091|https://gerrit.asterisk.org/c/asterisk/+/11091]

By: Friendly Automation (friendly-automation) 2019-03-05 09:19:16.465-0600

Change 11093 merged by Friendly Automation:
sip_to_pjsip: Make multiline comment parsing consistent with Asterisk

[https://gerrit.asterisk.org/c/asterisk/+/11093|https://gerrit.asterisk.org/c/asterisk/+/11093]

By: Friendly Automation (friendly-automation) 2019-03-05 09:21:54.739-0600

Change 11092 merged by Joshua Colp:
sip_to_pjsip: Make multiline comment parsing consistent with Asterisk

[https://gerrit.asterisk.org/c/asterisk/+/11092|https://gerrit.asterisk.org/c/asterisk/+/11092]