mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 16:15:04 +00:00
let you pick event type
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3169 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
900ad177d6
commit
2d3ab6b5d8
@ -495,6 +495,21 @@ static switch_status_t parse_command(listener_t *listener, switch_event_t *event
|
||||
|
||||
|
||||
if (!strncasecmp(cmd, "sendevent", 9)) {
|
||||
char *ename;
|
||||
strip_cr(cmd);
|
||||
|
||||
ename = cmd + 9;
|
||||
if (*ename == '\r' || *ename == '\n') {
|
||||
ename = NULL;
|
||||
}
|
||||
|
||||
if (ename) {
|
||||
switch_event_types_t etype;
|
||||
if (switch_name_event(ename, &etype) == SWITCH_STATUS_SUCCESS) {
|
||||
event->event_id = etype;
|
||||
}
|
||||
}
|
||||
|
||||
switch_event_fire(&event);
|
||||
snprintf(reply, reply_len, "+OK");
|
||||
goto done;
|
||||
|
Loading…
x
Reference in New Issue
Block a user