I think I see a little better where you are coming from - in my experience I have found the current default behavior of transfers (blind and otherwise) in freeswitch to be exactly what is needed. But I see that you mention wanting to make changes to blind and attended transfers consistently. <br>
<br>I have actually implemented separate dialplan paths and a lua script for dealing separately with blind and attended transfers in my own applications. But I have found there is necessary reason for things to be done that way. <br>
<br>Not all transfers are created equal in SIP. (And that presents a challenge. =p)<br><br>For example, in a fully attended transfer, the a-leg's session is simply adjusted so that its communication is now with a different endpoint. But in a blind transfer, the a-leg is essentially told to tear its session down and start a brand new session. <br>
<br>The great difference in flow of activity between different types of 'transfer' and 'forwarding' give very different hooks into modifying the operations. <br><br>Even though the word 'transfer' is used in the name of both these operations, they really are very, very different operations. So, then, blind xfer and attended xfer never behave the same way under the hood. That makes it difficult, at times impractical, and at times impossible to have flags that single-handedly encompass changes in the behavior to all types of transfer. <br>
<br>I definitely do not take issue with the validity of the needs in your situation, Francois. Actually, I sympathize because I've had to implement specific control of transfer myself in a few different applications, as I mentioned.<br>
<br>I just wanted to throw this information out there because I have found it helpful for myself to remind myself of the details of what can possibly happen with SIP transfers. It usually helps me to understand why or why not certain control points may be available to me and how to use dialplan, lua scripts, etc. to provide the control I need.<br>
<br>Hopefully this discussion is helpful to others reading this thread, too.<br><br>Hope the transferring keeps going well for you, Francois! :-)<br><br><div class="gmail_quote">On Mon, Nov 22, 2010 at 5:39 AM, François Delawarde <span dir="ltr"><<a href="mailto:fdelawarde@wirelessmundi.com">fdelawarde@wirelessmundi.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It's a very cool feature to be able to force this transfer context, and<br>
there are several options indeed for my scenario. I currently have to<br>
use a lua script that is called "on_answer" and sets the<br>
force_transfer_context to the other leg's context.<br>
<br>
I don't argue that it can't be done, but I believe that in most<br>
situations you would want blind transfer and attended transfer to behave<br>
the same way: using the transferer's context. It would be nice to have<br>
that behavior by default.<br>
<font color="#888888"><br>
François.<br>
</font><div><div></div><div class="h5"><br>
<br>
On Mon, 2010-11-22 at 05:13 -0800, S W wrote:<br>
> Francois,<br>
><br>
> Thanks for the example in your situation. I think that, to control<br>
> what you want the channel to do on a transfer, still does not need to<br>
> be overly complex.<br>
><br>
> It looks like you are first bridging to specific endpoints. You have<br>
> various options available to you for setting force_transfer_context on<br>
> the a-leg when the bridge happens (even an using execute_on_answer or<br>
> api_on_answer or whatever). The b-leg that answers can execute the<br>
> appropriate set onto the a-leg (even using uuid_setvar or something<br>
> else). Then, any subsequent transfer would involve the context you<br>
> desire.<br>
><br>
> - Steve<br>
><br>
> On Mon, Nov 22, 2010 at 1:23 AM, François Delawarde<br>
> <<a href="mailto:fdelawarde@wirelessmundi.com">fdelawarde@wirelessmundi.com</a>> wrote:<br>
> Hi Steve,<br>
><br>
> Thanks for your view on this. My point was that by default a<br>
> blind<br>
> transfer acts differently from an attended transfer as it uses<br>
> the<br>
> transferee's context instead of the transferer's.<br>
><br>
> It can in some way be controlled as you mention, but having to<br>
> implement<br>
> something quite complex only to have blind and attended xfers<br>
> behaving<br>
> in the same way seems a bit overkill.<br>
><br>
><br>
> For example, if I wish to use the B-leg's context as<br>
> transfer_context<br>
> for the A-leg (as in attended xfers), then when bridging to a<br>
> group it<br>
> can become a bit complicated:<br>
><br>
> <action application="bridge"<br>
> data="user/<a href="mailto:100@example.com">100@example.com</a>,user/<a href="mailto:101@example.com">101@example.com</a>,..."/><br>
><br>
> In that case, I would have to use a lua script to set the<br>
> force_transfer_context to the B-leg's context on answer<br>
> (because<br>
> beforehand you wouldn't know who is going to take the call),<br>
> so that if<br>
> a transfer happens, it goes in the correct context.<br>
><br>
> François.<br>
><br>
><br>
><br>
><br>
><br>
> On Fri, 2010-11-19 at 15:39 -0500, S W wrote:<br>
> > And here we have a start on the wiki page<br>
> ><br>
> ><br>
> <a href="http://wiki.freeswitch.org/wiki/Force_transfer_context_example" target="_blank">http://wiki.freeswitch.org/wiki/Force_transfer_context_example</a><br>
> ><br>
> > On Fri, Nov 19, 2010 at 3:34 PM, S W<br>
> <<a href="mailto:steve.d.ward@gmail.com">steve.d.ward@gmail.com</a>> wrote:<br>
> > I can go ahead and start a wiki page on this.<br>
> Feedback is<br>
> > welcome.<br>
> ><br>
> > I tried to make a general template-type single code<br>
> file<br>
> > people can use and work with.<br>
> ><br>
> > <a href="http://pastebin.freeswitch.org/14560" target="_blank">http://pastebin.freeswitch.org/14560</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On Fri, Nov 19, 2010 at 2:48 PM, Michael Collins<br>
> > <<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>> wrote:<br>
> > Could you pastebin your dialplan? I'd like<br>
> to let<br>
> > others try it out. Once it's confirmed we'll<br>
> wikify<br>
> > it.<br>
> > -MC<br>
> ><br>
> ><br>
> ><br>
> > On Fri, Nov 19, 2010 at 9:08 AM, S W<br>
> > <<a href="mailto:steve.d.ward@gmail.com">steve.d.ward@gmail.com</a>> wrote:<br>
> > Just as a comment, I have recently<br>
> employed<br>
> > the functionality of<br>
> force_transfer_context,<br>
> > and it is great exactly as it is.<br>
> ><br>
> > In my scenario I need to control how<br>
> the<br>
> > channel RECEIVING a transfer/REFER<br>
> handles<br>
> > that transfer.<br>
> ><br>
> > For example, I never want incoming<br>
> calls to<br>
> > directly access certain call paths<br>
> on my box.<br>
> > But, if a channel receives a REFER<br>
> to off-box<br>
> > destination X, I want to handle that<br>
> (even<br>
> > though my default context for<br>
> incoming calls<br>
> > doesn't allow for destination X).<br>
> ><br>
> > So I have a context that is not<br>
> associated<br>
> > with my SIP profile for incoming<br>
> calls. And<br>
> > that context has routing logic for<br>
> destination<br>
> > X. And I use force_transfer_context<br>
> so that,<br>
> > when a channel is bridged and gets a<br>
> REFER to<br>
> > destination X, the ROUTING state<br>
> sends the<br>
> > channel through my special context<br>
> for<br>
> > handling transfers.<br>
> ><br>
> > It's awesome!!!<br>
> ><br>
> > And just as another note on your<br>
> comment,<br>
> > Francois - a transferer has total<br>
> control over<br>
> > where he transfers another channel<br>
> (e.g. you<br>
> > can use dialplan context and<br>
> extension, etc<br>
> > etc. right in transfer app).<br>
> ><br>
> > These channel vars -<br>
> force_transfer_context<br>
> > and force_transfer_dialplan - allow<br>
> for<br>
> > controlling how a channel reacts to<br>
> getting a<br>
> > transfer/REFER thrown at it.<br>
> ><br>
> > Anyway, just a comment....<br>
> ><br>
> ><br>
> ><br>
> > On Fri, Nov 19, 2010 at 11:45 AM,<br>
> François<br>
> > Delawarde<br>
> <<a href="mailto:fdelawarde@wirelessmundi.com">fdelawarde@wirelessmundi.com</a>><br>
> > wrote:<br>
> > Problem is those variables<br>
> must be set<br>
> > on the channel that has to<br>
> be<br>
> > transfered and not the<br>
> channel that<br>
> > performs the transfer.<br>
> ><br>
> > I thought it would be more<br>
> logical to<br>
> > use the transferer context<br>
> by<br>
> > default (just like in<br>
> attended xfers),<br>
> > and for those variables to<br>
> be set<br>
> > on the transferer's side.<br>
> ><br>
> > François.<br>
> ><br>
> ><br>
> ><br>
> > On Fri, 2010-11-19 at 08:32<br>
> -0600,<br>
> > Brian West wrote:<br>
> > > force_transfer_dialplan<br>
> > > force_transfer_context<br>
> > ><br>
> > ><br>
> > > You can't tell if a<br>
> transfer is<br>
> > blind or attended.<br>
> > ><br>
> > ><br>
> > > /b<br>
> > ><br>
> > > On Nov 19, 2010, at 5:04<br>
> AM,<br>
> > François Delawarde wrote:<br>
> > ><br>
> > > > Hello,<br>
> > > ><br>
> > > > I pastebined a very<br>
> simple<br>
> > configuration for you to<br>
> reproduce:<br>
> > > ><br>
> ><br>
> <a href="http://pastebin.freeswitch.org/14552" target="_blank">http://pastebin.freeswitch.org/14552</a><br>
> > > ><br>
> > > > We have user 100 in<br>
> context<br>
> > "public", 101 and 102 in<br>
> context<br>
> > > > "local".<br>
> > > ><br>
> > > > Scenario:<br>
> > > > 1. 100 calls destination<br>
> "123"<br>
> > > > 2. 101 answers, and<br>
> transfers to<br>
> > 102<br>
> > > ><br>
> > > > In step 2., if 101 does<br>
> an<br>
> > attended transfer, it will<br>
> of course<br>
> > use<br>
> > > > its<br>
> > > > own context (local) and<br>
> the<br>
> > transfer will work. Now if<br>
> 101 does a<br>
> > > > blind<br>
> > > > transfer instead, it<br>
> will use the<br>
> > context of the other leg<br>
> (100 =><br>
> > > > public) and it will not<br>
> work.<br>
> > > ><br>
> > > > I think it should behave<br>
> the same<br>
> > way for both types of<br>
> transfer by<br>
> > > > default. A workaround is<br>
> to set<br>
> > force_transfer_context<br>
> (uncomment<br>
> > > > the<br>
> > > > line on the "public"<br>
> dialplan) in<br>
> > the channel to be<br>
> transfered,<br>
> > > > which<br>
> > > > can be a pain with more<br>
> complex<br>
> > configurations.<br>
> > > ><br>
> > > > Thanks,<br>
> > > > François.<br>
> > ><br>
> > ><br>
> ><br>
> > ><br>
> ><br>
> _______________________________________________<br>
> > > FreeSWITCH-users mailing<br>
> list<br>
> > ><br>
> ><br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> > ><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> > ><br>
> ><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > FreeSWITCH-users mailing<br>
> list<br>
> ><br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > FreeSWITCH-users mailing list<br>
> ><br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> ><br>
> _______________________________________________<br>
> > FreeSWITCH-users mailing list<br>
> > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > FreeSWITCH-users mailing list<br>
> > <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> ><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> ><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> > <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
> _______________________________________________<br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
> _______________________________________________<br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br>