Dynamic features on unanswered call

Hi all.
I have the dynamic feature in features.conf, for example:

I have the dialplan:

exten => _X.,1,Set(__DYNAMIC_FEATURES=test) same => n,Dial(SIP/mml/${EXTEN})

I want the feature to work while the call is ringing, not answered. DTMF works fine, but the feature is not activated until the peer ‘mml’ answers.

In the following log red DTMF came while the call was ringing, and the feature was not activated. Blue DTMF came when the call was answered and bridged, and the feature worked normally:

[quote] – Executing [6000@from-btaran:1] Set(“SIP/btaran-0000002c”, “__DYNAMIC_FEATURES=test”) in new stack
– Executing [6000@from-btaran:2] Dial(“SIP/btaran-0000002c”, “SIP/mml/6000”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/mml/6000
– SIP/mml-0000002d is making progress passing it to SIP/btaran-0000002c
> 0xb7507338 – Probation passed - setting RTP source address to 10.3.5.118:24386
[color=#FF0000] – SIP/mml-0000002d is ringing
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4214 __ast_read: DTMF begin ‘’ received on SIP/btaran-0000002c
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4225 __ast_read: DTMF begin passthrough '
’ on SIP/btaran-0000002c
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4128 __ast_read: DTMF end ‘’ received on SIP/btaran-0000002c, duration 80 ms
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4169 __ast_read: DTMF end accepted with begin '
’ on SIP/btaran-0000002c
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4184 __ast_read: DTMF end ‘’ detected to have actual duration 60 on the wire, emulation will be triggered on SIP/btaran-0000002c
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4191 __ast_read: DTMF end '
’ has duration 60 but want minimum 80, emulating on SIP/btaran-0000002c
[Sep 25 13:13:02] DTMF[8079][C-00000024]: channel.c:4248 __ast_read: DTMF end emulation of ‘’ queued on SIP/btaran-0000002c[/color]
[color=#0000FF] – SIP/mml-0000002d answered SIP/btaran-0000002c
> 0x8e401c8 – Probation passed - setting RTP source address to 10.4.1.7:10638
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4214 __ast_read: DTMF begin '
’ received on SIP/btaran-0000002c
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4225 __ast_read: DTMF begin passthrough ‘’ on SIP/btaran-0000002c
– Feature Found: test exten: test
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4128 __ast_read: DTMF end '
’ received on SIP/btaran-0000002c, duration 80 ms
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4169 __ast_read: DTMF end accepted with begin ‘’ on SIP/btaran-0000002c
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4184 __ast_read: DTMF end '
’ detected to have actual duration 60 on the wire, emulation will be triggered on SIP/btaran-0000002c
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4191 __ast_read: DTMF end ‘’ has duration 60 but want minimum 80, emulating on SIP/btaran-0000002c
[Sep 25 13:13:07] DTMF[8079][C-00000024]: channel.c:4248 __ast_read: DTMF end emulation of '
’ queued on SIP/btaran-0000002c
– Feature Found: test exten: test
– <SIP/btaran-0000002c> Playing ‘tt-weasels.gsm’ (language ‘en’)[/color]
== Spawn extension (from-btaran, 6000, 2) exited non-zero on ‘SIP/btaran-0000002c’[/quote]

How can I make asterisk react on features on unanswered calls?

Asterisk 11.12.0. And I definitely had this worked as I need on 1.4.24.

Thanks a lot.

Interpose an answered local channel and run the features on the bridge between that and the caller.

Thanks a lot!

It worked:

[code][dial-user]

exten => s-DIAL,n,Set(__USER_REGDEVICE=${regdevice})
exten => s-DIAL,n(norec),Dial(Local/s@dial-user-regdevice/n,${timetocalldevice},WwTtg)

[dial-user-regdevice]
exten => s,1,Answer
same => n,Dial(${USER_REGDEVICE})[/code]

instead of old simple dialplan that did not work correctly: