mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
Finalization of speech detect interface and API
This changes the core to have the necessary tools to create a speech detection interface. It also changes the code in javascript (mod_spidermonkey) there are a few api changes in how it handles callbacks It also adds grammars as a system dir to store asr grammars git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3291 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -393,10 +393,12 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises
|
||||
switch_channel_t *caller_channel;
|
||||
switch_core_session_t *caller_session;
|
||||
char *argv[7] = {0};
|
||||
int x, argc = 0;
|
||||
int i = 0, x, argc = 0;
|
||||
char *aleg, *exten, *dp, *context, *cid_name, *cid_num;
|
||||
uint32_t timeout = 60;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||
uint8_t machine = 1;
|
||||
|
||||
if (isession) {
|
||||
stream->write_function(stream, "Illegal Usage\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -414,13 +416,18 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises
|
||||
argv[x] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!strcasecmp(argv[0], "machine")) {
|
||||
machine = 1;
|
||||
i++;
|
||||
}
|
||||
|
||||
aleg = argv[0];
|
||||
exten = argv[1];
|
||||
dp = argv[2];
|
||||
context = argv[3];
|
||||
cid_name = argv[4];
|
||||
cid_num = argv[5];
|
||||
aleg = argv[i++];
|
||||
exten = argv[i++];
|
||||
dp = argv[i++];
|
||||
context = argv[i++];
|
||||
cid_name = argv[i++];
|
||||
cid_num = argv[i++];
|
||||
|
||||
if (!dp) {
|
||||
dp = "XML";
|
||||
@@ -435,7 +442,11 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises
|
||||
}
|
||||
|
||||
if (switch_ivr_originate(NULL, &caller_session, &cause, aleg, timeout, &noop_state_handler, cid_name, cid_num, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
stream->write_function(stream, "Cannot Create Outgoing Channel! [%s]\n", aleg);
|
||||
if (machine) {
|
||||
stream->write_function(stream, "fail: %s", switch_channel_cause2str(cause));
|
||||
} else {
|
||||
stream->write_function(stream, "Cannot Create Outgoing Channel! [%s] cause: %s\n", aleg, switch_channel_cause2str(cause));
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -467,7 +478,13 @@ static switch_status_t originate_function(char *cmd, switch_core_session_t *ises
|
||||
} else {
|
||||
switch_ivr_session_transfer(caller_session, exten, dp, context);
|
||||
}
|
||||
stream->write_function(stream, "Created Session: %s\n", switch_core_session_get_uuid(caller_session));
|
||||
|
||||
if (machine) {
|
||||
stream->write_function(stream, "success: %s\n", switch_core_session_get_uuid(caller_session));
|
||||
} else {
|
||||
stream->write_function(stream, "Created Session: %s\n", switch_core_session_get_uuid(caller_session));
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user