[asterisk-users] Why is PQMSTATUS empty?

Louis Carreiro carreirolt at gmail.com
Thu May 5 20:20:40 CDT 2011


Hmmm.... I'll have to check that out tomorrow AM. So you're calling
PauseQueueMember() to actually pause the user first? Something like
PauseQueueMember(,${EXTEN})?

If the PQMSTATUS is "Success" instead of "Already Paused", wouldn't it
always respond with "Success" therefore not allowing the logic to continue?
v/r,
Me



On Thu, May 5, 2011 at 7:26 PM, Warren Selby <wcselby at selbytech.com> wrote:

> There may be a more elegant way to do it, but what I do is simply call
> PauseQueueMember() first, then check the result of PQMSTATUS. I forget the
> exact results but I think it's either 'Success' or 'Already Paused', and
> then I base my next step in logic based on that result.
>
> Thanks,
> --Warren Selby, dCAP
>
> On May 5, 2011, at 6:15 PM, Louis Carreiro < <carreirolt at gmail.com>
> carreirolt at gmail.com> wrote:
>
> Well that makes sense....
>
> Is there anyway to determine the user's state ([un]paused) in the dial plan
> prior to using the [Un]PauseQueueMember() app?
>
> I'd like to be able to keep it very simple for my users by instructing them
> to dial one key code to pause or unpause.
>
> v/r,
> Me
>
>
>
> On Thu, May 5, 2011 at 6:04 PM, Warren Selby < <wcselby at selbytech.com><wcselby at selbytech.com>
> wcselby at selbytech.com> wrote:
>
>> PQMSTATUS is set only after you run the application PauseQueueMember().
>>
>> Thanks,
>> --Warren Selby, dCAP
>>
>> On May 5, 2011, at 2:11 PM, Louis Carreiro < <carreirolt at gmail.com><carreirolt at gmail.com>
>> carreirolt at gmail.com> wrote:
>>
>> > Hey all!
>> >
>> > I'm trying to do a bit of logic here so that a user only has to dial one
>> code to pause/unpause in a queue (e.g. *0 will (un)pause depending on the
>> users's state). My logic looks fine to me but every time ${PQMSTATUS} shows
>> up empty.
>> >
>> > Here's the extensions.conf part....
>> >
>> > exten => *0,1,NoOp(${PQMSTATUS})
>> > exten => *0,n,Macro(user-callerid,SKIPTTL,)
>> > exten =>
>> *0,n,Set(CALLBACKNUM=${IF($[${LEN(${AMPUSER})}=0]?${CALLERID(number)}:${AMPUSER})})
>> > exten => *0,n,GotoIf($["${PQMSTATUS}" = "PAUSED"]?unpause,1:pause,1)
>> >
>> > ; Pause ourselves in one or more queues
>> > exten => pause,1,NoOp()
>> > exten => pause,n,PauseQueueMember(,Local/${CALLBACKNUM}@from-queue/n)
>> > exten => pause,n,PauseQueueMember(,Local/${CALLBACKNUM}@from-internal
>> /n)
>> > exten =>
>> pause,n,GoSub(changePauseStatus,start,1(PQMSTATUS,PAUSED,unavailable))
>> > exten => pause,n,Hangup()
>> >
>> > ; Unpause ourselves from one or more queues
>> > exten => unpause,1,NoOp()
>> > exten => unpause,n,PauseQueueMember(,Local/${CALLBACKNUM}@from-queue/n)
>> > exten => unpause,n,PauseQueueMember(,Local/${CALLBACKNUM}@from-internal
>> /n)
>> >
>>                         ;   that queue, otherwise, we'll unpause in
>> >
>>                         ;   in all queues
>> > exten =>
>> unpause,n,GoSub(changePauseStatus,start,1(UPQMSTATUS,UNPAUSED,available))
>>            ; use the changePauseStatus subroutine and
>> >
>>                         ;   pass the values for: variable to check,
>> >
>>                         ;   value to check for, and file to play
>> > exten => unpause,n,Hangup()
>> >
>> > ; ### Subroutine we use to check pausing and unpausing status ###
>> > [changePauseStatus]
>> > ; ARG1:  variable name to check, such as PQMSTATUS and UPQMSTATUS
>> (PauseQueueMemberStatus / UnpauseQueueMemberStatus)
>> > ; ARG2:  value to check for, such as PAUSED or UNPAUSED
>> > ; ARG3:  file to play back if our variable value matched the value to
>> check for
>> > ;
>> > exten => start,1,NoOp()
>> > exten => start,n,Playback(silence/1)
>> > ; Please note that ${ARG1} is wrapped in ${  } in order to expand the
>> value of ${ARG1} into
>> > ;   the variable we want to retrieve the value from, i.e. ${${ARG1}}
>> turns into ${PQMSTATUS}
>> > exten => start,n,Playback(${IF($["${${ARG1}}" =
>> "${ARG2}"]?${ARG3}:not-yet-connected)})
>> > ;exten => start,n,GotoIf($[${ISNULL(${xtn})}]?end)       ; if ${xtn} is
>> null, then just Return()
>> > exten => start,n,Playback(in-the-queue)                 ;   if not null,
>> then playback "in the queue"
>> > ;exten => start,n,SayNumber(${xtn})                      ;   and the
>> queue number that we (un)paused from
>> > exten => start,n(end),Return()                          ; return from
>> were we came
>> >
>> >
>> > v/r,
>> > Me
>> >
>> > --
>> > _____________________________________________________________________
>> > -- Bandwidth and Colocation Provided by <http://www.api-digital.com><http://www.api-digital.com>
>> http://www.api-digital.com --
>> > New to Asterisk? Join us for a live introductory webinar every Thurs:
>> >               <http://www.asterisk.org/hello><http://www.asterisk.org/hello>
>> http://www.asterisk.org/hello
>> >
>> > asterisk-users mailing list
>> > To UNSUBSCRIBE or update options visit:
>> >   <http://lists.digium.com/mailman/listinfo/asterisk-users><http://lists.digium.com/mailman/listinfo/asterisk-users>
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by <http://www.api-digital.com><http://www.api-digital.com>
>> http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>>               <http://www.asterisk.org/hello><http://www.asterisk.org/hello>
>> http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>>   <http://lists.digium.com/mailman/listinfo/asterisk-users><http://lists.digium.com/mailman/listinfo/asterisk-users>
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by <http://www.api-digital.com>
> http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                <http://www.asterisk.org/hello><http://www.asterisk.org/hello>
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    <http://lists.digium.com/mailman/listinfo/asterisk-users><http://lists.digium.com/mailman/listinfo/asterisk-users>
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110505/8eb7c64c/attachment-0001.htm>


More information about the asterisk-users mailing list