Hi, experimenting with BackgroundDetect the module never cancels 
playback when entering extensions. Looking at the code, in 
app_backgrounddetect.c it looks like longdtmf should be initialized to 0 
instead of 1 for any of the logic to work, and setting it to 0 seems to 
fix the problem from my tests. Am I missing something? This is in 
changeset 5346 but the module code is identical to 1.2.0.1

In this example I dial 930 then hit 1 a few times with pauses between, 
then # which ceases playback. rtp detects the digits but they are not 
matched by the module. With longdtmf initialized to 0 it works and 
playback ceases the instant I hit 1:

*CLI> show dialplan
[ Context 'default' (0x5393ac01) created by 'pbx_config' ]
  '1' =>            1. Record(/tmp/vm.wav,30,30)                  
[pbx_config]
                    2. Hangup()                                   
[pbx_config]
  '930' =>          1. Answer()                                   
[pbx_config]
                    2. BackgroundDetect(/tmp/greet,t)             
[pbx_config]
  'h' =>            1. NoOp(call completed)                       
[pbx_config]

[ Context 'parkedcalls' (0x1f3fa4c) created by 'res_features' ]
  '700' =>          1. Park()                                     
[res_features]

-= 4 extensions (6 priorities) in 2 contexts. =-
*CLI>
*CLI>
    -- Executing [...@default:1] Answer("SIP/10.71.10.6-0980e1f0", "")
    -- Executing [...@default:2] 
