[asterisk-dev] SayUnixTime() Bug

Butler, Larry lbutler at intercall.com
Wed Feb 1 20:27:44 MST 2006


There is definitely a bug in the SayUnixTime() application.  

I modified app_sayunixtime.c to return 0 even when encountering DTMF.
Thought I would share.

Thanks to B.J. Weschke and BTW Technologies for helping me identify the
issue.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~
	if (!res) {
		
		// ast_say_date_with_format does not return 0 when
encountering DTMF (single DTMF Digit breaks the loop)
		// Modifying app to force return of 0 or -1
		res = ast_say_date_with_format(chan, unixtime,
AST_DIGIT_ANY, chan->language, format, zone);
		//ast_verbose(VERBOSE_PREFIX_3 "res = '%i'\n", res);
		
		if (res > -1) {
		
			res = 0;
		
		} else {
			
			if (option_verbose > 2) {
            	ast_verbose(VERBOSE_PREFIX_3 "User disconnected\n");
            }
            
            res = -1;
		
		}	
	}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~

> Date: Tue, 31 Jan 2006 11:50:11 -0500
> From: "Butler, Larry " <lbutler at intercall.com>
> Subject: [asterisk-dev] SayUnixTime() Bug
> To: <asterisk-dev at lists.digium.com>
> Message-ID:
>
<C155EAF22D54084F9B023CDE51A5D2EF015611BE at icwpex104.us.intercall.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Possible bug experienced when executing the SayUnixTime() application.
> When a user presses a DTMF digit during the application execution the
call is sent to the single digit extension.  
>
> 
>
> A user presses 1 during SayUnixTime() execution in this example:
>
> 
>
>    -- Executing SayUnixTime("SIP/204.13.233.13-08514ee0",
"1137610645") in new stack
>
>    -- Playing 'digits/day-3' (language 'en')
>
>    -- Playing 'digits/mon-0' (language 'en')
>
>    -- Playing 'digits/h-18' (language 'en')
>
>    -- Playing 'digits/2' (language 'en')
>
> Jan 31 10:39:31 WARNING[19102]: pbx.c:2394 __ast_pbx_run: Invalid
extension '1', but no rule 'i' in context 'txlinkin'
>
> 
>
> I did a quick scan of say.c and app_sayunixtime.c and didn't see any
screaming issues. Any ideas why this is happening?  I will revisit the
code this evening. 
>
> 
>
> Larry Butler


Larry Butler



More information about the asterisk-dev mailing list