• Anthony Minessale's avatar
    more event stuff · ab0b99eb
    Anthony Minessale 提交于
    you should now be able to bind an event handler to a 
    paticiular file or function not just a paticular event
    when using the custom event 
    
    like "file:somefile.c"
    or "func:somefunc"
    
    also events now have headers which can be added 
    with varargs and should be created and delivered with api calls
    
    
    switch_event *event;
    
    regular event:
    if (switch_event_create(&event, SWITCH_EVENT_STARTUP) == SWITCH_STATUS_SUCCESS) {
    	switch_event_add_header(event, "event_info", "System Ready");
    	switch_event_fire(&event);
    }
    
    custom event:
    if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, "some_subclass_string") == SWITCH_STATUS_SUCCESS) {
    	switch_event_add_header(event, "event_info", "hello world %d", 42);
    	switch_event_fire(&event);
    } 
    
    switch_event_add_header(event, "test %d", 42);
    
    also you can serialize and event into a buffer in
    a printable/transferrable format with optional body
    
    char buf[1024];
    
    with body:
    switch_event_serialize(event, buf, sizeof(buf), "This is a body my favorite number is %d", 42);
    
    no body:
    switch_event_serialize(event, buf, sizeof(buf), NULL);
    
    
    
    
    
    
    git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@173 d0543943-73ff-0310-b7d9-9358b9ac24b2
    ab0b99eb
名称
最后提交
最后更新
conf 正在载入提交数据...
libs 正在载入提交数据...
src 正在载入提交数据...
w32/vsnet 正在载入提交数据...
AUTHORS 正在载入提交数据...
COPYING 正在载入提交数据...
ChangeLog 正在载入提交数据...
INSTALL 正在载入提交数据...
Makefile.am 正在载入提交数据...
Makefile.in 正在载入提交数据...
NEWS 正在载入提交数据...
README 正在载入提交数据...
TODO 正在载入提交数据...
aclocal.m4 正在载入提交数据...
compile 正在载入提交数据...
config.guess 正在载入提交数据...
config.h.in 正在载入提交数据...
config.sub 正在载入提交数据...
configure 正在载入提交数据...
configure.in 正在载入提交数据...
configure.scan 正在载入提交数据...
depcomp 正在载入提交数据...
generic_mod.mk 正在载入提交数据...
install-sh 正在载入提交数据...
ltmain.sh 正在载入提交数据...
missing 正在载入提交数据...
mkinstalldirs 正在载入提交数据...
modmake.sh 正在载入提交数据...
modules.conf 正在载入提交数据...
modules.conf.in 正在载入提交数据...