<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 8, 2018 at 7:43 PM, Daniel Journo <span dir="ltr"><<a href="mailto:dan@keshercommunications.com" target="_blank">dan@keshercommunications.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="EN-GB">
<div class="m_18190415397154161WordSection1">
<p><span style="font-size:10.0pt;font-family:"Arial","sans-serif""><span class="">> Doing some more tests, this reads like a bug to me.<br>
> Using a hanguphandler with DumpChan in the dialplan context that executes<br>
> the Queue, I can see that DYNAMIC_FEATURES is set.<br>
> After the attended transfer when the call is ended, the hanguphandler still<br>
> shows that DYNAMIC_FEATURES is set. It's just not accessible.<br>
><br>
> Any thoughts?<br>
> It likely depens on how you are doing the attended transfer. Via DTMF? Via SIP<br>
> or channel technology protocol?<br>
> Does the Agent B channel have the DYNAMIC_FEATURES channel variable set<br>
> on it?<br>
><br>
<br></span>
Thanks for the reply.<br>
<br>
To answer your question, the attended transfers are done via the endpoint's feature buttons. So I assume it's via SIP requests.<br>
<br>
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.<br>
<br>
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().<br>
<br>
For non-Queue calls that are going via the Local Channels that only use Dial().<br>
When endpoint_201 dials *1, it is matched with their own channel.<br>
> DTMF feature hook 0x7f18d803a978 matched DTMF string '*1' on 0x7f18c000b080(PJSIP/endpoint_<wbr>201-0000cb55)<br>
<br>
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.<br>
At that point, it can match the local channel since that's where DYNAMIC_FEATURES was originally set.<br>
> No DTMF feature hooks on 0x7f189c0660b0(PJSIP/endpoint_<wbr>202-0000cb5b) match '*1'<br>
> DTMF feature hook 0x7f1894abd408 matched DTMF string '*1' on 0x7f186c04efa0(Local/<wbr>fromfeature_201@phones-<wbr>00005a17;1)<br>
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.<br>
Probably works by accident.<br>
<br>
But calls passing through a Local channel that ends in Queue() don't act the same way.<br>
<br>
The Queue's initial dial of the queuemembers includes the inheritance as expected.<br>
So when endpoint_201 answers and they dial *1, this is the result.<br>
> DTMF feature hook 0x7f18c4018278 matched DTMF string '*1' on 0x7f18b0002ca0(PJSIP/endpoint_<wbr>201-0000cacc)<br>
<br>
But following a transfer, using the same SIP messaging as the non-queue calls, this is the result...<br>
> DTMF feature string on 0x7f18bd369720(PJSIP/endpoint_<wbr>202-0000cae8) is now '*1'<br>
> No DTMF feature hooks on 0x7f18bd369720(PJSIP/endpoint_<wbr>202-0000cae8) match '*1'<br>
> Playing DTMF stream '*1' out to 0x7f18e4112980(Local/queue_<wbr>dialplan_101@queue-000059b2;2) <---- this channel still has DYNAMIC_FEATURES set (see below) but it just passes the DTMF through?<br>
> DTMF begin '*' received on Local/queue_dialplan_101@<wbr>queue-000059b2;1<br></span></p></div></div></blockquote><div><div><br></div><div>Does <span style="font-size:10pt;font-family:"Arial","sans-serif"">Local/queue_<wbr>dialplan_101@queue-000059b2;1 have DYNAMIC_FEATURES set on it?</span><br></div><div><br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-GB"><div class="m_18190415397154161WordSection1"><p><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">
> DTMF begin passthrough '*' on Local/queue_dialplan_101@<wbr>queue-000059b2;1<br>
and it's passed all the way back and played to the caller.<br>
<br>
This is in spite of the fact that Local/queue_dialplan_101@<wbr>queue-000059b2;2 has DYNAMIC_FEATURES set earlier in the dialplan.<br>
> Set("Local/queue_dialplan_101@<wbr>queue-000059b2;2", "__DYNAMIC_FEATURES=<wbr>NewRecordApp")<br>
And still set at the end of the call, confirmed using DumpChan within the channels hangup handler.<br>
<br>
> Dumping Info For Channel: Local/queue_dialplan 101@queue-000059b2;2:<br>
> Variables:<br>
> DYNAMIC_FEATURES=NewRecordApp<br>
<br>
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.<br>
<br>
I hope that wasn't too long winded!<br></span></p></div></div></blockquote><div><br></div><div>It does seem like a bug. However, you have a complicated dialplan with a lot of pieces happening at</div><div> once so it may not actually be an Asterisk bug but a problem with your dialplan. To unravel this is <br></div><div>going to take some bookkeeping on your part.</div><div><br></div><div>Here are some pointers to help:<br></div><div><br></div><div>It will help you to see what is going on by drawing out the channel chains. For instance I think your initial <br></div><div>non-queue call chain looks like:<br></div><div></div><div>PJSIP/caller --> Bridge1 --> L/caller;1 -- L/caller;2 --> Bridge2 --> L/feature;1 -- L/feature;2 --> Bridge3 --> PJSIP/201<br></div><div></div><div><br></div><div>DTMF feature hooks match DTMF coming from a channel toward a bridge. They do not match DTMF</div><div>going in the other direction. (This is why <span style="font-size:10pt;font-family:"Arial","sans-serif"">Local/queue_<wbr>dialplan_101@queue-000059b2;2</span> does not act on <br></div><div>the DTMF above.)</div><br><div>SIP attended transfers involve two calls. One call is placed on hold while the endpoint initiates another</div><div>call. When you complete the transfer the two remote parties get bridged together.</div><div>For example:<br></div>A (PJSIP/A-1) calls B (PJSIP/B-1) and talk in Bridge1<br><div>B (PJSIP/B-1) places A (PJSIP/A-1) on hold to start an attended transfer<br></div><div>B (PJSIP/B-2) calls C (PJSIP/C-2) in another call and talk in Bridge2<br></div><div>When B completes the transfer A (PJSIP/A-1) is bridged with C (PJSIP/C-2).<br></div><div>* Note the A and C channels could wind up in either Bridge1 or Bridge2 depending upon circumstances.</div>* Note that there are two different PJSIP/B channels involved.<div>* Note that until the attended transfer is completed the second call B makes has no connection with the <br></div><div>first call and thus inherits no channel variables from the first call.<br></div><div>* Note that if the A and C parties are connected to B through local channels it is the local channels which<br></div><div>represent the A and C parties that are involved in the transfer.<br></div><div><br></div><div>Local channels always come in pairs. When you dial a local channel it is the ;1 channel that acts as an</div><div> outgoing channel and the ;2 channel executes dialplan and acts as an incoming channel. This is the <br></div><div>initial role between the two channels in a local channel pair. In the transfer scenario I describe above</div><div>(the answering channel initiates the transfer) the local channels maintain the relationships after the transfer.<br></div><br></div>Richard<br></div></div>