Send event from javascript?
Hi, I am trying to fire a custom event from javascript, and found following code snippet: ===================== var msg = "Hello, welcome to the FreeSWITCH demo application please enter some text into the chat box"; e = new Event("custom", "message"); e.addBody(msg); session.sendEvent(e); ====================== But, i don't seems to receive the custom event on the event_socket side. Is this still a valid way to fire event from javascripts? I can't seem to find any ref except above snippet on wiki or mailing list. Best Regards, Johny K.
that sends the message over the call like a chat message. if you want to fire the event to event socket change: session.sendEvent(e); to e.fire(); On Wed, Sep 24, 2008 at 2:40 PM, Johny Kadarisman <jkr888@gmail.com> wrote:
Hi, I am trying to fire a custom event from javascript, and found following code snippet:
===================== var msg = "Hello, welcome to the FreeSWITCH demo application please enter some text into the chat box";
e = new Event("custom", "message"); e.addBody(msg); session.sendEvent(e); ======================
But, i don't seems to receive the custom event on the event_socket side. Is this still a valid way to fire event from javascripts? I can't seem to find any ref except above snippet on wiki or mailing list.
Best Regards, Johny K.
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Got it, Thanks. will also update the wiki. ========================== Content-Length: 608 Content-Type: text/event-plain Event-Subclass: message Event-Name: CUSTOM Core-UUID: 95e16640-7ddf-11dd-adfa-133c220a79a4 FreeSWITCH-Hostname: johny-ubuntu FreeSWITCH-IPv4: 192.168.150.134 FreeSWITCH-IPv6: 127.0.0.1 Event-Date-Local: 2008-09-25%2010%3A38%3A42 Event-Date-GMT: Thu,%2025%20Sep%202008%2014%3A38%3A42%20GMT Event-Date-timestamp: 1222353522769992 Event-Calling-File: mod_spidermonkey.c Event-Calling-Function: event_fire Event-Calling-Line-Number: 673 Event-Subclass: message Event-Subclass-Owner: src/switch_event.c Content-Length: 90 Hello, welcome to the FreeSWITCH demo application please enter some text into the chat box On Wed, Sep 24, 2008 at 7:47 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
that sends the message over the call like a chat message.
if you want to fire the event to event socket
change: session.sendEvent(e); to e.fire();
On Wed, Sep 24, 2008 at 2:40 PM, Johny Kadarisman <jkr888@gmail.com>wrote:
Hi, I am trying to fire a custom event from javascript, and found following code snippet:
===================== var msg = "Hello, welcome to the FreeSWITCH demo application please enter some text into the chat box";
e = new Event("custom", "message"); e.addBody(msg); session.sendEvent(e); ======================
But, i don't seems to receive the custom event on the event_socket side. Is this still a valid way to fire event from javascripts? I can't seem to find any ref except above snippet on wiki or mailing list.
Best Regards, Johny K.
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
_______________________________________________ Freeswitch-dev mailing list Freeswitch-dev@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev http://www.freeswitch.org
participants (2)
-
Anthony Minessale
-
Johny Kadarisman