mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
adjustments to the core do a make sure
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3504 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -570,7 +570,7 @@ static void enum_app_function(switch_core_session_t *session, char *data)
|
||||
char vbuf[1024] = "";
|
||||
char *rbp = rbuf;
|
||||
switch_size_t l = 0, rbl = sizeof(rbuf);
|
||||
uint32_t cnt = 0;
|
||||
uint32_t cnt = 1;
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
assert(channel != NULL);
|
||||
@@ -583,10 +583,21 @@ static void enum_app_function(switch_core_session_t *session, char *data)
|
||||
dest = argv[0];
|
||||
root = argv[1] ? argv[1] : globals.root;
|
||||
if (enum_lookup(root, data, &results) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_hash_index_t *hi;
|
||||
void *vval;
|
||||
const void *vvar;
|
||||
|
||||
for (hi = switch_channel_variable_first(channel, switch_core_session_get_pool(session)); hi; hi = switch_hash_next(hi)) {
|
||||
switch_hash_this(hi, &vvar, NULL, &vval);
|
||||
if (vvar && !strncmp(vvar, "enum_", 5)) {
|
||||
switch_channel_set_variable(channel, (char *) vvar, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
for(rtp = globals.route_order; rtp; rtp = rtp->next) {
|
||||
for(rp = results; rp; rp = rp->next) {
|
||||
if (!strcmp(rtp->service, rp->service)) {
|
||||
snprintf(vbuf, sizeof(vbuf), "enum_route_%d", ++cnt);
|
||||
snprintf(vbuf, sizeof(vbuf), "enum_route_%d", cnt++);
|
||||
switch_channel_set_variable(channel, vbuf, rp->route);
|
||||
|
||||
snprintf(rbp, rbl, "%s|", rp->route);
|
||||
@@ -596,6 +607,8 @@ static void enum_app_function(switch_core_session_t *session, char *data)
|
||||
}
|
||||
}
|
||||
}
|
||||
snprintf(vbuf, sizeof(vbuf), "%d", cnt);
|
||||
switch_channel_set_variable(channel, "enum_route_count", vbuf);
|
||||
*(rbuf+strlen(rbuf)-1) = '\0';
|
||||
switch_channel_set_variable(channel, "enum_auto_route", rbuf);
|
||||
free_results(&results);
|
||||
|
||||
@@ -862,14 +862,14 @@ static JSBool session_recordfile(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
}
|
||||
|
||||
if (argc > 4) {
|
||||
int32_t thresh;
|
||||
JS_ValueToInt32(cx, argv[4], &(int32)thresh);
|
||||
int32 thresh;
|
||||
JS_ValueToInt32(cx, argv[4], &thresh);
|
||||
fh.thresh = thresh;
|
||||
}
|
||||
|
||||
if (argc > 5) {
|
||||
int32_t silence_hits;
|
||||
JS_ValueToInt32(cx, argv[5], &(int32)silence_hits);
|
||||
int32 silence_hits;
|
||||
JS_ValueToInt32(cx, argv[5], &silence_hits);
|
||||
fh.silence_hits = silence_hits;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user