[asterisk-bugs] [JIRA] (ASTERISK-22787) call file retry time broken

Jeremy Kister (JIRA) noreply at issues.asterisk.org
Mon Oct 28 19:54:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-22787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=211310#comment-211310 ] 

Jeremy Kister edited comment on ASTERISK-22787 at 10/28/13 7:52 PM:
--------------------------------------------------------------------

to reproduce:
{noformat}
cat <<__EOC__ > /var/spool/asterisk/tmp/mycall.tmp
Channel: Local/9999 at extensions
Callerid: 1234
MaxRetries: 25
RetryTime: 60
WaitTime: 60
Context: alarm-ack
Extension: s
Priority: 1
__EOC__

mv /var/spool/asterisk/tmp/mycall.tmp /var/spool/asterisk/outgoing/mycall
{noformat}

Do not answer the call when it comes in. Instead, use 'ls -l /var/spool/asterisk/outgoing/mycall' after Asterisk stops ringing the extension.

Asterisk will use pbx/pbx_spool:safe_append to append to the file (in place).  Let this repeat for a few times.  When the file is larger than 512 bytes, Asterisk gets all confused and retries immediately/randomly instead of at the specified RetryTime.

I believe this is because files written in the pbx spool must be done atomically.  

                
      was (Author: jkister):
    to reproduce:
{noformat}
cat <<__EOC__ > /var/spool/asterisk/tmp/mycall.tmp
Channel: Local/9999 at extensions
Callerid: 1234
MaxRetries: 25
RetryTime: 60
WaitTime: 60
Context: alarm-ack
Extension: s
Priority: 1
__EOC__

mv /var/spool/asterisk/tmp/mycall.tmp /var/spool/asterisk/outgoing/mycall
{noformat}

Do not answer the call when it comes in. Instead, use 'ls -l /var/spool/asterisk/outgoing/mycall' after Asterisk stops ringing the extension.

Asterisk will use pbx/pbx_spool:safe_append to append to the file (in place).  When the file is larger than 512 bytes, Asterisk gets all confused and retries immediately/randomly instead of at the specified RetryTime.

I believe this is because files written in the pbx spool must be done atomically.  

                  
> call file retry time broken
> ---------------------------
>
>                 Key: ASTERISK-22787
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22787
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: PBX/pbx_spool
>    Affects Versions: 11.6.0
>         Environment: Debian 6
>            Reporter: Jeremy Kister
>
> call file retry times are broken because of 'safe_append' function.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list