ARI Push Configuration - duplicate entries

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?

My configuration:
Asterisk version: 16

sorcery.conf

    [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

pjsip.conf

    [transport-udp]
    type=transport
    protocol=udp
    bind=0.0.0.0:5060

    [transport-tcp]
    type=transport
    protocol=tcp
    bind=0.0.0.0:5060

Are you invoking the HTTP request multiple times with the same data, or do you mean you do it once and then they show up multiple times in the CLI commands? It may be the same core problem as a known issue[1] if you only do it once.

[1] https://issues.asterisk.org/jira/browse/ASTERISK-28228

It doesn’t matter how many times I invoke request. Result is always the same. What is more interesting, when I restart Asterisk by ‘core restart now’ then duplicate entry disappears and only one is printed by CLI command. Then every new HTTP PUT with the same data provided rewrite existing entry. Deleting entry and creating it again prints duplicates. Seems like restarting Asterisk is fixing the issue but that is not a correct solution.

Hello! I have the same proplem? Did you fix it?

No. Problem still exists.

You can file an issue on the issue tracker[1] with an ARI script and configuration to reproduce, but I have no timeframe on when it will be looked into.

[1] https://issues.asterisk.org/jira

Maybe, you have a workaround? Do you know another way to push configuration programmatically? Thanks!

I have created an Issue on the issue tracker. Hope, you will find the time to looked into =)

https://issues.asterisk.org/jira/browse/ASTERISK-28397

No. I’m using HTTP GET on /ari/endpoints to get correct results. CLI commands are useful for me only for debbuging purposes.

If it is relevant to created issue on issue tracker, I’m also running Asterisk on CentOS Linux 7.

I’m unlikely to be the one who works or touches the issue, so any potentially useful information should always go on the issue itself.