danbarua / NEventSocket

A reactive FreeSwitch eventsocket library for Modern .Net
Mozilla Public License 2.0
74 stars 37 forks source link

How do I send uuid_transfer command? #34

Closed Eternal21 closed 8 years ago

Eternal21 commented 8 years ago

I don't see a Transfer method on InboundSocket. I'm basically trying to convert an ongoing call into a conference, so that I can 'conference in' another person. I plan on doing it by transfering both legs into a conference room first. I'm assuming the specific 'Transfer()' function has not been implemented, but the workaround can be running a transfer application via another command? Thanks.

Also - how do I label this issue as a Question (since it's not a bug)?

danbarua commented 8 years ago

Jump in Gitter -> https://gitter.im/danbarua/NEventSocket I'm online for an hour or so

danbarua commented 8 years ago

You can do socket.Api("uuid_transfer", "my_uuid myExtensionOrInlineDialPlanOrWhatever"); - tend to use Api commands for fire-and-forget or await channel.Socket.ExecuteApplication(channel.UUID, "conference", "conference_args"); - this will block until the channel hangs up, and probably throw OperationCanceledException (this is normal on shutdown) We use .ExecuteApplication() when we are wanting to wait for an application to complete with CHANNEL_EXECUTE_COMPLETE

danbarua commented 8 years ago

If it's listed in here https://freeswitch.org/confluence/display/FREESWITCH/mod_commands it's an API command, though BgApi and Originate are wrapped up in helpers to deal with the underlying complexity for you but there's nothing stopping you creating a command string manually and calling that.

If it's in here it's a dialplan application: https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools

Eternal21 commented 8 years ago

Thanks. Didn't see your message yesterday, that was the last thing I posted before logging off for the day. I'll give it a try and post back with the results.

Eternal21 commented 8 years ago

Ok, got it working using the following command:
await _socket.Api("uuid_transfer", _callUuid + " -both 3000");

I'm using the demo dialplan, so extension 3000 executes the following built-in conference:

    <!--
    start a dynamic conference with the settings of the "default" conference profile in conference.conf.xml
    -->                                                                                                                                                       
    <extension name="nb_conferences">
      <condition field="destination_number" expression="^(30\d{2})$">
    <action application="answer"/>
    <action application="conference" data="$1-${domain_name}@default"/>
      </condition>
    </extension>

Now I just need to figure out how to record audio from both.