[Freeswitch-users] Call state notifications

Michael Collins msc at freeswitch.org
Thu Apr 14 21:12:10 MSD 2011


Rogelio,

Are you trying to make a single web page that shows the status of multiple
calls? If so then you probably want what we call "inbound" event socket
versus the "outbound" event socket that you described below. (Inbound and
outbound are from the perspective of FreeSWITCH, so when you have a dialplan
with the socket app it makes an "outbound" socket connection to your program
that is listening on the IP/port...)

If you want to sit and watch the event socket and see all the channel state
change events then I recommend a few things:

#1 - read up on the event socket on the wiki, especially the event socket
commands like "filter"
#2 - get a feel for what events come down the pipe by using fs_cli:
  open fs_cli
  type "/log 0" to turn off logging
  type "/events plain all" to turn on events

Just sit and watch the console. You'll be amazed (and overwhelmed) at all of
the events and information that come to you.

#3 - See if you can set a filter to get only the events you want. While
still at the fs_cli and while watching all the events come to you, try
typing this: "/filter Event-Name CHANNEL_STATE_CHANGE"

That will filter out everything *except* channel state changes. Then make a
call and watch the screen. Do stuff like transfers and hangups, etc. and see
what the events look like.

If that all seems like too much then you can cheat and just send a "show
channels" every 2 seconds and parse the results. ;)

Have fun!
-MC

On Wed, Apr 13, 2011 at 8:30 PM, Rogelio Perez <rogelio.perez at gmail.com>wrote:

> > Event sockets is what you want....
>
> Thanks Ken, it looks like Event Sockets will do the job, but I'm not sure
> how.
> I'm testing with netcat listening on port 8084, and then I've managed to
> connect to it by inserting this line on the dialplan:
>
> <action application="socket" data="127.0.0.1:8084 async full"/>
>
> Since I dont need to control the call but only receive notification events
> about the channel state changes I assume I have to send the command
> "myevents\n\n\" and the pass the variable socket_resume:true back, but this
> doesnt seem to be working.
>
> sendmsg
> call-command: execute
> execute-app-name: myevents\n\n\
> socket_resume:true
>
>
> This is my first attempt to write an application for FS so I need some
> guidance.
> Thanks!
>
>
>
>
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110414/887c484c/attachment.html 


More information about the FreeSWITCH-users mailing list