Device is registered as Contact, but is not registered as Endpoint in realtime ODBC

Hi, we suffered following problem when we use PJSIP realtime ODBC(mysql) registration.

  • PJSIP realtime.
  • We registered the endpoint record to Asterisk by ODBC method (insert record to ps_endpoints, ps_aors, and ps_auths tables).

By using the Zoiper Android client(free version), the Asterisk can’t recognize the account as Endpoint. It regards as Contact. If the endpoint can’t recognize it as Endpoint, we can’t get online/offline status by ARI(/endpoints).

logs:

    -- Added contact 'sip:xxxxxxxxxxxxxx@xxx.xxx.xxx.xxx:11302;rinstance=97589d0f3fea3491' to AOR 'xxxxxxxxxxxxxx' with expiration of 60 seconds
    -- Removed contact 'sip:xxxxxxxxxxxxxx@xxx.xxx.xxx.xxx:11302;rinstance=97589d0f3fea3491' from AOR 'xxxxxxxxxxxxxx' due to request
    -- Added contact 'sip:xxxxxxxxxxxxxx@xxx.xxx.xxx.xxx:11302;rinstance=f2eb3c47e6e01257' to AOR 'xxxxxxxxxxxxxx' with expiration of 60 seconds

No Endpoint xxxxxxxxxxxxxx is now Reachable log here!

I found something interesting

  1. If we use the Zoiper iPhone client or the Zoiper Mac client, the phenomenon not happened(Asterisk regards the device as Endpoint). I checked the differences between Android and other clients using debug mode, but I couldn’t find any differences.
  2. If we type pjsip reload or restart asterisk, the Android client was regarded as Endpoint.

So, my questions are

  • Do you know how to solve this problem?
  • Are there any other solutions to detect device status(online/offline status)

settings

 ParameterName                              : ParameterValue
 ======================================================================
 contact_expiration_check_interval          : 30
 debug                                      : no
 default_from_user                          : asterisk
 default_outbound_endpoint                  : default_outbound_endpoint
 default_realm                              : asterisk
 default_voicemail_extension                :
 disable_multi_domain                       : false
 endpoint_identifier_order                  : ip,username,anonymous
 ignore_uri_user_options                    : false
 keep_alive_interval                        : 90
 max_forwards                               : 70
 max_initial_qualify_time                   : 0
 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 18.2.0

System Settings:

 ParameterName               : ParameterValue
 ============================================
 accept_multiple_sdp_answers : false
 compact_headers             : false
 disable_rport               : false
 disable_tcp_switch          : true
 follow_early_media_fork     : true
 threadpool_auto_increment   : 5
 threadpool_idle_timeout     : 60
 threadpool_initial_size     : 0
 threadpool_max_size         : 50
 timer_b                     : 32000
 timer_t1                    : 500
  • we also checked the version Astertisk 16 but same result.

You’ve provided a small bit of logging. After you believe the device is registered what is the output of “pjsip show endpoints” and “pjsip show contacts”? If you don’t use realtime what happens?

Thanks for your comment and sorry about lacking information

1. “pjsip show endpoints” (realtime ODBC mysql)

before connect the device from zoiper client

 Endpoint:  11000000000000032                                    Unavailable   0 of inf
     InAuth:  11000000000000032/11000000000000032
        Aor:  11000000000000032                                  2
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

after connect the device from zoiper client(not Endpoint so status is Unavailable)

 Endpoint:  11000000000000032                                    Unavailable   0 of inf
     InAuth:  11000000000000032/11000000000000032
        Aor:  11000000000000032                                  2
      Contact:  11000000000000032/sip:11000000000000032@10 74f71b3d17 NonQual         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

while telephoning(the device is able to call even the status is Unavailable)

 Endpoint:  11000000000000034                                    In use        1 of inf
     InAuth:  11000000000000034/11000000000000034
        Aor:  11000000000000034                                  2
      Contact:  11000000000000034/sip:11000000000000034@10 239164e147 NonQual         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060
    Channel: PJSIP/11000000000000034-0000000b/AppDial            Up            00:00:18
        Exten:                           CLCID: "" <11000000000000030>
  • after finishing the phone call, the status become Unavailable again even the device is connected as contact.

