[Freeswitch-users] Socket inbound or outbound with PHP?

Anthony Minessale anthony.minessale at gmail.com
Fri Oct 17 11:52:36 PDT 2008

On Fri, Oct 17, 2008 at 7:45 AM, Dennis <odermann at googlemail.com> wrote:

> Hi,
> I am new to freeswitch and found out quite a lot of things the past
> days. But there are still many questions left, which I can't figure
> out without some help.
> I want to use freeswitch for a project, where freeswitch should
> communicate with PHP-scripts and receive the messages to different
> events.
> I was told to use socket and found some quite helpful PHP-scripts in
> this mailing list. One was for using socket outbound, one was for
> socket inbound.
> I would like to ask, which direction is the best oder most reliable?
> When using socket outbound, freeswitch connects to the PHP-script, the
> PHP-script forks and is registered to "myevents" (events all seems to
> give me all events from all connections).
> One of the problems I have with "outbound" is, that I won't get all
> events. For example I do not get "hangup", because the socket
> connection seems to die, before freeswitch sends the last command when
> hanging up. With "ringing" the problem seems to be the same.
> I only get a "hangup", when I register to "events all" and have to
> active calls. When one of the two calls hangs up, i can see it by
> printing out all events in the PHP-script.

Good point.  I fixed latest release to linger on the socket until you get
the channel_hangup
event providing you did "myevents"

> When using socket inbound, the PHP-script does not fork and seems to
> handle all events for all calls. What, if a request hangs for one
> call? Do all the other calls have to wait, till the other call is
> killed?

events are not connected to channels at all the events are in their own
backend. and each
event_socket connection has a dedicated thread and it's own copy of all the

> Another thing ist the events "heartbeat". Will I get the  "heartbeat"
> for every single call or just one heartbeat for all calls?

The regular heartbeat event is for the whole system in case you are managing
a connection
to several boxes or you want to be sure the box is up.

There is a per call heartbeat you can enable at a desired interval for calls
with media
flowing through FS.

> I feel that I am missing some basic knowledge about sockets and
> freeswitch. Could someone help to find the right way, please?
> Thanks and kind regards
> Dennis
> _______________________________________________
> 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

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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20081017/7d5beae4/attachment-0002.html 

More information about the FreeSWITCH-users mailing list