[Freeswitch-dev] preAnswer : API x JS

Daniel Eli dcelink at yahoo.com
Thu Apr 10 10:46:41 EDT 2008


Hi, thanks for reply.

Well, my problem is not really how to generate 180 or
183(early media) code.
What I really want is to do my application to control
the call flow.
My application connects the FS using the
mod_event_socket, port 8021.
In this way, my application receives the leg A, read
the channel variables, 
and generate an outgoing leg (B). When leg B rings
(18x), my application must
generate the 18x code to the leg A. When leg B
answers, my application bridges 
the two legs in a call. This means that FS may not
control the call flow.
I was configured in the dialplan
({FSROOT}/conf/dialplan/default.xml)
a rule to route any incomming call to the sleep
application. 
Is the one way that I found to force the FS to do
nothing on the call flow.
I believe that the following msc shows my real needs.

 UAA       UAB       FS       MYAPP
  |         |         |         |
00|---------+-------->|         | INVITE
01|<--------+---------|         | 100 (trying)
02|         |         |-------->| EVENT CHANNEL A
03|         |         |<--------| ORIGINATE LEG B
04|         |<--------|         | INVITE
05|         |-------->|         | 100 (trying)
06|         |-------->|         | 180 or 183
(whatever)
07|         |         |-------->| EVENT CHANNEL B
08|         |         |<--------| GENERATE 18x TO LEG
B (how do I do?)
09|<--------+---------|         | 18x code
10|         |-------->|         | 200 OK (answer)
11|         |         |-------->| EVENT CHANNEL B
12|         |         |<--------| BRIDGE CHANNEL A
WITH CHANNEL B
13|<--------+---------|         | 200 OK (answer)

Could you help me on this ?
Best regards.

Daniel.
=======================================================




if you want to send a 180, use the ring_ready
application.

On Wed, Apr 9, 2008 at 10:14 AM, Michael Jerris <mike
at jerris.com> wrote:

> Pre-answer will generate a 183, not a 180.  Which
are you trying to
> do?  This is just a single call leg to the socket
app or what is the
> call flow?
>
>
> Mike
>
> On Apr 9, 2008, at 8:29 AM, Daniel Eli wrote:
>
> > Hi,
> > first of all, congratulations to the FS team.
> > I am trying to control FreeSwitch with a telnet
client
> > using the API.
> > I can't find some way to pre-Answer (code 180) a
> > channel in this interface,
> > like the preAnswer method found in the session
object.
> >
> > Another idea is calling an js script with the API,
> > for example: bgapi jsrun preanswr.js ..., but
there is
> > another problem:
> > the default session object is not created and I
can't
> > find how to get the session object from the uid of
the
> > channel (or from another channel variable).
> > So, is there any way to get one session object
from
> > some channel variable ?
> > Or, is there any way to pre-answer (generate the
180
> > code) the channel with the API ?
> > Could you help me about that?
> >
> > Thanks in advance.
> >
> > Daniel.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
protection around
> > http://mail.yahoo.com
> >
> > _______________________________________________
> > Freeswitch-dev mailing list
> > Freeswitch-dev at lists.freeswitch.org
> >
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> >
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> > http://www.freeswitch.org
>
>
> _______________________________________________
> Freeswitch-dev mailing list
> Freeswitch-dev at lists.freeswitch.org
>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
>
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com
<MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at
gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at
conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at
conference.freeswitch.org<googletalk%3Aconf%2B888 at
conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20080409/02b0de5c/attachment.html 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Freeswitch-dev mailing list