[asterisk-users] Queue breaks Dynamic_Features on Attended Transfer

Daniel Journo dan at keshercommunications.com
Wed Aug 8 19:43:46 CDT 2018

> Doing some more tests, this reads like a bug to me.
> Using a hanguphandler with DumpChan in the dialplan context that executes
> the Queue, I can see that DYNAMIC_FEATURES is set.
> After the attended transfer when the call is ended, the hanguphandler still
> shows that DYNAMIC_FEATURES is set. It's just not accessible.
> Any thoughts?
> It likely depens on how you are doing the attended transfer.  Via DTMF?  Via SIP
> or channel technology protocol?
> Does the Agent B channel have the DYNAMIC_FEATURES channel variable set
> on it?

Thanks for the reply.

To answer your question, the attended transfers are done via the endpoint's feature buttons. So I assume it's via SIP requests.

I've been doing some tests and reviewing the debug logs to try to understand the problem and still think it's a bug at this point.

Firstly, most of my inbound calls are answered and then Dial() Local channels. These Local channels set __DYNAMIC_FEATURES and various other things. They are also needed to ensure functionality like MixMonitor can be started on the Local channel and then not affected by any transfers. The Local channels then either Dial() some peers via other local channels (as some peers are required to press 1 to accept the call) or a Local channel that dials a Queue().

For non-Queue calls that are going via the Local Channels that only use Dial().
When endpoint_201 dials *1, it is matched with their own channel.
> DTMF feature hook 0x7f18d803a978 matched DTMF string '*1' on 0x7f18c000b080(PJSIP/endpoint_201-0000cb55)

Interestingly, after the attended transfer from endpoint_201 to endpoint_202, when endpoint_202 dials *1, it can no longer match and passes it back to the Local channel that originally dialled endpoint_201.
At that point, it can match the local channel since that's where DYNAMIC_FEATURES was originally set.
> No DTMF feature hooks on 0x7f189c0660b0(PJSIP/endpoint_202-0000cb5b) match '*1'
> DTMF feature hook 0x7f1894abd408 matched DTMF string '*1' on 0x7f186c04efa0(Local/fromfeature_201 at phones-00005a17;1)
So although the transfer caused the variable to be lost, the Local channel, as the parent, remained and stepped in to complete the *1 request.
Probably works by accident.

But calls passing through a Local channel that ends in Queue() don't act the same way.

The Queue's initial dial of the queuemembers includes the inheritance as expected.
So when endpoint_201 answers and they dial *1, this is the result.
> DTMF feature hook 0x7f18c4018278 matched DTMF string '*1' on 0x7f18b0002ca0(PJSIP/endpoint_201-0000cacc)

But following a transfer, using the same SIP messaging as the non-queue calls, this is the result...
> DTMF feature string on 0x7f18bd369720(PJSIP/endpoint_202-0000cae8) is now '*1'
> No DTMF feature hooks on 0x7f18bd369720(PJSIP/endpoint_202-0000cae8) match '*1'
> Playing DTMF stream '*1' out to 0x7f18e4112980(Local/queue_dialplan_101 at queue-000059b2;2) <---- this channel still has DYNAMIC_FEATURES set (see below) but it just passes the DTMF through?
> DTMF begin '*' received on Local/queue_dialplan_101 at queue-000059b2;1
> DTMF begin passthrough '*' on Local/queue_dialplan_101 at queue-000059b2;1
and it's passed all the way back and played to the caller.

This is in spite of the fact that Local/queue_dialplan_101 at queue-000059b2;2 has DYNAMIC_FEATURES set earlier in the dialplan.
> Set("Local/queue_dialplan_101 at queue-000059b2;2", "__DYNAMIC_FEATURES=NewRecordApp")
And still set at the end of the call, confirmed using DumpChan within the channels hangup handler.

> Dumping Info For Channel: Local/queue_dialplan 101 at queue-000059b2;2:
> Variables:

I can't really explain why the channel can still have DYNAMIC_FEATURES, but it's not perform matching apart from thinking it's a bug.

I hope that wasn't too long winded!

Thanks for the help and time!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20180809/70083348/attachment.html>

More information about the asterisk-users mailing list