add -bleg to intercept

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8583 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-05-24 17:28:04 +00:00
parent c1bf2c2099
commit 57117acdbc
4 changed files with 64 additions and 4 deletions
+28 -2
View File
@@ -217,10 +217,36 @@ SWITCH_STANDARD_APP(dtmf_bind_function)
}
}
#define INTERCEPT_SYNTAX "<uuid>"
#define INTERCEPT_SYNTAX "[-bleg] <uuid>"
SWITCH_STANDARD_APP(intercept_function)
{
switch_ivr_intercept_session(session, data);
int argc;
char *argv[4] = { 0 };
char *mydata;
char *uuid;
switch_bool_t bleg = SWITCH_FALSE;
if (!switch_strlen_zero(data) && (mydata = switch_core_session_strdup(session, data))) {
if ((argc = switch_separate_string(mydata, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) >= 1) {
if (!strcasecmp(argv[0], "-bleg")) {
if (argv[1]) {
uuid = argv[1];
bleg = SWITCH_TRUE;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", INTERCEPT_SYNTAX);
return;
}
} else {
uuid = argv[0];
}
switch_ivr_intercept_session(session, uuid, bleg);
}
switch_safe_free(mydata);
return;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Usage: %s\n", INTERCEPT_SYNTAX);
}
#define MAX_SPY 3000