Agents stay "In Use" after transferring call

I have 4 queues that share agents, when an agent transfers a caller to another party(extension or outbound call) and disconnect there State stays as “In Use” (no longer with the “In a Call” flag) until the transferred call is hung up and they cannot receive new calls.

Asterisk Version Previously 13.18.3 on Ubuntu 18.04 now upgraded to 16.2.1 on Ubuntu 20.04, problem persisted after upgrade.
I saw posts about previous bugs reported that were resolved in certain versions but was caused by wrapup time being other 0. I have changed wrapup time to 0 on all queues and that did not resolved the issue so I turned it back to 30 after upgrading as to not cause burden on the agents.

Agents are added to queues dynamically and are using PJSIP

Settings and specific pieces of the dialplan below with personal info altered

Queue Settings:
wrapuptime = 30
ringinuse = no
strategy = rmemory

Dialplan to add calling users to Queue

[queues]
exten =>1111,1,Verbose(2, --> Entering the {thisQueue} queue) same => n,Answer same => n,Ringing same => n,Wait(2) same => n,Playback(recording1) same => n,Playback(recording2) same => n,Set(MONITOR_FILENAME={STRFTIME({EPOCH},,%d%m%Y-%H%M%S)}.In.{caller}.{EXTEN}) same => n,Set(CALL_DIRECTION=inbound) same => n,MixMonitor({MONITOR_FILENAME}.wav,/var/lib/asterisk/script.py {MONITOR_FILENAME}.wav {UNIQUEID} ^{CALL_DIRECTION})
same => n,Queue(${thisQueue})
same => n,StopMixMonitor()
same => n,Wait(2)
same => n,Voicemail(1111@default)
same => n,Hangup()

[internal] Extension Dialing

