Summary: | ASTERISK-11766: Optional timeout parameter is not optional | ||
Reporter: | John Lange (johnlange) | Labels: | |
Date Opened: | 2008-04-01 16:56:04 | Date Closed: | 2008-04-02 09:30:57 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Applications/app_queue |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | The documentation shows that Queues should be called as follows: Queue(queuename[|options[|URL][|announceoverride][|timeout][|AGI]) However, if timeout is left empty or set to 0, the queue times out immediately. e.g.: exten => s,1,Queue(queue-test|ti||||update-queue) The logged in agent gets a very short ring then the call sits in the queue for a few seconds then goes to the next priority after the Queue statement. I think that this: /* set the expire time based on the supplied timeout; */ if (args.queuetimeoutstr) qe.expire = qe.start + atoi(args.queuetimeoutstr); else qe.expire = 0; should actually be: /* set the expire time based on the supplied timeout; */ if (!ast_strlen_zero(args.queuetimeoutstr)) qe.expire = qe.start + atoi(args.queuetimeoutstr); else qe.expire = 0; I tried this above and it seemed to fix the problem. Diff is in additonal info. ****** ADDITIONAL INFORMATION ****** --- asterisk-1.4.18/apps/app_queue.c 2008-01-30 09:23:00.000000000 -0600 +++ /usr/src/asterisk/apps/app_queue.c 2008-04-01 16:50:06.000000000 -0500 @@ -3739,7 +3739,7 @@ qe.start = time(NULL); /* set the expire time based on the supplied timeout; */ - if (args.queuetimeoutstr) + if (!ast_strlen_zero(args.queuetimeoutstr)) qe.expire = qe.start + atoi(args.queuetimeoutstr); else qe.expire = 0; | ||
Comments: | By: Digium Subversion (svnbot) 2008-04-02 09:27:21 Repository: asterisk Revision: 112393 U branches/1.4/apps/app_queue.c ------------------------------------------------------------------------ r112393 | mmichelson | 2008-04-02 09:27:18 -0500 (Wed, 02 Apr 2008) | 6 lines Ensure that there is no timeout if none is specified. (closes issue ASTERISK-11766) Reported by: johnlange ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=112393 By: Digium Subversion (svnbot) 2008-04-02 09:27:58 Repository: asterisk Revision: 112394 _U trunk/ U trunk/apps/app_queue.c ------------------------------------------------------------------------ r112394 | mmichelson | 2008-04-02 09:27:58 -0500 (Wed, 02 Apr 2008) | 14 lines Merged revisions 112393 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r112393 | mmichelson | 2008-04-02 09:32:00 -0500 (Wed, 02 Apr 2008) | 6 lines Ensure that there is no timeout if none is specified. (closes issue ASTERISK-11766) Reported by: johnlange ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=112394 By: Digium Subversion (svnbot) 2008-04-02 09:28:52 Repository: asterisk Revision: 112395 _U branches/1.6.0/ U branches/1.6.0/apps/app_queue.c ------------------------------------------------------------------------ r112395 | mmichelson | 2008-04-02 09:28:51 -0500 (Wed, 02 Apr 2008) | 22 lines Merged revisions 112394 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r112394 | mmichelson | 2008-04-02 09:32:43 -0500 (Wed, 02 Apr 2008) | 14 lines Merged revisions 112393 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r112393 | mmichelson | 2008-04-02 09:32:00 -0500 (Wed, 02 Apr 2008) | 6 lines Ensure that there is no timeout if none is specified. (closes issue ASTERISK-11766) Reported by: johnlange ........ ................ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=112395 By: Mark Michelson (mmichelson) 2008-04-02 09:30:57 The patch is much appreciated, and this is definitely what should be in the code. In the future, though, please upload patches as attachments on bugs so that they can go through the proper licensing process. In this case, since the patch was one line, I'll go ahead and commit it. Thanks for the contribution! |