[Freeswitch-users] Replace One Session with Another

Stanislav Sinyagin ssinyagin at gmail.com
Mon Aug 8 21:55:43 MSD 2016


I would consider two approaches, but this needs prototyping and testing:

a) make sure there's always a bridged call: whenever A places or
receives a call, it always appears in the conference first. I think
it's quite doable, the only disadvantage that A will always see a
connected call for outbound dialing, even that there's still a ringing
tone.

b) like I proposed above, whenever C comes in, use park() or maybe
some other displace function to replace A leg with C.

Probably also eavesdrop or one of its sisters (threeway and another
one, I can't remember) would be of help too.

So, this needs experimenting and digging in FreeSWITCH sources. I can
do it, or the guys at consulting at freeswitch.org can do it too, it just
needs to be a budget big enough :)




On Mon, Aug 8, 2016 at 5:00 PM, Colin Morelli <colin.morelli at gmail.com> wrote:
> Hey Stanislav,
>
> Thanks for the reply.
>
> mod_conference is actually what I'm using now to accomplish this. I drop C
> into the conference with A + B, along with an api_on_answer=uuid_kill
> ${a_uuid}. It works great, and actually doesn't notable impact CPU usage. I
> assume this is because of FS' default behavior of only mixing audio for
> members that are actively talking (maybe?) - so a good chunk of the time in
> a 2 person conference it's only "mixing" one person's audio. In any case,
> CPU usage is very similar in my configuration with either bridge or
> conference, and any potentially small additional CPU usage is worth it for
> the features conferencing provides in my opinion.
>
> Anyway, the problem is that none of this works when there's no bridged call.
> For example, I may have a channel that's currently listening to an audio
> file being played by playback in a dialplan. There is no B channel at all to
> bridge to, but I still want to be able to replace A with C (and start
> sending the playback to session C instead). This is where my current
> approach falls apart.
>
> Best,
> Colin
>
> On Mon, Aug 8, 2016 at 10:53 AM Stanislav Sinyagin <ssinyagin at gmail.com>
> wrote:
>>
>> I think it's doable via ESL, but needs testing.
>>
>> For example, the B's leg goes to park(), and then you hangup A and
>> bridge the C's session to B. Then you can also copy important
>> variables between channels via uuid_getvar and uuid_setvar.
>>
>> Also mod_conference might be of help, although it would put extra load
>> on the CPU.
>>
>>
>>
>>
>> On Mon, Aug 8, 2016 at 4:35 PM, Colin Morelli <colin.morelli at gmail.com>
>> wrote:
>> > Hey all,
>> >
>> > I asked this question a little while back and didn't get a response but
>> > I
>> > worked around the issue for a while so I had never followed up. Now I'm
>> > facing some other issues and would like to see if there's an answer to
>> > this
>> > out there (or if it needs to be built).
>> >
>> > I'm looking to get behavior like the "pickup" channel, but at any point
>> > during a call. Say I have channel A on a call with channel B. Channel C
>> > calls, and I want it to take the place of A such that C is now talking
>> > to B.
>> > In this particular case, intercept could work, but I have two issues
>> > with
>> > that:
>> >
>> > 1. I would like to copy all channel vars from A to C
>> > 2. I would like to be able to do the same thing at any point during a
>> > call.
>> > Even if A is not currently bridged to another endpoint. As I understand,
>> > intercept connects you with an existing call, it doesn't replace
>> > anything.
>> > So logically it would only work when there's another endpoint to bridge
>> > you
>> > to.
>> >
>> > Essentially, I want to swap sessions. Have everything that A is doing
>> > replaced with C, and drop A. This actually appears to be what the pickup
>> > channel does (I have noticed all channel vars are copied), but pickup
>> > only
>> > works during bridging.
>> >
>> > Is this possible to do?
>> >
>> > Best,
>> > Colin
>> >
>> >
>> > _________________________________________________________________________
>> > Professional FreeSWITCH Consulting Services:
>> > consulting at freeswitch.org
>> > http://www.freeswitchsolutions.com
>> >
>> > Official FreeSWITCH Sites
>> > http://www.freeswitch.org
>> > http://confluence.freeswitch.org
>> > http://www.cluecon.com
>> >
>> > FreeSWITCH-users mailing list
>> > FreeSWITCH-users at lists.freeswitch.org
>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> > http://www.freeswitch.org
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list