How to make an extension being reported as "busy" instead of "in use"?

All my extensions are reported as being in use instead of being busy via AMI action
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+ExtensionState and https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_PJSIPShowEndpoint and in FreePBX GUI http:///admin/config.php?display=asteriskinfo#peers

Regarding the first link, it should be reported as

  • in use if “One or more devices INUSE”
  • busy if “All devices BUSY”

I have two phones which register to the same PJSIP-Extension. I therefore set “Max Contacts = 2” and rebooted all and should be able to get “In use” if at least one phone is used and busy if both phones are used. In any case, i get “In Use”. I also checked another Extension with “Max Contacts = 1” and one registered phone and should report to be “Busy” AND “In Use”, but it doesn’t !?

I added the following to /etc/asterisk/pjsip.endpoint_custom.conf and reloaded asterisk, but it still reports in use.

[700]
device_state_busy_at=1

I also tried to add it to /etc/asterisk/pjsip.endpoint_custom_post.conf - same result. The AMI action https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerAction_PJSIPShowEndpoint also reports it to be in use instead of busy

What does the output of “pjsip show endpoint 700” on the CLI show?

user@freepbx:~$ sudo asterisk -rx "pjsip show endpoint 700"
[sudo] password for rkalusniok:

 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:  <ip/cidr.........................>
	Channel:  <ChannelId......................................>  <State.....>  <Time.....>
		Exten: <DialedExten...........>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Endpoint:  700/700                                                Not in use    0 of inf
	 InAuth:  700-auth/700
		Aor:  700                                                 2
	  Contact:  700/sip:700@192.168.0.89:5060;uniq=1B8F9773F4 8f897f2231 Avail        16.181
	  Contact:  700/sip:700@192.168.0.88:5060;uniq=A626961CB7 f137513efc Avail        11.353
   Identify:  700-identify/700


 ParameterName                      : ParameterValue
 =========================================================
 100rel                             : yes
 accountcode                        :
 aggregate_mwi                      : true
 allow                              : (alaw|ulaw|gsm|g729)
 allow_subscribe                    : true
 allow_transfer                     : true
 aors                               : 700
 auth                               : 700-auth
 bind_rtp_to_media_address          : false
 call_group                         :
 callerid                           : "device" <700>
 callerid_privacy                   : allowed_not_screened
 callerid_tag                       :
 connected_line_method              : invite
 context                            : from-internal
 cos_audio                          : 0
 cos_video                          : 0
 device_state_busy_at               : 0
 direct_media                       : true
 direct_media_glare_mitigation      : none
 direct_media_method                : invite
 disable_direct_media_on_nat        : false
 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
 force_avp                          : false
 force_rport                        : true
 from_domain                        :
 from_user                          :
 g726_non_standard                  : false
 ice_support                        : false
 identify_by                        : username
 inband_progress                    : false
 language                           : de
 mailboxes                          :
 media_address                      :
 media_encryption                   : no
 media_encryption_optimistic        : false
 media_use_received_transport       : false
 message_context                    :
 moh_suggest                        : default
 mwi_from_user                      :
 mwi_subscribe_replaces_unsolicited : false
 named_call_group                   :
 named_pickup_group                 :
 one_touch_recording                : false
 outbound_auth                      :
 outbound_proxy                     :
 pickup_group                       :
 record_off_feature                 : automixmon
 record_on_feature                  : automixmon
 rewrite_contact                    : true
 rpid_immediate                     : 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_diversion                     : true
 send_pai                           : false
 send_rpid                          : false
 set_var                            :
 srtp_tag_32                        : false
 sub_min_expiry                     : 0
 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                          :
 trust_id_inbound                   : true
 trust_id_outbound                  : false
 use_avpf                           : false
 use_ptime                          : false
 user_eq_phone                      : false
 voicemail_extension                :

Your configuration change did not get included in the definition of the endpoint, so it’s still set to 0. I’m unfamiliar with how FreePBX stores things and the best way to make the change.

Ahh i see, device_state_busy_at is still zero. So i read a little bit more and found out it’s a general issue with freepbx or the inflexibility of pjsip.conf to split settings for one endpoint into several conf files (which freepbx needs): http://issues.freepbx.org/browse/FREEPBX-12603

Thank you for pointing that out.