[Home]

Summary:ASTERISK-12152: Digit timeout giving negative values
Reporter:xieliwei (xieliwei)Labels:
Date Opened:2008-06-05 21:29:43Date Closed:2008-06-06 18:50:08
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Functions/func_timeout
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I'm not very sure if this is a freepbx or asterisk issue since both are trunk versions and this is a fresh install. I'll be posting this bug report for both freepbx and asterisk.

All instances of digit timeout seem to have negative time even though a positive value was set:

IVR
   -- Executing [s@ivr-4:5] GotoIf("SIP/xx.xx.xx.xx-083c0e40", "1?begin") in new stack
   -- Goto (ivr-4,s,8)
   -- Executing [s@ivr-4:8] Set("SIP/xx.xx.xx.xx-083c0e40", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to -2144.483
   -- Executing [s@ivr-4:9] Set("SIP/xx.xx.xx.xx-083c0e40", "TIMEOUT(response)=10") in new stack
   -- Response timeout set to 10.000


Similarly for DISA
   -- Executing [1@ivr-3:3] Goto("SIP/xx.xx.xx.xx-083c0e40", "disa,1,1") in new stack
   -- Goto (disa,1,1)
   -- Executing [1@disa:1] Set("SIP/xx.xx.xx.xx-083c0e40", "TIMEOUT(digit)=5") in new stack
   -- Digit timeout set to -2142.483
   -- Executing [1@disa:2] Set("SIP/xx.xx.xx.xx-083c0e40", "TIMEOUT(response)=10") in new stack
   -- Response timeout set to 10.000

Notice that response timeout still works as normal and that the timeout seems to be overflowing as the negative values seem to change proportionally to the value of timeout specified.

FreePBX version is trunk-5769
Comments:By: Tilghman Lesher (tilghman) 2008-06-06 10:39:21

I cannot reproduce this issue:

<pre>
*CLI>   == Using SIP RTP CoS mark 5
   -- Executing [8116@digium:1] Set("SIP/103-0841ed90", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to 3.000
   -- Executing [8116@digium:2] Set("SIP/103-0841ed90", "TIMEOUT(response)=5") in new stack
   -- Response timeout set to 5.000
   -- Executing [8116@digium:3] NoOp("SIP/103-0841ed90", "d=3.000 r=5.000") in new stack
   -- Executing [8116@digium:4] Wait("SIP/103-0841ed90", "300") in new stack
 == Spawn extension (digium, 8116, 4) exited non-zero on 'SIP/103-0841ed90'

*CLI>
*CLI>
*CLI> dialplan show 8116@digium
[ Context 'digium' created by 'pbx_config' ]
 '8116' =>         1. Set(TIMEOUT(digit)=3)                      [pbx_config]
                   2. Set(TIMEOUT(response)=5)                   [pbx_config]
                   3. NoOp(d=${TIMEOUT(digit)} r=${TIMEOUT(response)}) [pbx_config]
                   4. Wait(300)                                  [pbx_config]
</pre>

By: xieliwei (xieliwei) 2008-06-06 11:23:47

Further testing gives this:
   -- Executing [196@from-internal:1] Set("SIP/105-0821c6a0", "TIMEOUT(digit)=10") in new stack
   -- Digit timeout set to 10.000
   -- Executing [196@from-internal:2] Set("SIP/105-0821c6a0", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to -2144.483
   -- Executing [196@from-internal:3] Set("SIP/105-0821c6a0", "TIMEOUT(response)=5") in new stack
   -- Response timeout set to 5.000
   -- Executing [196@from-internal:4] NoOp("SIP/105-0821c6a0", "d=-2144.483 r=5.000") in new stack
   -- Executing [196@from-internal:5] Wait("SIP/105-0821c6a0", "300") in new stack

and this:
   -- Executing [196@from-internal:1] Set("SIP/105-08389180", "TIMEOUT(digit)=11") in new stack
   -- Digit timeout set to 11.000
   -- Executing [196@from-internal:2] Set("SIP/105-08389180", "TIMEOUT(digit)=10") in new stack
   -- Digit timeout set to 10.000
   -- Executing [196@from-internal:3] Set("SIP/105-08389180", "TIMEOUT(digit)=9") in new stack
   -- Digit timeout set to -2138.483
   -- Executing [196@from-internal:4] Set("SIP/105-08389180", "TIMEOUT(digit)=8") in new stack
   -- Digit timeout set to -2139.483
   -- Executing [196@from-internal:5] Set("SIP/105-08389180", "TIMEOUT(digit)=7") in new stack
   -- Digit timeout set to -2140.483
   -- Executing [196@from-internal:6] Set("SIP/105-08389180", "TIMEOUT(digit)=6") in new stack
   -- Digit timeout set to -2141.483
   -- Executing [196@from-internal:7] Set("SIP/105-08389180", "TIMEOUT(digit)=5") in new stack
   -- Digit timeout set to -2142.483
   -- Executing [196@from-internal:8] Set("SIP/105-08389180", "TIMEOUT(digit)=4") in new stack
   -- Digit timeout set to -2143.483
   -- Executing [196@from-internal:9] Set("SIP/105-08389180", "TIMEOUT(digit)=3") in new stack
   -- Digit timeout set to -2144.483
   -- Executing [196@from-internal:10] Set("SIP/105-08389180", "TIMEOUT(digit)=2") in new stack
   -- Digit timeout set to -2145.483
   -- Executing [196@from-internal:11] Set("SIP/105-08389180", "TIMEOUT(digit)=1") in new stack
   -- Digit timeout set to -2146.483
   -- Executing [196@from-internal:12] Set("SIP/105-08389180", "TIMEOUT(digit)=0") in new stack
   -- Digit timeout set to -2147.483
   -- Executing [196@from-internal:13] Set("SIP/105-08389180", "TIMEOUT(digit)=-1") in new stack
   -- Digit timeout set to 0.000
   -- Executing [196@from-internal:14] Set("SIP/105-08389180", "TIMEOUT(response)=5") in new stack
   -- Response timeout set to 5.000
   -- Executing [196@from-internal:15] NoOp("SIP/105-08389180", "d=0.000 r=5.000") in new stack
   -- Executing [196@from-internal:16] Wait("SIP/105-08389180", "300") in new stack

The values are consistent with each repeat but different values are returned for different combinations?

I'm not very sure how I got into this problem. Please suggest what could have caused this so that I know where to start to look for how to reproduce this problem.



By: Philippe Lindheimer (p_lindheimer) 2008-06-06 12:24:11

The dialplan generated by FreePBX for these two incidents is:

IVR:
[ivr-1]
include => ivr-1-custom
include => from-did-direct-ivr
include => app-directory
exten => #,1,Goto(app-directory,*411,1)
exten => h,1,Hangup
exten => s,1,Set(LOOPCOUNT=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,Set(_IVR_CONTEXT_${CONTEXT}=${IVR_CONTEXT})
exten => s,n,Set(_IVR_CONTEXT=${CONTEXT})
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Background(custom/my_ivr_message)
exten => s,n,WaitExten(,)
AND THEN ADDITIONAL IVR CODE OMITTED BELOW


IVR:
[disa]
include => disa-custom
exten => 1,1,Set(TIMEOUT(digit)=5)
exten => 1,n,Set(TIMEOUT(response)=20)
exten => 1,n,Playback(enter-password)
exten => 1,n,DISA(/etc/asterisk/disa-1.conf)
exten => 1,n(end),Hangup

By: Tilghman Lesher (tilghman) 2008-06-06 13:02:59

The only thing I can think of is that they're patching Asterisk in some way that is incompatible.  Please report this to FreePBX, as this is clearly not a problem in Asterisk alone.

Unless you can reproduce this in plain Asterisk (NOT FreePBX), then I'm going to have to close this issue.

By: xieliwei (xieliwei) 2008-06-06 15:37:57

FreePBX only provides configuration files and a web interface to configure asterisk. It does not patch asterisk's source.

I'll try to recreate the problem. My guess is probably one of the optional modules I selected in menuconfig. That is still under asterisk's care right?

By: xieliwei (xieliwei) 2008-06-06 18:03:29

This bug can be closed.

I confirm that a vanilla install does not exhibit this problem. Only when FreePBX configuration is applied will this happen.

This scales down the cause to either a FreePBX bug or bad configuration on my side. Either way, it is unlikely that Asterisk is the cause.

For the record, steps taken were:
1. Move all asterisk related items, mainly /etc/asterisk, /usr/lib/asterisk, /var/lib/asterisk and /usr/sbin/asterisk to a storage directory.
(Clearing of FreePBX items was not done as a vanilla install would not be affected by its presence unless FreePBX was explicitly applied to it)
2. make distclean and compile asterisk from scratch with same configuration and menuconfig selections.
3. Install was then confirmed not to be exhibiting this problem.
4. Install FreePBX
5. Problem occurs with my current FreePBX configuration applied.

I should explain that because I did not have time to do a clean VM install and because I only wanted to confirm if the problem lies with FreePBX or Asterisk, what I have done may be questionable. Apologies for that.