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

Dennis odermann at googlemail.com
Fri Oct 17 05:45:26 PDT 2008


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
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.

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

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

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

More information about the FreeSWITCH-users mailing list