[Home]

Summary:ASTERISK-01300: Retry problem in pbx_spool module
Reporter:e911 (e911)Labels:
Date Opened:2004-03-26 10:08:43.000-0600Date Closed:2004-09-25 02:52:17
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 1.call
( 1) 2.call
( 2) app_waitforring2.c
( 3) newpatch.diff
( 4) pbx_spool.c.diff
Description:If you have 2 file of call, one with Retrytime: 60 and another with Retrytime: 30, at the first time you copy to outgoing dir start the 2 call correctly, but if this 2 call fail, wait 30 second and start to call again the 2
extension, and not only the second.
Comments:By: James Golovich (jamesgolovich) 2004-03-26 17:08:16.000-0600

Are you using a recent copy of CVS?  An issue like this was just fixed last week

By: e911 (e911) 2004-03-29 02:39:20.000-0600

I'm using the CVS version of 26/03/04. I have modified the pbx_spool to resolve the problem of retry on channel not available and I have add the 'DateTime' control for the retry, but don't have resolved this problem.

By: Mark Spencer (markster) 2004-03-29 03:12:41.000-0600

I was unable to duplicate this problem.  is it possible that you have modified your system and/or that your parameters in your .call files are illogical?

By: e911 (e911) 2004-03-29 03:49:43.000-0600

This is the content of file 1.call

Channel: zap/g3/xxx
MaxRetries: 1
RetryTime: 60
WaitTime: 30
Extension: s
Application: AGI
Data: test.agi

This is the content of file 2.call

Channel: zap/g3/xxx
MaxRetries: 1
RetryTime: 10
WaitTime: 30
Extension: s
Application: AGI
Data: test.agi

My group 'g3' is composed to 1 channel (to test the retry on 'channel not available').
Copy this 2 file to /var/spool/asterisk/outgoing and you see that 1.call start to calling and
2.call return 'channel not available' but don't increase the retry. The result of 1.call is reason 3.
After 10 second restart 1.call and 2.call together. But why start 1.call and not only 2.call?
Is normal? I have tried without my modify and don't work. Thanks.

By: Mark Spencer (markster) 2004-03-29 04:02:02.000-0600

Asterisk automatically "corrects" your retry time to match your "wait time" in the second example.

By: Mark Spencer (markster) 2004-03-29 12:40:11.000-0600

"retry" time has traditionally been defined as the amount of time between beginning attempts of making the call.

By: e911 (e911) 2004-03-30 03:04:35.000-0600

I know, but don't work correctly if you use multiple call file with different 'retry time'.

By: Mark Spencer (markster) 2004-03-31 03:19:54.000-0600

Try it now, and also attach the two call files you're trying to run with.  Be sure you're running CVS head.

By: e911 (e911) 2004-03-31 04:33:27.000-0600

Ok, I have updated now the CVS.

This is the rusult of my log file:

   -- Attempting call on zap/g3/xxx for application AGI(testagi.agi) (Retry 1)
   -- Attempting call on zap/g3/yyy for application AGI(testagi.agi) (Retry 1)
Mar 31 11:10:44 NOTICE[19470]: channel.c:1592 __ast_request_and_dial: Unable to request channel zap/g3/yyy
Mar 31 11:10:44 NOTICE[19470]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 0
   -- Hungup 'Zap/31-1'
Mar 31 11:10:59 NOTICE[18445]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 3
   -- Attempting call on zap/g3/xxx for application AGI(testagi.agi) (Retry 2)
   -- Attempting call on zap/g3/yyy for application AGI(testagi.agi) (Retry 2)
Mar 31 11:11:05 NOTICE[21518]: channel.c:1592 __ast_request_and_dial: Unable to request channel zap/g3/yyy
Mar 31 11:11:05 NOTICE[21518]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 0
   -- Hungup 'Zap/31-1'
Mar 31 11:11:20 NOTICE[20493]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 3
   -- Attempting call on zap/g3/xxx for application AGI(testagi.agi) (Retry 3)
   -- Attempting call on zap/g3/yyy for application AGI(testagi.agi) (Retry 3)
Mar 31 11:11:26 NOTICE[23566]: channel.c:1592 __ast_request_and_dial: Unable to request channel zap/g3/yyy
Mar 31 11:11:26 NOTICE[23566]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 0
   -- Hungup 'Zap/31-1'
Mar 31 11:11:41 NOTICE[22541]: pbx_spool.c:221 attempt_thread: Call failed to go through, reason 3

I remember that group 'g3' have only 1 channel.
I have attached the file in question.
I do not answer voluntarily to the calls.

I have made of the modifications pbx_spool.c that I have sended markster.at.digium.com, you have received to them? I however, in order to make these tests, am using the version from CVS of today.

edited on: 03-31-04 03:24

By: Mark Spencer (markster) 2004-03-31 14:17:20.000-0600

I have not received your changes to pbx_spool.

By: e911 (e911) 2004-04-01 02:00:56.000-0600

I have made this patch/application for asterisk:

- new application (WaitForRing2)
     differ because return when the timeout is finished
- chan_vpb.c
     add the decode of CID after second RING, work fine now
- pbx_spool.c
     don't increase the retry when the channel is not available
     add the Datetime control (same as include), if result in this time don't call the extension and don't increase the retry

I have attacched the file here. But the email markster.at.digium.com don't work?

By: zoa (zoa) 2004-04-02 07:55:52.000-0600

is something changed with pbx_spool ? it looks like with current cvs it is ignoring the date in the future on my .call file.

By: zoa (zoa) 2004-04-02 07:59:11.000-0600

besides that, asterisk now creates .outgoing files instead of .call files

By: zoa (zoa) 2004-04-02 08:01:39.000-0600

with asterisk::outgoing in agi that is.

By: James Golovich (jamesgolovich) 2004-04-02 12:15:01.000-0600

zoa: the naming of those file is arbitrary.  They can be called 'foo' for all the pbx_spool cares about.

By: Mark Spencer (markster) 2004-04-04 12:31:30

I would much prefer you confirm these issues exist against a non-patched Asterisk installation.  I cannot duplicate the problems you're having.

By: James Golovich (jamesgolovich) 2004-04-04 20:05:33

Ok this should definitely all be fixed in CVS now

By: e911 (e911) 2004-04-05 08:37:18

Ok, with the CVS of today works correctly. I have attached the file pbx_spool.c.diff that contains the modify to pbx_spool, is possible to insert into CVS?

- Don't increase retry if the failure of call is "Unable to request channel"
- Add the Datetime control (same as include), if result in this time don't call the extension and
don't increase the retry

By: Mark Spencer (markster) 2004-04-05 09:35:51

If we don't increase retry if the failure is "Unable to request channel" then those calls might get retried indefinitely, making timeout and retries useless.  To add it, that behavior would have to be explicitly turned on in the file as an option and the default behavior maintained as the norm.  I'd consider the DateTime control patch, if it can get some code review and other people with happy thoughts signing off on it.

By: James Golovich (jamesgolovich) 2004-04-05 12:34:27

I say we close this bug out, and those 2 new issues should be opened up in a new bugnote as a feature request.

I'm with Mark on the "Unable to request channel" issue.  Perhaps whatever your trying to do here would be better service by the manager interface and Originate.

By: Mark Spencer (markster) 2004-04-05 12:55:05

Fixed in CVS