[Freeswitch-users] Erlang Receive from FreeSWITCH mod_erlang_event

Seven Du dujinfang at gmail.com
Mon Jul 12 18:25:20 PDT 2010


it has inbound and outbound mode just as in event_socket

For inbound, means an erlang process must connect to freeswitch and
register events it want to receive

For outbound, it also has two way to receive events

1)  You start a process in erlang and route the call to that process in dialplan

     <action application="erlang" data="myhandler mynode at myserver"/>

2) freeswitch can start a process using rpc:call for each call

    <action application="erlang" data="myhandler:launch mynode at myserver"/>

Sure there's another way to tell freeswitch to find an erlang process,
check the wiki for detail:
    <action application="erlang" data="myhandler:! mynode at server"/>

In outbound mode, only events happend on the specified channel( the
same UUID) will send to erlang. But it will send ALL events with that
UUID. To be clear:

1) Inbound, freeswitch send all events matching event-type you
registered, say channel::hangup

2) Outbound, freeswitch send all events related to a channel which you
routed to erlang, all events have the same UUID.

You can send multi-channel to one erlang process in outbound mode, say
you may want one erlang process to handle both the a-leg and b-leg.


2010/7/13 David Swardstrom <dswardstrom at remotelink.com>:
> I see by the Wiki, that if the Erlang application wants to receive any events
> from FreeSWITCH, it must provide a single receiver for all events.
> It would then have to distribute the events.
>
> However, the situation does not seem to be obvious for receiving responses to
> API requests.
>
> If Erlang Process A makes API call C1 and Process B also makes API call C2.
> Will the response to C1 be sent to the receive entry for Process A and the
> response to C2 be sent to the receive entry for process B?
>

API call can get API respond from freeswitch(either ok or other fails
message) but has nothing to do with events.


> Regards,
> Paul David Swardstrom
>
>
> _______________________________________________
> 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
>



-- 
Blog: http://www.dujinfang.com
Proj:  http://www.freeswitch.org.cn



More information about the FreeSWITCH-users mailing list