Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] sending custom events from event_socket, channel_variable_changed event?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
anthony.minessale at g...
Guest





PostPosted: Tue Sep 15, 2009 2:28 pm    Post subject: [Freeswitch-users] sending custom events from event_socket, Reply with quote

I think we can't do it just because nobody needed it.
I added a patch to r14874 to allow you to add a "unique-id" header to the sendevent command
that should allow you to address and event right to a particular session rather than fire the event.


On Tue, Sep 15, 2009 at 12:08 PM, Benedikt Fraunhofer <fraunhofer.lists.freeswitch-001@traced.net (fraunhofer.lists.freeswitch-001@traced.net)> wrote:
Quote:
Hello *,

while trying to figure out how to send custom events from mod_socket
with "sendmsg" (like a telnet connection or something) i only found
how to do that from within javascript (with e.fire() and stuff).

So... first of all, how's the correct syntax to do that from the
event_socket? the wiki states
---
 sendmsg <uuid>

 Send a message to the call of given uuid (call-command execute or
hangup), see examples
 below.
---


Is there a secret syntax i missed how to send "CUSTOM" events?

I tried to work-around that by setting a channel-variable and then
calling the info-app. That way, a channel_execute event is fired and
shows up in my event_socket-app.
If there's a prettier way... please ignore the following up to the
<snipp> mark Smile

so it looked to me that i can only send "command" messages and looking
at the sources i found that mod_socket will hard-wire the event-name
to "SWITCH_EVENT_COMMAND" (in read_packet() in
./mod/event_handlers/mod_event_socket/mod_event_socket.c). If i
understand correctly how e.g.. the mod_spidermonkey-bindings enqueue
events, the event-name is taken from the user and can therefor be
"CUSTOM" (looks like it's being looked up in the
switch_event_types_t-enum).
---
                       if (switch_name_event(ename, &etype) !=
SWITCH_STATUS_SUCCESS) {
                               switch_log_printf(SWITCH_CHANNEL_LOG,
SWITCH_LOG_WARNING, "Unknown event %s\n", ename);
                               *rval = BOOLEAN_TO_JSVAL(JS_FALSE);
                               return JS_TRUE;
                       }

                       if (etype == SWITCH_EVENT_CUSTOM) {
[...]
 if (switch_event_create_subclass(&event, etype, subclass_name) !=
SWITCH_STATUS_SUCCESS) {

---


If it's currently not possible, do you think this could be useful, too?
I thought a bit about the syntax and came up with this idea to not
break compatibility, but feel free to change that, you know it better
Smile
if you want to send an event that's not COMMAND, use "event-name:
CUSTOM" as the first line after the "sendmsg [uuid]" and change the
event-name (if that's possible) of the event already created by
read_packet() or reconstruct the event or ...

<snipp>

Just another idea..... that could become handy is if there would be an
event "CHANNEL_VAR_CHANGED", fired/enqueued by setvar(),
setvar_multi() and friends. But as i write this i admit that one will
be overwhelmed by the setvar massacre for example bridge() would do to
set "disposition"-variables... Just a thought.

Cheers
 Beni.

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org (FreeSWITCH-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale@hotmail.com ([email]MSN%3Aanthony_minessale@hotmail.com[/email])
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com ([email]PAYPAL%3Aanthony.minessale@gmail.com[/email])
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888@conference.freeswitch.org ([email]sip%3A888@conference.freeswitch.org[/email])
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org ([email]googletalk%3Aconf%2B888@conference.freeswitch.org[/email])
pstn:213-799-1400
Back to top
fraunhofer.lists.frees...
Guest





PostPosted: Tue Sep 15, 2009 4:05 pm    Post subject: [Freeswitch-users] sending custom events from event_socket, Reply with quote

Hi Anthony,

2009/9/15 Anthony Minessale <anthony.minessale@gmail.com>:

Quote:
I added a patch to r14874 to allow you to add a "unique-id" header to the
sendevent command
that should allow you to address and event right to a particular session
rather than fire the event.

thx! While riding the train back from work i thought i could've missed
that what i wanted to achieve was possible with sendevent instead of
sendmsg but your reply made me calm down Smile

I won't be able to give it a try until this Friday, but I'll report
back if this is the "new" way to send CUSTOM events from mod_event to
mod_event and pay the wiki tax, accordingly Smile

Thx again!
Beni.

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services