[Home]

Summary:ASTERISK-28563: Additional configuration [extName](+) not always working
Reporter:Michael Maier (micha)Labels:pjsip
Date Opened:2019-10-03 08:51:37Date Closed:2019-10-03 12:48:40
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/Configuration
Versions:16.5.0 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-25868 Sorcery "append to category" should allow filters
Environment:CentOS 7Attachments:
Description:There is a problem regarding the configuration options, provided by FreePBX, which should be supported by asterisk. I'm referring to the possibility, to add additional options not supported by FreePBX using special config files like pjsip.registration_custom_post.conf or pjsip.aor_custom_post.conf and pjsip.endpoint_custom_post.conf or pjsip.transports_custom_post.conf. The last two files are working pretty fine as expected, but the first two just don't work.

I'm configuring in pjsip.registration_custom_post.conf for example:

{noformat}
[extName](+)
key=value
{noformat}

Asterisk reads it (asterisk complains if it doesn't know the key), but asterisk doesn't apply the provided value for a known key - it's always the default value.
Comments:By: Asterisk Team (asteriskteam) 2019-10-03 08:51:39.020-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.

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: George Joseph (gjoseph) 2019-10-03 10:36:17.977-0500

I just tested 16.5 with this...

pjsip.conf:
{noformat}
[global]
type = global
default_outbound_endpoint = dpma_endpoint
max_initial_qualify_time = 2
endpoint_identifier_order = ip,auth_username,username,anonymous
keep_alive_interval=20

#include pjsip.include.conf
{noformat}

pjsip.include.conf:
{noformat}
[global](+)
max_initial_qualify_time = 5
{noformat}

I get this:
{noformat}
*CLI> pjsip show settings

Global Settings:

ParameterName                              : ParameterValue
================================================================================
contact_expiration_check_interval          : 30
debug                                      : no
default_from_user                          : asterisk
default_outbound_endpoint                  : dpma_endpoint
default_realm                              : asterisk
default_voicemail_extension                :
disable_multi_domain                       : false
endpoint_identifier_order                  : ip,auth_username,username,anonymous
ignore_uri_user_options                    : false
keep_alive_interval                        : 20
max_forwards                               : 70
max_initial_qualify_time                   : 5
mwi_disable_initial_unsolicited            : false
mwi_tps_queue_high                         : 500
mwi_tps_queue_low                          : -1
norefersub                                 : yes
regcontext                                 :
send_contact_status_on_update_registration : no
taskprocessor_overload_trigger             : global
unidentified_request_count                 : 5
unidentified_request_period                : 5
unidentified_request_prune_interval        : 30
use_callerid_contact                       : no
user_agent                                 : Asterisk PBX 16.5.1
{noformat}

Notice that max_initial_qualify_time has the updated value.

I don't know how FreePBX does their configurations so this is best reported to them.




By: Kevin Harwell (kharwell) 2019-10-03 10:43:36.915-0500

According to [~rmudgett] this could be due to the way pjsip configuration uses "type" parameters for its sections, and then using the same name for a section. So for instance:
{noformat}
[101]
type=aor

[101]
type=endpoint

[101](+)
{noformat}
Which one does it choose to append? The first one it finds?

By: Michael Maier (micha) 2019-10-03 11:14:42.060-0500

That's another example:
{noformat}
cat pjsip.conf
;--------------------------------------------------------------------------------;
;          Do NOT edit this file as it is auto-generated by FreePBX.             ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate.                                                         ;
;--------------------------------------------------------------------------------;
#include pjsip_custom.conf
#include pjsip.transports.conf
#include pjsip.transports_custom_post.conf
#include pjsip.endpoint.conf
#include pjsip.endpoint_custom_post.conf
#include pjsip.aor.conf
#include pjsip.aor_custom_post.conf
#include pjsip.auth.conf
#include pjsip.auth_custom_post.conf
#include pjsip.registration.conf
#include pjsip.registration_custom_post.conf
#include pjsip.identify.conf
#include pjsip.identify_custom_post.conf


[global]
type=global
user_agent=FPBX-14.0.11(16.5.1)
endpoint_identifier_order=ip,username,anonymous,header,auth_username
#include pjsip_custom_post.conf


cat pjsip.registration.conf
;--------------------------------------------------------------------------------;
;          Do NOT edit this file as it is auto-generated by FreePBX.             ;
;--------------------------------------------------------------------------------;
; For information on adding additional paramaters to this file, please visit the ;
; FreePBX.org wiki page, or ask on IRC. This file was created by the new FreePBX ;
; BMO - Big Module Object. Any similarity in naming with BMO from Adventure Time ;
; is totally deliberate.                                                         ;
;--------------------------------------------------------------------------------;
#include pjsip.registration_custom.conf

[trunk1]
type=registration
transport=0.0.0.0-tls
outbound_auth=trunk1
retry_interval=60
fatal_retry_interval=0
forbidden_retry_interval=10
max_retries=10000
expiration=3600
line=yes
endpoint=trunk1
auth_rejection_permanent=yes
contact_user=...
server_uri=sip:...
client_uri=sip:...



myfw*CLI> pjsip show registration trunk1

[...]

ParameterName            : ParameterValue
==============================================================
auth_rejection_permanent : true
[...]
endpoint                 : trunk1
expiration               : 3600
fatal_retry_interval     : 0
forbidden_retry_interval : 10
line                     : true
max_retries              : 10000
outbound_auth            : trunk1
outbound_proxy           :
retry_interval           : 60
^^^^^^^^^^^^^^
[...]


cat pjsip.registration_custom_post.conf
[trunk1](+)
retry_interval=80

myfw*CLI> core reload

myfw*CLI> pjsip show registration trunk1

[...]

ParameterName            : ParameterValue
==============================================================
auth_rejection_permanent : true
[...]
endpoint                 : trunk1
expiration               : 3600
fatal_retry_interval     : 0
forbidden_retry_interval : 10
line                     : true
max_retries              : 10000
outbound_auth            : trunk1
outbound_proxy           :
retry_interval           : 60
^^^^^^^^^^^^^^
[...]
{noformat}

In this special case, I'm getting the error on core reload:
{noformat}
config_options.c:780 aco_process_var: Could not find option suitable for category 'trunk1' named 'retry_interval' at line 2 of /etc/asterisk/pjsip.registration_custom_post.conf
{noformat}

By: Asterisk Team (asteriskteam) 2019-10-03 11:14:42.237-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: George Joseph (gjoseph) 2019-10-03 11:57:23.316-0500

Yes, when used with pjsip objects where more than 1 object has the same name but different type,  the + will apply to the first one defined UNLESS you qualify the + as follows...
{noformat}
[101]
type=endpoint
allow=ulaw

[101]
type=aor
default_expiration=3600

[101](+type=endpoint)
allow=g722

[101](+type=aor)
default_expiration=1200
{noformat}

You can actually specify any parameter to search on, not just type.



By: Sean Bright (seanbright) 2019-10-03 12:48:41

So in this case, it appears the correct configuration should be:

{noformat}
[trunk1](+type=registration)
retry_interval=80
{noformat}