BackgroundDetect("SIP/10.71.10.6-0980e1f0", "/tmp/greet,t")
    -- Playing '/tmp/greet' (language 'en')
  == Auto fallthrough, channel 'SIP/10.71.10.6-0980e1f0' status is 'UNKNOWN'
    -- Executing [...@default:1] NoOp("SIP/10.71.10.6-0980e1f0", "call 
completed")

...
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=RFC3581/global nat=RFC3581/Channel:--)
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: Allocating new SIP dialog 
for [email protected] - INVITE (With RTP)
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: * SIP extension value: 1 
for call [email protected]
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: Activating RTP on response 
[email protected] (1)
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: T38 state changed to 0 on 
channel <none>
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: build_route: Contact hop: 
<sip:[email protected]>
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=Always/global 
nat=RFC3581/Channel:SIP/10.71.10.6-0980e1f0)
Mar  5 21:41:56 DEBUG[3062143888] app.c: delim=',', args:
Mar  5 21:41:56 DEBUG[3062143888] app.c: argc: 0
Mar  5 21:41:56 DEBUG[3062143888] chan_sip.c: 
sip_answer(SIP/10.71.10.6-0980e1f0)
Mar  5 21:41:56 DEBUG[3062143888] chan_sip.c: Check nat (client is on 
local net/peer nat=Always/global 
nat=RFC3581/Channel:SIP/10.71.10.6-0980e1f0)
Mar  5 21:41:56 DEBUG[3062143888] app.c: delim=',', args: /tmp/greet,t
Mar  5 21:41:56 DEBUG[3062143888] app.c: argc: 2
Mar  5 21:41:56 DEBUG[3062143888] app.c: argv[0]: /tmp/greet
Mar  5 21:41:56 DEBUG[3062143888] app.c: argv[1]: t
Mar  5 21:41:56 DEBUG[3063741328] chan_sip.c: Stopping retransmission on 
'[email protected]' of Response 102: Match Found
Mar  5 21:41:56 DEBUG[3062143888] app_backgrounddetect.c: Preparing 
detect of '/tmp/greet', sil=1000,min=100,max=-1
Mar  5 21:41:56 DEBUG[3062143888] channel.c: Set channel 
SIP/10.71.10.6-0980e1f0 to read format slin
Mar  5 21:41:56 DEBUG[3062143888] generator.c: Trying to deactivate 
generator in SIP/10.71.10.6-0980e1f0
Mar  5 21:41:56 DEBUG[3062143888] channel.c: Set channel 
SIP/10.71.10.6-0980e1f0 to write format slin
Mar  5 21:41:56 DEBUG[3062143888] rtp.c: Ooh, format changed from 
unknown to ulaw
Mar  5 21:41:56 DEBUG[3062143888] rtp.c: Had to change frame MS from 0 to 20
Mar  5 21:41:56 DEBUG[3062143888] rtp.c: Able to create smoother :) ms: 
20 len 160
Mar  5 21:41:56 DEBUG[3061611408] app_queue.c: Device 'SIP/10.71.10.6' 
changed to state '2' (In use)
Mar  5 21:41:56 DEBUG[3061877648] app_queue.c: Device 'SIP/10.71.10.6' 
changed to state '2' (In use)
Mar  5 21:41:56 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:41:57 DEBUG[3062143888] app_backgrounddetect.c: Found 
unqualified token of 0 ms
Mar  5 21:41:58 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=RFC3581/global nat=RFC3581/Channel:--)
Mar  5 21:41:58 DEBUG[3063741328] chan_sip.c: Allocating new SIP dialog 
for [email protected] - OPTIONS (No RTP)
Mar  5 21:41:58 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=RFC3581/global nat=RFC3581/Channel:--)
Mar  5 21:41:58 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:41:59 DEBUG[3062143888] app_backgrounddetect.c: Found 
unqualified token of 0 ms
Mar  5 21:41:59 DEBUG[3062143888] rtp.c: Sending dtmf: 49 (1), at 10.71.10.6
Mar  5 21:41:59 DEBUG[3062143888] app_backgrounddetect.c: DTMF detected 
on SIP/10.71.10.6-0980e1f0: 1
Mar  5 21:41:59 DEBUG[3062143888] app_backgrounddetect.c: Valid 
extension requested and DTMF did not match [1]
Mar  5 21:41:59 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:42:00 DEBUG[3062143888] app_backgrounddetect.c: Found 
unqualified token of 0 ms
Mar  5 21:42:01 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=RFC3581/global nat=RFC3581/Channel:--)
Mar  5 21:42:01 DEBUG[3063741328] chan_sip.c: Allocating new SIP dialog 
for [email protected] - OPTIONS (No RTP)
Mar  5 21:42:01 DEBUG[3063741328] chan_sip.c: Check nat (client is on 
local net/peer nat=RFC3581/global nat=RFC3581/Channel:--)
Mar  5 21:42:02 DEBUG[3062143888] rtp.c: Sending dtmf: 49 (1), at 10.71.10.6
Mar  5 21:42:02 DEBUG[3062143888] app_backgrounddetect.c: DTMF detected 
on SIP/10.71.10.6-0980e1f0: 1
Mar  5 21:42:02 DEBUG[3062143888] app_backgrounddetect.c: Valid 
extension requested and DTMF did not match [1]
Mar  5 21:42:02 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:42:02 DEBUG[3062143888] app_backgrounddetect.c: Found 
unqualified token of 0 ms
Mar  5 21:42:04 DEBUG[3062143888] rtp.c: Sending dtmf: 49 (1), at 10.71.10.6
Mar  5 21:42:04 DEBUG[3062143888] app_backgrounddetect.c: DTMF detected 
on SIP/10.71.10.6-0980e1f0: 1
Mar  5 21:42:04 DEBUG[3062143888] app_backgrounddetect.c: Valid 
extension requested and DTMF did not match [1]
Mar  5 21:42:04 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:42:04 DEBUG[3062143888] app_backgrounddetect.c: Found 
unqualified token of 0 ms
Mar  5 21:42:05 DEBUG[3062143888] app_backgrounddetect.c: Start of voice 
token!
Mar  5 21:42:05 DEBUG[3062143888] rtp.c: Sending dtmf: 35 (#), at 10.71.10.6
Mar  5 21:42:05 DEBUG[3062143888] app_backgrounddetect.c: DTMF detected 
on SIP/10.71.10.6-0980e1f0: #
Mar  5 21:42:05 DEBUG[3062143888] channel.c: Set channel 
SIP/10.71.10.6-0980e1f0 to write format ulaw
Mar  5 21:42:05 DEBUG[3062143888] channel.c: Set channel 
SIP/10.71.10.6-0980e1f0 to read format ulaw
Mar  5 21:42:05 DEBUG[3062143888] app.c: delim=',', args: call completed
Mar  5 21:42:05 DEBUG[3062143888] app.c: argc: 1
Mar  5 21:42:05 DEBUG[3062143888] app.c: argv[0]: call completed
Mar  5 21:42:05 DEBUG[3062143888] generator.c: Trying to deactivate 
generator in SIP/10.71.10.6-0980e1f0
...


_______________________________________________
Callweaver-users mailing list
[email protected]
http://lists.callweaver.org/mailman/listinfo/callweaver-users

Reply via email to