[Freeswitch-users] Sending an event from Javascript
Brian West
brian.west at mac.com
Mon Jul 23 13:19:17 PDT 2007
Yes I looked at the code.
http://www.freeswitch.org/eg/js/chat_js.txt
That is an example of how to do it.. below are the other methods on
that object from mod_spidermonkey.c
static JSFunctionSpec event_methods[] = {
{"addHeader", event_add_header, 1},
{"getHeader", event_get_header, 1},
{"addBody", event_add_body, 1},
{"getBody", event_get_body, 1},
{"getType", event_get_type, 1},
{"serialize", event_serialize, 0},
{"fire", event_fire, 0},
{"destroy", event_destroy_, 0},
{0}
};
On Jul 23, 2007, at 1:50 PM, Cesar Cepeda wrote:
> Hi,
>
> I'm talking about a JavaScript which is run through the FreeSwitch
> embedded
> engine. I want to know if there is a command or method (perhaps of
> the
> Session object) from which I can send a customized event to the event
> engine.
>
> Thanks
>
> Cesar Cepeda.
>
>> -----Mensaje original-----
>> De: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-
>> users-bounces at lists.freeswitch.org] En nombre de Chris Danielson
>> Enviado el: Lunes, 23 de Julio de 2007 13:07
>> Para: freeswitch-users at lists.freeswitch.org
>> Asunto: Re: [Freeswitch-users] Sending an event from Javascript
>>
>> Just to clear up the question... Are we talking about a JavaScript
>> script
>> that is run through the FreeSwitch embedded engine or are we talking
>> about
>> a web page that calls the event_socket layer via JavaScript. If
>> we are
>> talking about the latter, then Jose, is moving you in the right
>> direction.
>> You can make an asynchronous call to the specified ip and port
>> (listen-ip
>> and listen-port).
>>
>> Ideally, for Asynchronous JavaScript integration I would recommend
>> using
>> the Prototype (www.prototypejs.org) open source library.
>>
>> Kind Regards,
>> Chris
>>
>>> directly is imposible send this information, but you can compose a
>> URL a
>>> manage the keywords and variable and send the info to other page
>> (php,
>>> servlet, jsp or another) to manage the information. Java Script is
>> only to
>>> simple app to manage a view for explorer.
>>>
>>> I recomend that you use Ajax is most powerfull and integrate
>> JavaScript
>>> with
>>> other app and the view is most estetical.
>>>
>>> PD sorry by my english,
>>>
>>>
>>> 2007/7/20, Cesar Cepeda <cesar at auronix.com>:
>>>>
>>>>
>>>>
>>>> Is it possible to send an event to the event_socket interface
>>>> from a
>>>> Javascript script? If so, how is it done?
>>>>
>>>>
>>>>
>>>> Thanks
>>>>
>>>>
>>>>
>>>> Cesar Cepeda.
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> ---
>>> Eng. José R. Barrios R.
>>> Network & Data Manager
>>> TELKUS- COLOMBIA
>>> www.telkus-ip.com
>>> Tels +57 300 8059882
>>> MSN: pepescool at gmail.com
>>> SKYPE: pepescool
>>> _______________________________________________
>>> 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
>>>
>>
>>
>>
>> _______________________________________________
>> 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
>
>
>
> _______________________________________________
> 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
More information about the FreeSWITCH-users
mailing list