after execute pjsip reload (status is Not in use. works well)

 Endpoint:  11000000000000032                                    Not in use    0 of inf
     InAuth:  11000000000000032/11000000000000032
        Aor:  11000000000000032                                  2
      Contact:  11000000000000032/sip:11000000000000032@10 74f71b3d17 NonQual         nan
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060

2. “pjsip show contacts” (realtime ODBC mysql)

before connect the device from zoiper client

  • no contact data

after connect the device from zoiper client

  Contact:  <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================
  Contact:  11000000000000032/sip:11000000000000032@xxx.xx 74f71b3d17 NonQual         nan

after execute pjsip reload

  Contact:  <Aor/ContactUri..............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

  Contact:  11000000000000032/sip:11000000000000032@xxx.xx 74f71b3d17 NonQual         nan

3. If I use pjsip.conf for registering endpoint(not realtime)

before connect the device from zoiper client

 Endpoint:  6001                                                 Unavailable   0 of inf
     InAuth:  6001/6001
        Aor:  6001                                              10

after connect the device from zoiper client(status is Not in use. works well)

 Endpoint:  6001                                                 Not in use    0 of inf
     InAuth:  6001/6001
        Aor:  6001                                              10
      Contact:  6001/sip:6001@106.73.2.65:11302;rinstance= 9ceabcfc3e NonQual         nan

So, if we use pjsip.conf, it works well even if I use android zoiper client. so the problem is realtime(mysql ODBC) with Android Zoiper client I guess.

Other Logs, Settigns:

pjsip reload log

Module 'res_pjsip.so' reloaded successfully.
Module 'res_pjsip_authenticator_digest.so' reloaded successfully.
Module 'res_pjsip_endpoint_identifier_ip.so' reloaded successfully.
Module 'res_pjsip_mwi.so' reloaded successfully.
Module 'res_pjsip_notify.so' reloaded successfully.
Module 'res_pjsip_outbound_publish.so' reloaded successfully.
Module 'res_pjsip_publish_asterisk.so' reloaded successfully.
Module 'res_pjsip_outbound_registration.so' reloaded successfully.
    -- Reloading module 'res_pjsip.so' (Basic SIP resource)
[2021-01-26 01:43:11] NOTICE[26684]: sorcery.c:1345 sorcery_object_load: Type 'system' is not reloadable, maintaining previous values
  == Endpoint 11000000000000032 is now Reachable
    -- Reloading module 'res_pjsip_authenticator_digest.so' (PJSIP authentication resource)
    -- Reloading module 'res_pjsip_endpoint_identifier_ip.so' (PJSIP IP endpoint identifier)
    -- Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource)
    -- Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support)
    -- Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support)
    -- Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support)
    -- Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support)
  • while pjsip reloading res_pjsip.so, Endpoint 11000000000000032 is now Reachable log is comming.

Endpoint setting detail

