# Paused vs In-a-Call using Dialplan Functions

**URL:** <https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893>\
**Category:** Asterisk Support\
**Created:** [February 27, 2020, 2:30pm UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893 "2020-02-27T14:30:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Test123](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Test123](https://community.asterisk.org/u/Test123)\
**Post date:** [February 27, 2020, 2:30pm UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/1 "2020-02-27T14:30:21Z")

</div>

System: Asterisk 15 and pjsip

Using Dialplan Functions, I am trying to distinguish between an agent being paused vs the agent actually being in a call. It appears that counts,statuses do not distinguish between this.  
Is there a way to do this within the dialplan?

Thank you

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [February 28, 2020, 3:07am UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/2 "2020-02-28T03:07:17Z")

</div>

> [@Test123](#):
>
> It appears that counts,statuses do not distinguish between

What do you exactly mean, are you using the asterisk queue app or a third party program  
Unless you’re using custom device state these are the posibles device state, I dont know Paused state

- UNKNOWN
- NOT\_INUSE
- INUSE
- BUSY
- INVALID
- UNAVAILABLE
- RINGING
- RINGINUSE
- ONHOLD

---

<div class="post-metadata">

**Author:** ![Test123](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Test123](https://community.asterisk.org/u/Test123)\
**Post date:** [February 28, 2020, 6:57pm UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/3 "2020-02-28T18:57:24Z")

</div>

Hello and thank you for your response.

I am currently using the Dialplan function QUEUE\_MEMBER and loop through all the agents to get logged, ready, free, and paused counts. The issue with this is that paused is set when agent is unavailable(paused), or in-a-call. I want to distinguish between just unavailable and in-a-call.  
I tried using the Dialplan function EXTENSION\_STATE, but it is returning a status of UNKNOWN for every agent.

Thank you

---

<div class="post-metadata">

**Author:** ![ambiorixg12](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/ambiorixg12/32/1887_2.png) [@ambiorixg12](https://community.asterisk.org/u/ambiorixg12)\
**Post date:** [February 29, 2020, 4:44am UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/4 "2020-02-29T04:44:17Z")

</div>

Try DEVICE\_STATE() function INUSE and UNAVAILABLE state should be returned dependng on the state of the device for your case

---

<div class="post-metadata">

**Author:** ![Test123](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@Test123](https://community.asterisk.org/u/Test123)\
**Post date:** [March 9, 2020, 11:08pm UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/5 "2020-03-09T23:08:28Z")

</div>

DEVICE\_STATE is returning “INVALID” for every agent (PJSIP/Agent); where Agent = member in QUEUE\_MEBER\_LIST and I’m not sure why. I know the members are correct because I see the agents in the QUEUE and the calls work. I just can’t get the Agents true status. i.e. are they really in a call.

Thank you,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [April 8, 2020, 11:08pm UTC](https://community.asterisk.org/t/paused-vs-in-a-call-using-dialplan-functions/82893/6 "2020-04-08T23:08:30Z")

</div>

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