PJSIP Does Not Qualify Contacts After Starting Asterisk

Home » Asterisk Users » PJSIP Does Not Qualify Contacts After Starting Asterisk
Asterisk Users 5 Comments

Hi all,
(sending this again from the correct address)

I’m running Asterisk 13.8.0 (I need to check if that happens with 13.9.1 too when I have the time to build it) with PJSIP realtime config.

I’ve defined several aors in the table ps_aors, like this (real url replaced by myurl):

*CLI> pjsip show aor pbx-node-1

Aor:
Contact:
=========================================================================================

Aor: pbx-node-1 0
Contact: pbx-node-1/sip:myurl:5060 771bf6a7d4 Created 0.000

ParameterName : ParameterValue
===================================================
authenticate_qualify : false contact : sip:myurl:5060
default_expiration : 3600
mailboxes :
max_contacts : 0
maximum_expiration : 7200
minimum_expiration : 60
outbound_proxy : sip:myurl:5060
qualify_frequency : 30
qualify_timeout : 3.000000
remove_existing : false support_path : false

So I think that those aors should be qualified automatically when I run Asterisk, but if I do “pjsip show contacts”, I get that it was just Created but not qualified:

*CLI> pjsip show contacts

Contact:
=========================================================================================
Contact: pbx-node-1/sip:myurl:5060 771bf6a7d4 Created 0.000

And not a single OPTIONS message if I take a trace…

If I want Asterisk to start sending OPTIONS, I need to do pjsip reload and after that, they are qualified and their status changes dynamically:

*CLI> pjsip show contacts

Contact:
=========================================================================================
Contact: pbx-node-1/sip:myurl.ch:5060 771bf6a7d4 Avail 8.833

The extconfig.conf file looks like this:

[settings]
ps_endpoints => odbc,asterisk ps_auths => odbc,asterisk ps_aors => odbc,asterisk ps_domain_aliases => odbc,asterisk ps_endpoint_id_ips => odbc,asterisk ps_contacts => odbc,asterisk extensions => odbc,asterisk

Any idea why I need to reload PJSIP if I want the aors to be qualified?

Cheers, Francisco.

5 thoughts on - PJSIP Does Not Qualify Contacts After Starting Asterisk

  • Hello Francisco,

    you have to use:

    extensions => odbc,asterisk

    only if you want use dialplan in Realtime

    can you share your sorcery.conf file?

    Regards

    El 13/06/2016 a las 10:21, Francisco Valentin Vinagrero escribi

  • Hi,

    Yes, we’re implementing the dialplan in realtime too.

    Here the contents of sorcery.conf:

    [res_pjsip]
    endpoint=realtime,ps_endpoints aor=realtime,ps_aors contact=realtime,ps_contacts

    [res_pjsip_endpoint_identifier_ip]
    identify=realtime,ps_endpoint_id_ips

    Cheers, Francisco.

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Annus Fictus Sent: 13 June 2016 14:11
    To: Asterisk Users Mailing List – Non-Commercial Discussion
    Subject: Re: [asterisk-users] PJSIP does not qualify contacts after starting Asterisk

    Hello Francisco,

    you have to use:

    extensions => odbc,asterisk

    only if you want use dialplan in Realtime

    can you share your sorcery.conf file?

    Regards El 13/06/2016 a las 10:21, Francisco Valentin Vinagrero escribi

  • Hello,

    in which moment Asterisk leave to qualify the realtime endpoint? When you restart Asterisk?

    On my asterisk 13.9.1, qualify on realtime endpoints works correctly. My sorcery.conf:

    [res_pjsip]
    endpoint=realtime,ps_endpoints endpoint=config,pjsip.conf,criteria=type=endpoint auth=realtime,ps_auths auth=config,pjsip.conf,criteria=type=auth aor=realtime,ps_aors aor=config,pjsip.conf,criteria=type=aor domain_alias=realtime,ps_domain_aliases domain_alias=config,pjsip.conf,criteria=type=domain_alias contact=realtime,ps_contacts contact=config,pjsip.conf,criteria=type=contact

    [res_pjsip_endpoint_identifier_ip]
    identify=realtime,ps_endpoint_id_ips identify=config,pjsip.conf,criteria=type=identify

    Regards

    El 13/06/2016 a las 14:16, Francisco Valentin Vinagrero escribi

  • Hi,

    So basically you’re doubling all the lines with a failover to the pjsip.conf file. What do you have in that file?

    For me it didn’t work. Whenever I add or update a contact in the ps_aors table, I get that the contacts are created but not qualified.

    Cheers, Francisco.

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Annus Fictus Sent: 13 June 2016 14:34
    To: Asterisk Users Mailing List – Non-Commercial Discussion
    Subject: Re: [asterisk-users] PJSIP does not qualify contacts after starting Asterisk

    Hello,

    in which moment Asterisk leave to qualify the realtime endpoint? When you restart Asterisk?

    On my asterisk 13.9.1, qualify on realtime endpoints works correctly. My sorcery.conf:

    [res_pjsip]
    endpoint=realtime,ps_endpoints endpoint=config,pjsip.conf,criteria=type=endpoint auth=realtime,ps_auths auth=config,pjsip.conf,criteria=type=auth aor=realtime,ps_aors aor=config,pjsip.conf,criteria=type=aor domain_alias=realtime,ps_domain_aliases domain_alias=config,pjsip.conf,criteria=type=domain_alias contact=realtime,ps_contacts contact=config,pjsip.conf,criteria=type=contact

    [res_pjsip_endpoint_identifier_ip]
    identify=realtime,ps_endpoint_id_ips identify=config,pjsip.conf,criteria=type=identify

    Regards

    El 13/06/2016 a las 14:16, Francisco Valentin Vinagrero escribi

  • pjsip realtime, especially related to contacts, has been worked on a bunch over the last few releases. Honestly I don’t remember what went into which release but do try 13.9.1 and let us know.

    You can also try using the following statements in sorcery.conf and see if it changes anything. Don’t use them in production because full_backend_cache and allow_unqualified_fetch have performance implications.

    aor/cache=memory_cache,maximum_objects=150,expire_on_reload=yes,object_lifetime_maximum=3600,full_backend_cache=yes aor=realtime,ps_aors,allow_unqualified_fetch=warn