[Freeswitch-users] originating a call from an outbound socket app

Hector Geraldino Hector.Geraldino at ip-soft.net
Fri Jun 10 18:00:02 MSD 2011


Thanks for your response Michael.

Finally I found the way of dialing to an external extension. What I did was just open a shell, listen in a port using nc  and tried to originate a call. It worked using the syntax:

originate sofia/internal/5562 at 192.168.23.104 &park

As this is an outbound call (not managed by the socket application) I had to use a new inbound socket connection to connect to FS, make the call, query for the uuid and receive some events (like DTMF among others).  Everything was going great, until I found two issues:


-          The CHANNEL_ANSWER event is always triggered, no matter if the call is actually picked up or not on my phone. I thought that maybe I can use some other event to determine if the call have been answered or not (like CHANNEL_CALLSTATE or CALL_UPDATE), but the additional information on the event headers is the same no matter if it's answered or not.

-          When the call is answered, and the user presses a key to accept the call, the function returns the UUID of this session to the main method. Then I tried to make the bridge between the two calls (the legA call handled by the socket application, and the legB outbound call generated in the application using an inbound connection). I using the command

api uuid_bridge <incoming_uuid> <outbound_uuid>

but this didn't work. Am I missing something here?

Thanks again,
Hector


From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Michael Collins
Sent: Thursday, June 09, 2011 6:13 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] originating a call from an outbound socket app

Also, I don't think this is helping you:
  EslMessage response = sendSyncSingleLineCommand(channel, "myevents");

Look here to see what "myevents" does:
http://wiki.freeswitch.org/wiki/Mod_event_socket#Special_Case_-_.27myevents.27
-MC

On Thu, Jun 9, 2011 at 1:22 PM, Hector Geraldino <Hector.Geraldino at ip-soft.net<mailto:Hector.Geraldino at ip-soft.net>> wrote:
Hi Michael,

Thanks for replying back. I've pasted a sample application on pastebin, the URL is:

http://pastebin.com/MYusWe3V

What I'm trying to do (and have partially accomplished) is:

-Answer the call
- Play a message
- wait for a command (dtmf or voice, this is out of the sample app for the sake of keeping it short & simple)
- originate a new call, wait for it to be answered and depending on an event (dtmf)...
- ...do the bridge or dial another extension.

The extension number is external (managed by a Cisco CCM). If I try to do the bridge from the XML dialplan it works perfect. When I try to do it from an outbound socket java application, anything happens, and almost no information is logged on FS log that I can use to decide what might be happening.

Thanks again for your help. I truly appreciate it.

Hector

From: freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org> [mailto:freeswitch-users-bounces at lists.freeswitch.org<mailto:freeswitch-users-bounces at lists.freeswitch.org>] On Behalf Of Michael Collins
Sent: Thursday, June 09, 2011 12:47 PM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] originating a call from an outbound socket app

I would say that you want to bridge the inbound leg to the outbound leg and use the answer confirmation variables. I recommend you pastebin a simple java app that answers the call and attempts to bridge it and also pastebin the console log. The community will take a look and see if we can help you figure out what is happening.

-MC
On Wed, Jun 8, 2011 at 3:14 PM, Hector Geraldino <Hector.Geraldino at ip-soft.net<mailto:Hector.Geraldino at ip-soft.net>> wrote:
Hi all,

I've been playing with FS around weeks, with some level of success. Right now I'm stuck trying to dial an extension, or to bridge a call to an external extension. Briefly, the scenario is the following:


-          Cisco CCM forwarding SIP calls to FS

-          FS in outbound mode,  forwarding calls to a Java application using freeswitch-esl jar

The java application answers the call, says a dialogue using TTS and receives input using DTFM or speech commands; all this is working pretty well. Now I'm trying to put this call in hold, originate a call to another extension and, depending on the result (call answered, not answered, destination user presses an specific number generating an expected DTMF), I need to bridge both calls and finish the session.

I try several ways to get this done with no luck yet: using api originate to make the call with different arguments ({ignore_early_media,  etc). I even tried to skip this step and just do the bridge between the inbound call and the external extension, but this  didn't work either. I can't see any errors thrown by FS, and the result of the command is +OK, but nothing happens, the external phone never rings. The FS log only says:

[DEBUG] switch_core_session.c:954 Send signal sofia/external/5655 at 192.168.8.1<mailto:5655 at 192.168.8.1> [BREAK] <= this ext/IP address is from the inbound caller, not the one I'm trying to connect to.

My first impression was that I might have something wrong with the originate/bridge parameters. I changed the dialplan XML file to just do the bridge, and it worked like a charm.

<include>
<extension name="test">
        <condition field="destination_number" expression="6114|5121">
<!--    <action application="socket" data="localhost:8044 async full"/>  -->
          <action application="bridge" data="sofia/external/5562 at 192.168.2.14<mailto:5562 at 192.168.2.14>" />
        </condition>
</extension>
</include>

I don't know what path to follow here. I was unable to find relevant examples on google that guides me to solve this little issue. Any advices?

Thanks all,
Hector

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto: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


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110610/49202ca0/attachment-0001.html 


More information about the FreeSWITCH-users mailing list