There is also an event socket library written in C called esl that is in the fs tree in the libs directory.<br>This has the ability to establish connections both inbound and outbound from FS.<br><br>There is also a perl module FreeSWITCH::Client that mr collins may be interested in in the tree as well.<br>
<br><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 7:12 AM, Raul Fragoso <span dir="ltr"><<a href="mailto:raul@etellicom.com">raul@etellicom.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In addition do David's suggestion, you probably want to have your<br>
application to watch for some specific events after the call is<br>
originated and take action based on them. For example, you could watch<br>
for the CHANNEL_ANSWER event and play some audio file waiting for some<br>
digit, which is generated by the DTMF event.<br>
To watch only for those specific events, you should do the following<br>
just after authentication (still using Perl as an example, but the<br>
mod_event_socket is language agnostic), then you will receive those<br>
events from FreeSWITCH through the socket stream:<br>
<br>
...<br>
<div class="Ih2E3d">print $sock "auth XXX\n\n";<br>
</div>print $sock "event plain CHANNEL_ANSWER DTMF\n\n";<br>
...<br>
<br>
To see a list of available events, please look at the following wiki<br>
pages:<br>
<a href="http://wiki.freeswitch.org/wiki/Mod_event_socket#event" target="_blank">http://wiki.freeswitch.org/wiki/Mod_event_socket#event</a><br>
<a href="http://wiki.freeswitch.org/wiki/Event_list" target="_blank">http://wiki.freeswitch.org/wiki/Event_list</a><br>
<br>
Regards,<br>
<font color="#888888"><br>
Raul<br>
</font><div><div></div><div class="Wj3C7c"><br>
On Tue, 2009-02-03 at 09:46 +0000, David Knell wrote:<br>
> Hi Nik,<br>
><br>
><br>
> Here's a snipped in Perl that launches an outbound call:<br>
><br>
><br>
> if (my $sock = IO::Socket::INET->new(Proto =>'tcp', PeerAddr =><br>
> '127.0.0.1', PeerPort => 8021)) {<br>
> print $sock "auth XXX\n\n";<br>
> print $sock "api originate {softivr_id=$siid,src_softivr_id=<br>
> $siid,softivr_outdial=true}sofia/frombt/$<a href="mailto:ntd@1.2.3.4">ntd@1.2.3.4</a> $service\n\n";<br>
> $sock->close();<br>
> }<br>
><br>
><br>
> - it does no error checking or anything, but (line by line) it:<br>
> - opens a socket to the event socket interface<br>
> - authenticates<br>
> - issues an originate which dials out to the number in $ntd. The<br>
> bits in {} set a bunch of variables on the channel, which are used by<br>
> the software which processes the call later on. The call is linked to<br>
> the extension in $service - FS looks this up in the dialplan - which<br>
> handles our end.<br>
> - closes the socket<br>
><br>
><br>
> Cheers --<br>
><br>
><br>
> Dave<br>
><br>
><br>
><br>
> > Thanks for that, coming from a C++ background it's a refreshing<br>
> > change to be looking at something that seems logical and efficient.<br>
> ><br>
> > I'd briefly looked at the event socket and wondered if that was the<br>
> > way to go. I presume that there's some sort of event generation<br>
> > that can trigger and external process as well somewhere, though all<br>
> > I need to do is update mysql (hopefully using some sort of pooled<br>
> > connection)<br>
> ><br>
> > I'm not using a TDM card, I have a direct interconnect with the PSTN<br>
> > breakout provider with 1,500 channels available to me. I'm finding<br>
> > Asterisk proving to be less than stable at high call volumes and<br>
> > load values spike at more than 100 calls with billing/accounting in<br>
> > place, hence my interest in FS. The only thing that's concerning me<br>
> > is XML at the moment. Lots of code and very wordy. I'm sure I'll<br>
> > appreciate why XML given time<br>
> ><br>
> > Regards,<br>
> ><br>
> ><br>
> > ____________________________________________________________________<br>
> > From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>] On Behalf Of Michael S Collins<br>
> > Sent: 03 February 2009 01:17<br>
> > To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
> > Subject: Re: [Freeswitch-users] Generating calls from external<br>
> > source<br>
> ><br>
> > Nik,<br>
> ><br>
> > Welcome to FreeSWITCH! The short answer is "yes, FS can do that."<br>
> > The first thing that you should do is unlearn "the Asterisk way" of<br>
> > thinking. Usually there is an elegant way of doing things in FS that<br>
> > wasn't possible in Ast.<br>
> ><br>
> > I would recommend that you start by looking at the event socket,<br>
> > which is somewhat analogous to the AMI only cooler. :) I have<br>
> > personally done something similar to this using the event socket and<br>
> > a Perl script. The key is to learn the syntax of the originate<br>
> > command. (definitely hit the wiki and IRC channel)<br>
> > Are you using TDM cards for this? Just curious.<br>
> ><br>
> > -MC (IRC nick: mercutioviz)<br>
> ><br>
> > Sent from my iPhone<br>
> ><br>
> > On Feb 2, 2009, at 3:35 PM, "Nik Middleton"<br>
> > <<a href="mailto:nik.middleton@noblesolutions.co.uk">nik.middleton@noblesolutions.co.uk</a>> wrote:<br>
> > > Hi Guys,<br>
> > ><br>
> > > As a long time Asterisk user, I'm looking into freeswitch as an<br>
> > > alternative mainly due to (list multiple reasons here)<br>
> > ><br>
> > > Can anyone give me a pointer as to how I would achieve the<br>
> > > following?<br>
> > ><br>
> > > I need to replicate an emergency broadcast system currently<br>
> > > running under Asterisk.<br>
> > ><br>
> > > At the moment, I run through a Mysql database and using the<br>
> > > manager API, issues an Originate command to dial a number.<br>
> > ><br>
> > > When the call is answered, a message is played, and the recipient<br>
> > > has the option of hitting a digit to confirm receipt. I then call<br>
> > > an AGI script to update the database.<br>
> > ><br>
> > > Is this fairly easy to do in Freeswitch?<br>
> > ><br>
> > > Not looking for code, just some pointers as to what's available to<br>
> > > do the above /<br>
> > ><br>
> > > Regards,<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>
> > 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>
> _______________________________________________<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><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>