py-asterisk icon indicating copy to clipboard operation
py-asterisk copied to clipboard

QueuePause action impossible to unpause

Open Briareos12 opened this issue 7 years ago • 5 comments

Hello,

You need to remove 'and 'true' or 'false'' like below to allow unpause action :

def QueuePause(self, queue, interface, paused):
     'Pause <interface> in <queue>.'

     id = self._write_action('QueuePause', {
         'Queue': queue,
         'Interface': interface,
         'Paused': paused 
     })

Briareos12 avatar Jul 01 '19 15:07 Briareos12

Hi,

Why ? Don't you enjoy to use a python boolean ?

Jean

Le lundi 01 juillet 2019 à 08:06 -0700, Briareos12 a écrit :

Hello, You need to remove 'and 'true' or 'false'' like below to allow unpause action : def QueuePause(self, queue, interface, paused): 'Pause in .'

 id = self._write_action('QueuePause', {
     'Queue': queue,
     'Interface': interface,
     'Paused': paused 
 })

-- Jean Schurger [email protected] | http://schurger.org GPG: 21D0 4702 758D 5656 C0D6 3288 1609 9E15 596A E928

jeansch avatar Jul 02 '19 14:07 jeansch

Hi, Aha I am using boolean var but it's not working in this case. When I passed 'false' to unpause the agent, it does nothing but 'true' works fine. After removing this condition all works fine :)

Briareos12 avatar Jul 02 '19 15:07 Briareos12

In Python, both 'false' and 'true' are True. You want to use False or True

Le mar. 2 juill. 2019 11 h 03, Briareos12 [email protected] a écrit :

Hi, Aha I am using boolean var but it's not working in this case. When I passed 'false' to unpause the agent, it does nothing but 'true' works fine. After removing this condition all works fine :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jeansch/py-asterisk/issues/36?email_source=notifications&email_token=AABUPX253HLOOFSMZ3TG5DTP5NU2NA5CNFSM4H4TK7QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZBSLWA#issuecomment-507717080, or mute the thread https://github.com/notifications/unsubscribe-auth/AABUPXYXDNOFBYSSHLUMKXTP5NU2NANCNFSM4H4TK7QA .

jeansch avatar Jul 02 '19 15:07 jeansch

I'v quote boolean in my text but my test was with True and False :)

Briareos12 avatar Jul 02 '19 15:07 Briareos12

I'closing this issue. Reviewed the code, and it work as expected.

jeansch avatar Mar 03 '22 16:03 jeansch