exten => _X.,1,Set(__DYNAMIC_FEATURES=featureA#featureB)
same => n,Dial(PJSIP/{EXTEN},30,T) same => n,Voicemail({EXTEN},30,T)
same => n,Hangup()

[outbound]
exten => _X.,1,Set(caller={CALLERID(num)}) exten => _X.,n,Set(CALLERID(num)=5555555555) exten => _X.,n,Set(CALLERID(name)="Our Org") exten => _X.,n,Dial(PJSIP/{caller}/sip:${EXTEN}@X.X.X.X:5060)
same => n,StopMixMonitor()
same => n,Hangup()

Thank you in advance for any help!

Are you using a local channel between the queue and the agent. This was always a problem when using agent channels, as the transfer didn’t remove the agent channel from the queue. I’d expect the same if you are using a local channel. I think the old way out was to add a local channel upstream of the queue, but I don’t think that works with SIP native transfers.

Also please note that there are several ways in which a transfer may be initiated, and there are often subtle differences in the result.

Also please note that dialplan (and logs) should always be marked up as preformatted text, when posting them to the forum.

We are not using local channels. Agents are joining the queue as PJSIP/Exten and not using Local channel when calling the number to transfer to.

Agents are doing attended transfers via the GUI of the softphone client they are using (Microsip).

I will make sure to use preformatted text for that text in the future.

I would suggest providing actual console output of this occurring and the configuration.

Here is some CLI output fromt his morning. Agent5 received a call in queue3, displays as “(in call)(In use)”, agent5 made an outbound call to another party to transfer to, agent5 did attended transfer, agent5 still shows “(In use)”

ASTERISK-1*CLI> queue show
queue1 has 0 calls (max unlimited) in 'rrmemory' strategy (32s holdtime, 9s talktime), W:0, C:1, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken 1 calls (last was 5132 secs ago)
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers

queue2 has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers

queue3 has 0 calls (max unlimited) in 'rrmemory' strategy (7s holdtime, 157s talktime), W:0, C:29, A:1, SL:0.0%, SL2:3.3% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken 6 calls (last was 754 secs ago)
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken 3 calls (last was 637 secs ago)
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken 3 calls (last was 308 secs ago)
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken 12 calls (last was 96 secs ago)
      PJSIP/agent5 (ringinuse disabled) (dynamic) (in call) (In use) has taken 5 calls (last was 476 secs ago)
   No Callers

queue4 has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers


ASTERISK-1*CLI> pjsip show channels

  Channel:  <ChannelId........................................>  <State.....>  <Time.....>
      Exten: <DialedExten.............>  CLCID: <ConnectedLineCID.......>
==========================================================================================

  Channel: PJSIP/agent5-00000311/AppQueue                          Up            00:01:20
      Exten: 1111                        CLCID: "WIRELESS CALLER" <XXXXXXXXXX>

  Channel: PJSIP/att-00000310/Queue                              Up            00:01:28
      Exten: 1111                        CLCID: "agent5" <XXXXXXXXXX>


ASTERISK-1*CLI> pjsip show channels

  Channel:  <ChannelId........................................>  <State.....>  <Time.....>
      Exten: <DialedExten.............>  CLCID: <ConnectedLineCID.......>
==========================================================================================

  Channel: PJSIP/agent5-00000311/AppQueue                          Up            00:02:10
      Exten: 1111                        CLCID: "WIRELESS CALLER" <XXXXXXXXXX>

  Channel: PJSIP/agent5-00000312/Dial                              Up            00:00:41
      Exten: XXXXXXXXXX                  CLCID: "" <XXXXXXXXXX>

  Channel: PJSIP/agent5-00000313/AppDial                           Up            00:00:41
      Exten:                             CLCID: ""Our Org"" <XXXXXXXXXX>

  Channel: PJSIP/att-00000310/Queue                              Up            00:02:18
      Exten: 1111                        CLCID: "agent5" <XXXXXXXXXX>



ASTERISK-1*CLI> queue show
queue1 has 0 calls (max unlimited) in 'rrmemory' strategy (32s holdtime, 9s talktime), W:0, C:1, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken 1 calls (last was 5271 secs ago)
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers

queue2 has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers

queue3 has 0 calls (max unlimited) in 'rrmemory' strategy (7s holdtime, 152s talktime), W:0, C:30, A:1, SL:0.0%, SL2:3.2% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken 6 calls (last was 893 secs ago)
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken 3 calls (last was 776 secs ago)
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken 3 calls (last was 447 secs ago)
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken 12 calls (last was 235 secs ago)
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken 6 calls (last was 12 secs ago)
   No Callers

queue4 has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:0, SL:0.0%, SL2:0.0% within 0s
   Members:
      PJSIP/agent1 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent2 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent3 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent4 (ringinuse disabled) (dynamic) (Not in use) has taken no calls yet
      PJSIP/agent5 (ringinuse disabled) (dynamic) (In use) has taken no calls yet
   No Callers

ASTERISK-1*CLI> pjsip show channels

  Channel:  <ChannelId........................................>  <State.....>  <Time.....>
      Exten: <DialedExten.............>  CLCID: <ConnectedLineCID.......>
==========================================================================================

  Channel: PJSIP/agent5-00000313/AppDial                           Up            00:01:13
      Exten:                             CLCID: "WIRELESS CALLER" <XXXXXXXXXX>

  Channel: PJSIP/att-00000310/Queue                              Up            00:02:50
      Exten: 5501                        CLCID: "" <XXXXXXXXXX>


Objects found: 2


We are using realtime to configure queues and endpoints.
Here is all queue config:

+-------------+-------------+----------+-----------------+---------+-----------+-----------------+-------------+------------------+----------------+-------------+-------------+------------------+----------------+--------------------+-----------------+-----------------+----------------+---------------+--------------+---------------+----------------+----------------------+------------------+--------------------+------------------------+------------------------+------------------------+-------------------+-------------------+-------------------------+-------------------+-----------------------------+----------------------------+--------------------------+-------+------------+---------------------+----------+--------------+-----------+----------------+---------------+------------------+--------+--------------+----------+-----------+----------------+----------------+-------------+--------+----------------+-------------+-----------------+
| name        | musiconhold | announce | context         | timeout | ringinuse | setinterfacevar | setqueuevar | setqueueentryvar | monitor_format | membermacro | membergosub | queue_youarenext | queue_thereare | queue_callswaiting | queue_quantity1 | queue_quantity2 | queue_holdtime | queue_minutes | queue_minute | queue_seconds | queue_thankyou | queue_callerannounce | queue_reporthold | announce_frequency | announce_to_first_user | min_announce_frequency | announce_round_seconds | announce_holdtime | announce_position | announce_position_limit | periodic_announce | periodic_announce_frequency | relative_periodic_announce | random_periodic_announce | retry | wrapuptime | penaltymemberslimit | autofill | monitor_type | autopause | autopausedelay | autopausebusy | autopauseunavail | maxlen | servicelevel | strategy | joinempty | leavewhenempty | reportholdtime | memberdelay | weight | timeoutrestart | defaultrule | timeoutpriority |
+-------------+-------------+----------+-----------------+---------+-----------+-----------------+-------------+------------------+----------------+-------------+-------------+------------------+----------------+--------------------+-----------------+-----------------+----------------+---------------+--------------+---------------+----------------+----------------------+------------------+--------------------+------------------------+------------------------+------------------------+-------------------+-------------------+-------------------------+-------------------+-----------------------------+----------------------------+--------------------------+-------+------------+---------------------+----------+--------------+-----------+----------------+---------------+------------------+--------+--------------+----------+-----------+----------------+----------------+-------------+--------+----------------+-------------+-----------------+
| queue3 | NULL        | yes      | queue_voicemail |      15 | no        | NULL            | NULL        | NULL             | NULL           | NULL        | NULL        | NULL             | queue-thereare | NULL               | NULL            | NULL            | NULL           | NULL          | NULL         | NULL          | NULL           | NULL                 | NULL             |                 30 | NULL                   |                   NULL |                   NULL | NULL              | NULL              |                    NULL | callback      |                          25 | NULL                       | NULL                     |     4 |         30 |                NULL | NULL     | NULL         | NULL      |           NULL | NULL          | NULL             |   NULL |         NULL | rrmemory | loose     | loose          | NULL           |        NULL |   NULL | NULL           | NULL        | NULL            |
| queue4 | NULL        | yes      | queue_voicemail |      15 | no        | NULL            | NULL        | NULL             | NULL           | NULL        | NULL        | NULL             | queue-thereare | NULL               | NULL            | NULL            | NULL           | NULL          | NULL         | NULL          | NULL           | NULL                 | NULL             |                 30 | NULL                   |                   NULL |                   NULL | NULL              | NULL              |                    NULL | callback      |                          25 | NULL                       | NULL                     |     4 |         30 |                NULL | NULL     | NULL         | NULL      |           NULL | NULL          | NULL             |   NULL |         NULL | rrmemory | loose     | loose          | NULL           |        NULL |   NULL | NULL           | NULL        | NULL            |
| queue1 | NULL        | yes      | queue_voicemail |      15 | no        | NULL            | NULL        | NULL             | NULL           | NULL        | NULL        | NULL             | queue-thereare | NULL               | NULL            | NULL            | NULL           | NULL          | NULL         | NULL          | NULL           | NULL                 | NULL             |                 30 | NULL                   |                   NULL |                   NULL | NULL              | NULL              |                    NULL | callback      |                          25 | NULL                       | NULL                     |     4 |         30 |                NULL | NULL     | NULL         | NULL      |           NULL | NULL          | NULL             |   NULL |         NULL | rrmemory | loose     | loose          | NULL           |        NULL |   NULL | NULL           | NULL        | NULL            |
| queue2 | NULL        | yes      | queue_voicemail |      15 | no        | NULL            | NULL        | NULL             | NULL           | NULL        | NULL        | NULL             | queue-thereare | NULL               | NULL            | NULL            | NULL           | NULL          | NULL         | NULL          | NULL           | NULL                 | NULL             |                 30 | NULL                   |                   NULL |                   NULL | NULL              | NULL              |                    NULL | callback      |                          25 | NULL                       | NULL                     |     4 |         30 |                NULL | NULL     | NULL         | NULL      |           NULL | NULL          | NULL             |   NULL |         NULL | rrmemory | loose     | loose          | NULL           |        NULL |   NULL | NULL           | NULL        | NULL            |
+-------------+-------------+----------+-----------------+---------+-----------+-----------------+-------------+------------------+----------------+-------------+-------------+------------------+----------------+--------------------+-----------------+-----------------+----------------+---------------+--------------+---------------+----------------+----------------------+------------------+--------------------+------------------------+------------------------+------------------------+-------------------+-------------------+-------------------------+-------------------+-----------------------------+----------------------------+--------------------------+-------+------------+---------------------+----------+--------------+-----------+----------------+---------------+------------------+--------+--------------+----------+-----------+----------------+----------------+-------------+--------+----------------+-------------+-----------------+

Here is the pjsip endpoint configs for agent5

+------+-----------+------+------+---------+----------+---------------------+--------------+-----------------------+---------------------+-------------------------------+-----------------------------+-----------+------------------------+-------------+-------------+-------------+-----------+-------------+---------------+----------------+-----------------+----------+---------------+----------------+----------+-----------+---------------+--------+---------------------+---------------+------------------+--------------+--------+---------------+------------------+-------------------+-----------+----------+------------------+-----------------+------------+--------------+------------------+--------------------+----------------------+------------+-----------+--------------+-----------------------+---------------+----------------+-----------+----------+---------------------+-------------------+--------------------+------------+----------------+-----------------+-----------+-------------+-----------+-----------+----------------+-------------+-----------+---------------+-------------+------------+----------------+------------------+-------------+--------------+--------------+------------+-------------+---------------+-----------------+---------+-----------+-----------------+-----------+------------------------------+-------------+---------------+-----------------+-----------------------------+----------------+-------------------+---------------+-------------+------------------+---------------------------+---------------------+------------------------------------+------+--------+------+--------------+----------------+-------------+-------------------+--------------------+--------------+----------------------+----------+---------------+----------------------+----------------------------+------------------+----------------------+
| id   | transport | aors     | auth   | context | disallow | allow               | direct_media | connected_line_method | direct_media_method | direct_media_glare_mitigation | disable_direct_media_on_nat | dtmf_mode | external_media_address | force_rport | ice_support | identify_by | mailboxes | moh_suggest | outbound_auth | outbound_proxy | rewrite_contact | rtp_ipv6 | rtp_symmetric | send_diversion | send_pai | send_rpid | timers_min_se | timers | timers_sess_expires | callerid      | callerid_privacy | callerid_tag | 100rel | aggregate_mwi | trust_id_inbound | trust_id_outbound | use_ptime | use_avpf | media_encryption | inband_progress | call_group | pickup_group | named_call_group | named_pickup_group | device_state_busy_at | fax_detect | t38_udptl | t38_udptl_ec | t38_udptl_maxdatagram | t38_udptl_nat | t38_udptl_ipv6 | tone_zone | language | one_touch_recording | record_on_feature | record_off_feature | rtp_engine | allow_transfer | allow_subscribe | sdp_owner | sdp_session | tos_audio | tos_video | sub_min_expiry | from_domain | from_user | mwi_from_user | dtls_verify | dtls_rekey | dtls_cert_file | dtls_private_key | dtls_cipher | dtls_ca_file | dtls_ca_path | dtls_setup | srtp_tag_32 | media_address | redirect_method | set_var | cos_audio | message_context | force_avp | media_use_received_transport | accountcode | user_eq_phone | moh_passthrough | media_encryption_optimistic | rpid_immediate | g726_non_standard | rtp_keepalive | rtp_timeout | rtp_timeout_hold | bind_rtp_to_media_address | voicemail_extension | mwi_subscribe_replaces_unsolicited | deny | permit | acl  | contact_deny | contact_permit | contact_acl | subscribe_context | fax_detect_timeout | contact_user | asymmetric_rtp_codec | rtcp_mux | allow_overlap | refer_blind_progress | notify_early_inuse_ringing | dtls_fingerprint | incoming_mwi_mailbox |
+------+-----------+------+------+---------+----------+---------------------+--------------+-----------------------+---------------------+-------------------------------+-----------------------------+-----------+------------------------+-------------+-------------+-------------+-----------+-------------+---------------+----------------+-----------------+----------+---------------+----------------+----------+-----------+---------------+--------+---------------------+---------------+------------------+--------------+--------+---------------+------------------+-------------------+-----------+----------+------------------+-----------------+------------+--------------+------------------+--------------------+----------------------+------------+-----------+--------------+-----------------------+---------------+----------------+-----------+----------+---------------------+-------------------+--------------------+------------+----------------+-----------------+-----------+-------------+-----------+-----------+----------------+-------------+-----------+---------------+-------------+------------+----------------+------------------+-------------+--------------+--------------+------------+-------------+---------------+-----------------+---------+-----------+-----------------+-----------+------------------------------+-------------+---------------+-----------------+-----------------------------+----------------+-------------------+---------------+-------------+------------------+---------------------------+---------------------+------------------------------------+------+--------+------+--------------+----------------+-------------+-------------------+--------------------+--------------+----------------------+----------+---------------+----------------------+----------------------------+------------------+----------------------+
| agent5 | NULL    | agent5   | agent5 | agent   | all      | g729,ulaw,t140,h264 | no           | NULL                  | NULL                | NULL                          | NULL                        | NULL      | NULL                   | NULL        | NULL        | NULL        | NULL      | NULL        | NULL          | NULL           | yes             | NULL     | NULL          | NULL           | NULL     | NULL      |          NULL | NULL   |                NULL | a | NULL             | NULL         | NULL   | NULL          | NULL             | NULL              | NULL      | NULL     | NULL             | NULL            | NULL       | NULL         | NULL             | NULL               |                 NULL | NULL       | NULL      | NULL         |                  NULL | NULL          | NULL           | NULL      | NULL      | NULL                           | NULL              | NULL               | NULL       | NULL           | NULL            | NULL      | NULL        | NULL      | NULL      |           NULL | NULL        | NULL      | NULL          | NULL        | NULL       | NULL           | NULL             | NULL        | NULL         | NULL         | NULL       | NULL        | NULL          | NULL            | NULL    |      NULL | chat            | NULL      | yes                          | NULL        | NULL          | NULL            | NULL                        | NULL           | NULL              |          NULL |        NULL |             NULL | NULL                      | NULL                |                               NULL | NULL | NULL   | NULL | NULL         | NULL           | NULL        | hint              |               NULL | NULL         | NULL                 | NULL     | NULL          | NULL                 | NULL                       | NULL             | NULL                 |
+------+-----------+------+------+---------+----------+---------------------+--------------+-----------------------+---------------------+-------------------------------+-----------------------------+-----------+------------------------+-------------+-------------+-------------+-----------+-------------+---------------+----------------+-----------------+----------+---------------+----------------+----------+-----------+---------------+--------+---------------------+---------------+------------------+--------------+--------+---------------+------------------+-------------------+-----------+----------+------------------+-----------------+------------+--------------+------------------+--------------------+----------------------+------------+-----------+--------------+-----------------------+---------------+----------------+-----------+----------+---------------------+-------------------+--------------------+------------+----------------+-----------------+-----------+-------------+-----------+-----------+----------------+-------------+-----------+---------------+-------------+------------+----------------+------------------+-------------+--------------+--------------+------------+-------------+---------------+-----------------+---------+-----------+-----------------+-----------+------------------------------+-------------+---------------+-----------------+-----------------------------+----------------+-------------------+---------------+-------------+------------------+---------------------------+---------------------+------------------------------------+------+--------+------+--------------+----------------+-------------+-------------------+--------------------+--------------+----------------------+----------+---------------+----------------------+----------------------------+------------------+----------------------+

And the output of “core show channels”? As it stands they still appear to have a channel up, thus it would be expected to be in use.

I did not do a core show channels when that event was happening but here is an output of core show channels while agent2 is showing as in use

ASTERISK-1*CLI> core show channels
Channel              Location             State   Application(Data)
PJSIP/agent2-00000372  (None)               Up      AppDial((Outgoing Line))
PJSIP/att-00000373   1111@queues:10       Up      Queue(queue3)
PJSIP/att-0000036a   1111@queues:10       Up      Queue(queue3)
PJSIP/agent5-00000375  1111@agent:1           Up      AppQueue((Outgoing Line))
4 active channels
2 active calls
515 calls processed

The channel is up because the call is still on-going. I get that the channel being associated with the agent is what is causing them to be in use but how do I fix that so the transferred call no longer associates the agent with the channel?

You can’t, because to the system the endpoint is still in use as it has a channel and I’m not sure a transfer, to the perspective of Asterisk, has actually occurred. Normally in an attended transfer the channels will go away from the endpoint that has completed the attended transfer.

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