[Freeswitch-users] Generating calls from external source
Nik Middleton
nik.middleton at noblesolutions.co.uk
Tue Feb 3 08:53:20 PST 2009
Are you suggesting that I should process the call externally instead of
using the dialplan? That would be neat as the audio file select could
be driven from the db select for the number. I presume that I could
also bridge the call to another number as well dependant on DTMF
selection?
Regards
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Raul
Fragoso
Sent: 03 February 2009 13:12
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Generating calls from external source
In addition do David's suggestion, you probably want to have your
application to watch for some specific events after the call is
originated and take action based on them. For example, you could watch
for the CHANNEL_ANSWER event and play some audio file waiting for some
digit, which is generated by the DTMF event.
To watch only for those specific events, you should do the following
just after authentication (still using Perl as an example, but the
mod_event_socket is language agnostic), then you will receive those
events from FreeSWITCH through the socket stream:
...
print $sock "auth XXX\n\n";
print $sock "event plain CHANNEL_ANSWER DTMF\n\n";
...
To see a list of available events, please look at the following wiki
pages:
http://wiki.freeswitch.org/wiki/Mod_event_socket#event
http://wiki.freeswitch.org/wiki/Event_list
Regards,
Raul
On Tue, 2009-02-03 at 09:46 +0000, David Knell wrote:
> Hi Nik,
>
>
> Here's a snipped in Perl that launches an outbound call:
>
>
> if (my $sock = IO::Socket::INET->new(Proto =>'tcp', PeerAddr =>
> '127.0.0.1', PeerPort => 8021)) {
> print $sock "auth XXX\n\n";
> print $sock "api originate {softivr_id=$siid,src_softivr_id=
> $siid,softivr_outdial=true}sofia/frombt/$ntd at 1.2.3.4 $service\n\n";
> $sock->close();
> }
>
>
> - it does no error checking or anything, but (line by line) it:
> - opens a socket to the event socket interface
> - authenticates
> - issues an originate which dials out to the number in $ntd. The
> bits in {} set a bunch of variables on the channel, which are used by
> the software which processes the call later on. The call is linked to
> the extension in $service - FS looks this up in the dialplan - which
> handles our end.
> - closes the socket
>
>
> Cheers --
>
>
> Dave
>
>
>
> > Thanks for that, coming from a C++ background it's a refreshing
> > change to be looking at something that seems logical and efficient.
> >
> > I'd briefly looked at the event socket and wondered if that was the
> > way to go. I presume that there's some sort of event generation
> > that can trigger and external process as well somewhere, though all
> > I need to do is update mysql (hopefully using some sort of pooled
> > connection)
> >
> > I'm not using a TDM card, I have a direct interconnect with the PSTN
> > breakout provider with 1,500 channels available to me. I'm finding
> > Asterisk proving to be less than stable at high call volumes and
> > load values spike at more than 100 calls with billing/accounting in
> > place, hence my interest in FS. The only thing that's concerning me
> > is XML at the moment. Lots of code and very wordy. I'm sure I'll
> > appreciate why XML given time
> >
> > Regards,
> >
> >
> > ____________________________________________________________________
> > From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
Michael S Collins
> > Sent: 03 February 2009 01:17
> > To: freeswitch-users at lists.freeswitch.org
> > Subject: Re: [Freeswitch-users] Generating calls from external
> > source
> >
> > Nik,
> >
> > Welcome to FreeSWITCH! The short answer is "yes, FS can do that."
> > The first thing that you should do is unlearn "the Asterisk way" of
> > thinking. Usually there is an elegant way of doing things in FS that
> > wasn't possible in Ast.
> >
> > I would recommend that you start by looking at the event socket,
> > which is somewhat analogous to the AMI only cooler. :) I have
> > personally done something similar to this using the event socket and
> > a Perl script. The key is to learn the syntax of the originate
> > command. (definitely hit the wiki and IRC channel)
> > Are you using TDM cards for this? Just curious.
> >
> > -MC (IRC nick: mercutioviz)
> >
> > Sent from my iPhone
> >
> > On Feb 2, 2009, at 3:35 PM, "Nik Middleton"
> > <nik.middleton at noblesolutions.co.uk> wrote:
> > > Hi Guys,
> > >
> > > As a long time Asterisk user, I'm looking into freeswitch as an
> > > alternative mainly due to (list multiple reasons here)
> > >
> > > Can anyone give me a pointer as to how I would achieve the
> > > following?
> > >
> > > I need to replicate an emergency broadcast system currently
> > > running under Asterisk.
> > >
> > > At the moment, I run through a Mysql database and using the
> > > manager API, issues an Originate command to dial a number.
> > >
> > > When the call is answered, a message is played, and the recipient
> > > has the option of hitting a digit to confirm receipt. I then call
> > > an AGI script to update the database.
> > >
> > > Is this fairly easy to do in Freeswitch?
> > >
> > > Not looking for code, just some pointers as to what's available to
> > > do the above /
> > >
> > > Regards,
> > > _______________________________________________
> > > 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
> > _______________________________________________
> > 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
> >
>
>
> _______________________________________________
> 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
_______________________________________________
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
More information about the FreeSWITCH-users
mailing list