I think we can't do it just because nobody needed it.<br>I added a patch to r14874 to allow you to add a "unique-id" header to the sendevent command<br>that should allow you to address and event right to a particular session rather than fire the event.<br>
<br><br><div class="gmail_quote">On Tue, Sep 15, 2009 at 12:08 PM, Benedikt Fraunhofer <span dir="ltr"><<a href="mailto:fraunhofer.lists.freeswitch-001@traced.net">fraunhofer.lists.freeswitch-001@traced.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello *,<br>
<br>
while trying to figure out how to send custom events from mod_socket<br>
with "sendmsg" (like a telnet connection or something) i only found<br>
how to do that from within javascript (with e.fire() and stuff).<br>
<br>
So... first of all, how's the correct syntax to do that from the<br>
event_socket? the wiki states<br>
---<br>
sendmsg <uuid><br>
<br>
Send a message to the call of given uuid (call-command execute or<br>
hangup), see examples<br>
below.<br>
---<br>
<br>
<br>
Is there a secret syntax i missed how to send "CUSTOM" events?<br>
<br>
I tried to work-around that by setting a channel-variable and then<br>
calling the info-app. That way, a channel_execute event is fired and<br>
shows up in my event_socket-app.<br>
If there's a prettier way... please ignore the following up to the<br>
<snipp> mark :)<br>
<br>
so it looked to me that i can only send "command" messages and looking<br>
at the sources i found that mod_socket will hard-wire the event-name<br>
to "SWITCH_EVENT_COMMAND" (in read_packet() in<br>
./mod/event_handlers/mod_event_socket/mod_event_socket.c). If i<br>
understand correctly how e.g.. the mod_spidermonkey-bindings enqueue<br>
events, the event-name is taken from the user and can therefor be<br>
"CUSTOM" (looks like it's being looked up in the<br>
switch_event_types_t-enum).<br>
---<br>
if (switch_name_event(ename, &etype) !=<br>
SWITCH_STATUS_SUCCESS) {<br>
switch_log_printf(SWITCH_CHANNEL_LOG,<br>
SWITCH_LOG_WARNING, "Unknown event %s\n", ename);<br>
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);<br>
return JS_TRUE;<br>
}<br>
<br>
if (etype == SWITCH_EVENT_CUSTOM) {<br>
[...]<br>
if (switch_event_create_subclass(&event, etype, subclass_name) !=<br>
SWITCH_STATUS_SUCCESS) {<br>
<br>
---<br>
<br>
<br>
If it's currently not possible, do you think this could be useful, too?<br>
I thought a bit about the syntax and came up with this idea to not<br>
break compatibility, but feel free to change that, you know it better<br>
:)<br>
if you want to send an event that's not COMMAND, use "event-name:<br>
CUSTOM" as the first line after the "sendmsg [uuid]" and change the<br>
event-name (if that's possible) of the event already created by<br>
read_packet() or reconstruct the event or ...<br>
<br>
<snipp><br>
<br>
Just another idea..... that could become handy is if there would be an<br>
event "CHANNEL_VAR_CHANGED", fired/enqueued by setvar(),<br>
setvar_multi() and friends. But as i write this i admit that one will<br>
be overwhelmed by the setvar massacre for example bridge() would do to<br>
set "disposition"-variables... Just a thought.<br>
<br>
Cheers<br>
Beni.<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>