[Home]

Summary:ASTERISK-29470: sip_to_pjsip script improperly combines registration config
Reporter:N A (InterLinked)Labels:
Date Opened:2021-06-08 12:29:00Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Channels/chan_pjsip
Versions:18.4.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:Major bug in this script, though probably minor overall as far as Asterisk is concerned:

the pjsip_to_sip script does not properly parse configuration where multiple registrations exist with the same server or provider.

This is example output from running the script - clearly nonsensical:
{noformat}
[reg_callcentric.com]
type = registration
retry_interval = 20
max_retries = 10
contact_user = callcentric
contact_user = callcentrict2
expiration = 120
transport = transport-udp
outbound_auth = auth_reg_callcentric.com
client_uri = sip:1@callcentric.com
client_uri = sip:2@callcentric.com
server_uri = sip:callcentric.com

[auth_reg_callcentric.com]
type = auth
password = t
password = f
username = 1
username = 2

[reg_freedid.ipcomms.net]
type = registration
retry_interval = 20
max_retries = 10
contact_user = ipcomms
contact_user = ipcomms2
expiration = 120
transport = transport-udp
outbound_auth = auth_reg_freedid.ipcomms.net
client_uri = sip:1@freedid.ipcomms.net
client_uri = sip:2@freedid.ipcomms.net
server_uri = sip:freedid.ipcomms.net

[auth_reg_freedid.ipcomms.net]
type = auth
password = 1
password = 2
username = 1
username = 2
{noformat}
The above is clearly nonsense, but PJSIP generates no errors from this configuration and one of the registrations will succeed, making it appear as though all is dandy when in fact most of the configuration is likely broken or non-existent as far as PJSIP is concerned.

This is created from the corresponding sip.conf:
{noformat}
register => 1:x@callcentric.com/callcentric
register => 2:y@callcentric.com/callcentrict2

[callcentric]
type=peer
context=from-callcentric
host=callcentric.com
fromdomain=callcentric.com
defaultuser=1
fromuser=1
secret=x
insecure=port,invite
disallowed_methods=UPDATE
directmedia=no
videosupport=no
disallow=all
allow=g722
allow=ulaw

[callcentrict2]
type=peer
context=from-callcentric
host=callcentric.com
fromdomain=callcentric.com
defaultuser=2
fromuser=2
secret=y
insecure=port,invite
disallowed_methods=UPDATE
directmedia=no
videosupport=no
disallow=all
allow=g722
allow=ulaw
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2021-06-08 12:29:00.478-0500

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. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

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.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Kevin Harwell (kharwell) 2021-06-08 15:04:49.128-0500

[~InterLinked] think this is something you'll patch and put up for review?

By: N A (InterLinked) 2021-06-08 15:05:50.404-0500

Probably not this one, no - just wanted to report.