fix command parser

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1885 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-07-14 21:15:26 +00:00
parent 0d82c97797
commit f45ecee214
1 changed files with 18 additions and 3 deletions

View File

@ -1423,14 +1423,29 @@ static switch_status_t conf_function(char *buf, switch_stream_handle_t *stream)
}
} else if (!strcasecmp(argv[1], "saymember")) {
char *tbuf = NULL, *text, *name;
uint32_t id = atoi(argv[3]);
uint32_t id;
conference_member_t *member;
if (argc > 3) {
id = atoi(argv[3]);
} else {
stream->write_function(stream, "(saymember) Syntax Error!");
goto done;
}
if ((tbuf = strdup(buf))) {
if ((name = strstr(tbuf, "saymember "))) {
name += 10;
text = strchr(name, ' ');
id = atoi(name);
if (*name) {
text = strchr(name, ' ');
id = atoi(name);
} else {
stream->write_function(stream, "(saymember) Syntax Error!");
goto done;
}
if ((member = conference_member_get(conference, id))) {
if (text && conference_member_say(conference, member, text, 0) == SWITCH_STATUS_SUCCESS) {