pjsip show endpoint 11000000000000032

 Endpoint:  <Endpoint/CID.....................................>  <State.....>  <Channels.>
    I/OAuth:  <AuthId/UserName...........................................................>
        Aor:  <Aor............................................>  <MaxContact>
      Contact:  <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
  Transport:  <TransportId........>  <Type>  <cos>  <tos>  <BindAddress..................>
   Identify:  <Identify/Endpoint.........................................................>
        Match:  <criteria.........................>
    Channel:  <ChannelId......................................>  <State.....>  <Time.....>
        Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  11000000000000032                                    Unavailable   0 of inf
     InAuth:  11000000000000032/11000000000000032
        Aor:  11000000000000032                                  2
  Transport:  transport-udp             udp      0      0  0.0.0.0:5060


 ParameterName                      : ParameterValue
 ===================================================================================================
 100rel                             : yes
 accept_multiple_sdp_answers        : false
 accountcode                        :
 acl                                :
 aggregate_mwi                      : true
 allow                              : (speex|ulaw)
 allow_overlap                      : true
 allow_subscribe                    : true
 allow_transfer                     : true
 aors                               : 11000000000000032
 asymmetric_rtp_codec               : false
 auth                               : 11000000000000032
 bind_rtp_to_media_address          : false
 bundle                             : false
 call_group                         :
 callerid                           : <unknown>
 callerid_privacy                   : allowed_not_screened
 callerid_tag                       :
 codec_prefs_incoming_answer        : prefer:pending, operation:intersect, keep:all, transcode:allow
 codec_prefs_incoming_offer         : prefer:pending, operation:intersect, keep:all, transcode:allow
 codec_prefs_outgoing_answer        : prefer:pending, operation:intersect, keep:all, transcode:allow
 codec_prefs_outgoing_offer         : prefer:pending, operation:union, keep:all, transcode:allow
 connected_line_method              : invite
 contact_acl                        :
 context                            : rc_user
 cos_audio                          : 0
 cos_video                          : 0
 device_state_busy_at               : 0
 direct_media                       : false
 direct_media_glare_mitigation      : none
 direct_media_method                : invite
 disable_direct_media_on_nat        : false
 dtls_auto_generate_cert            : No
 dtls_ca_file                       :
 dtls_ca_path                       :
 dtls_cert_file                     :
 dtls_cipher                        :
 dtls_fingerprint                   : SHA-256
 dtls_private_key                   :
 dtls_rekey                         : 0
 dtls_setup                         : active
 dtls_verify                        : No
 dtmf_mode                          : rfc4733
 fax_detect                         : false
 fax_detect_timeout                 : 0
 follow_early_media_fork            : true
 force_avp                          : false
 force_rport                        : true
 from_domain                        :
 from_user                          :
 g726_non_standard                  : false
 ice_support                        : false
 identify_by                        : username,ip
 ignore_183_without_sdp             : false
 inband_progress                    : false
 incoming_call_offer_pref           : local
 incoming_mwi_mailbox               :
 language                           :
 mailboxes                          :
 max_audio_streams                  : 1
 max_video_streams                  : 1
 media_address                      :
 media_encryption                   : no
 media_encryption_optimistic        : false
 media_use_received_transport       : false
 message_context                    :
 moh_passthrough                    : false
 moh_suggest                        : default
 mwi_from_user                      :
 mwi_subscribe_replaces_unsolicited : no
 named_call_group                   :
 named_pickup_group                 :
 notify_early_inuse_ringing         : false
 one_touch_recording                : false
 outbound_auth                      :
 outbound_proxy                     :
 outgoing_call_offer_pref           : remote_merge
 pickup_group                       :
 preferred_codec_only               : false
 record_off_feature                 : automixmon
 record_on_feature                  : automixmon
 refer_blind_progress               : true
 rewrite_contact                    : true
 rpid_immediate                     : false
 rtcp_mux                           : false
 rtp_engine                         : asterisk
 rtp_ipv6                           : false
 rtp_keepalive                      : 0
 rtp_symmetric                      : true
 rtp_timeout                        : 0
 rtp_timeout_hold                   : 0
 sdp_owner                          : -
 sdp_session                        : Asterisk
 send_connected_line                : yes
 send_diversion                     : true
 send_history_info                  : false
 send_pai                           : false
 send_rpid                          : false
 set_var                            :
 srtp_tag_32                        : false
 stir_shaken                        : false
 sub_min_expiry                     : 0
 subscribe_context                  :
 suppress_q850_reason_headers       : false
 t38_udptl                          : false
 t38_udptl_ec                       : none
 t38_udptl_ipv6                     : false
 t38_udptl_maxdatagram              : 0
 t38_udptl_nat                      : false
 timers                             : yes
 timers_min_se                      : 90
 timers_sess_expires                : 1800
 tone_zone                          :
 tos_audio                          : 0
 tos_video                          : 0
 transport                          : transport-udp
 trust_connected_line               : yes
 trust_id_inbound                   : false
 trust_id_outbound                  : false
 use_avpf                           : false
 use_ptime                          : false
 user_eq_phone                      : false
 voicemail_extension                :
 webrtc                             : no

transport-udp

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
local_net=172.31.0.0/16
external_media_address=xx.xx.xx.xx 
external_signaling_address=xx.xx.xx.xx

If it works with pjsip.conf and not realtime, then that would be a bug and should be reported with specific instructions for reproducing it[1]. In fact this sounds the same as Pjsip endpoint with realtime become unavailable

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.