[asterisk-bugs] [JIRA] (ASTERISK-28397) ARI Push Configuration - duplicate entries

Vitezslav Novy (JIRA) noreply at issues.asterisk.org
Fri Jun 17 04:33:49 CDT 2022


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=259513#comment-259513 ] 

Vitezslav Novy commented on ASTERISK-28397:
-------------------------------------------

Module res_pjsip_config_wizard registers sorcery memory wizard for endpoint, aor, auth and maybe other pjsip sorcery object types. With sorcery configuration shown above, we end with 2 sorcery wizards (astdb, memory) for these objects.
When ARI is used to create object, function ast_sorcery_create stores the object using both wizards.

Retrieval functions like ast_sorcery_retrieve_by_regex or ast_sorcery_retrieve_by_prefix fetch objects from all wizards, but there is no deduplication.

Workaround: if not needed do not load module res_pjsip_config_wizard or delete config file pjsip_wizard.conf 

> ARI Push Configuration - duplicate entries
> ------------------------------------------
>
>                 Key: ASTERISK-28397
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28397
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 13.21.0
>         Environment: NAME="CentOS Linux"
> VERSION="7 (Core)"
> ID="centos"
> ID_LIKE="rhel fedora"
> VERSION_ID="7"
> PRETTY_NAME="CentOS Linux 7 (Core)"
> ANSI_COLOR="0;31"
> CPE_NAME="cpe:/o:centos:centos:7"
> HOME_URL="https://www.centos.org/"
> BUG_REPORT_URL="https://bugs.centos.org/"
> CENTOS_MANTISBT_PROJECT="CentOS-7"
> CENTOS_MANTISBT_PROJECT_VERSION="7"
> REDHAT_SUPPORT_PRODUCT="centos"
> REDHAT_SUPPORT_PRODUCT_VERSION="7"
>            Reporter: Evgeniy
>              Labels: pjsip
>
> I’m working with ARI Push Configuration. Everytime I create new ‘auth’ section using:
> curl -X PUT -H "Content-Type: application/json" -u asterisk:secret -d '{"fields": [ { "attribute": "auth_type", "value": "userpass"}, {"attribute": "username", "value": "alice"}, {"attribute": "password", "value": "secret" } ] }' https://localhost:8088/ari/asterisk/config/dynamic/res_pjsip/auth/alice
> Asterisk command ‘pjsip show auths’ prints duplicate entry:
>   I/OAuth:  <AuthId/UserName.............................................................>
> ==========================================================================================
>      Auth:  alice/alice
>      Auth:  alice/alice
> Objects found: 2
> Same issue occurs with ‘aor’ and ‘endpoint’ sections.
> Invoking HTTP GET on /ari/endpoints prints only single entry.
> My question is why Asterisk command line always prints duplicate entries and how to fix this issue?
> {code:title=sorcery.conf|borderStyle=solid}
> [res_pjsip]
> endpoint=astdb,ps_endpoints
> auth=astdb,ps_auths
> aor=astdb,ps_aors
> domain_alias=astdb,ps_domain_aliases
> contact=astdb,ps_contacts
> system=astdb,ps_systems
>  
> [res_pjsip_endpoint_identifier_ip]
> identify=astdb,ps_endpoint_id_ips
>  
> [res_pjsip_outbound_registration]
> registration=astdb,ps_registrations
> {code}
> {code:title=pjsip.conf|borderStyle=solid}
> [transport-udp]
> type=transport
> protocol=udp
> bind=0.0.0.0:5060
> [transport-tcp]
> type=transport
> protocol=tcp
> bind=0.0.0.0:5060
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list