Discussion:
[Freeswitch-users] Javascript and Events
Fraser Redmond
2010-03-24 20:34:03 UTC
Permalink
I'm trying to get me head round events in Javascript. Looking at this page:
http://wiki.freeswitch.org/wiki/Javascript_Event
...I'd thought I should be able to take the first example and run it in a
call, so that it's listening for all(?) events. Then take the second example
and fire an event.

But nothing is happening. I had a good read through this thread from a year
ago:
http://lists.freeswitch.org/pipermail/freeswitch-users/2009-January/038246.html
...but it seemed to say the resolution was in the event-listener.

In the listener code I changed this:
if (type == "event") {
console_log("notice", "Event: " + event_obj.serialize() + "\n");

}
...to this:
console_log("notice", "something: " + type + "\n");

And nothing comes up at all (unless I press a key for "dtmf")

Does the javascript event listener only listen for events on it's own
session/channel somehow? I'd thought about adding something like this to the
event-firer:
e.addHeader("Unique-ID", "8e187c47-da72-471e-82af-adab0bae9347");

Cheers,
Fraser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100324/f046966e/attachment.html
Michael Collins
2010-03-24 22:15:41 UTC
Permalink
Is this using event socket? Pastebin your script so we can take a look...
-MC
Post by Fraser Redmond
http://wiki.freeswitch.org/wiki/Javascript_Event
...I'd thought I should be able to take the first example and run it in a
call, so that it's listening for all(?) events. Then take the second example
and fire an event.
But nothing is happening. I had a good read through this thread from a year
http://lists.freeswitch.org/pipermail/freeswitch-users/2009-January/038246.html
...but it seemed to say the resolution was in the event-listener.
if (type == "event") {
console_log("notice", "Event: " + event_obj.serialize() + "\n");
}
console_log("notice", "something: " + type + "\n");
And nothing comes up at all (unless I press a key for "dtmf")
Does the javascript event listener only listen for events on it's own
session/channel somehow? I'd thought about adding something like this to the
e.addHeader("Unique-ID", "8e187c47-da72-471e-82af-adab0bae9347");
Cheers,
Fraser
_______________________________________________
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100324/b9788ace/attachment-0001.html
Continue reading on narkive:
Loading...