fix some issues in httapi record parser

This commit is contained in:
Anthony Minessale 2012-08-23 17:49:46 -05:00
parent a4216351c0
commit f34085965c
1 changed files with 5 additions and 3 deletions

View File

@ -229,7 +229,7 @@ SWITCH_STANDARD_API(httapi_api_function)
static switch_status_t digit_action_callback(switch_ivr_dmachine_match_t *match)
{
action_binding_t *action_binding = (action_binding_t *) match->user_data;
action_binding->client->matching_action_binding = action_binding;
action_binding->match_digits = switch_core_strdup(action_binding->client->pool, match->match_digits);
@ -996,7 +996,6 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
action_binding->action = (char *) switch_xml_attr(bind, "action");
action_binding->error_file = (char *) error_file;
action_binding->parent = top_action_binding;
switch_ivr_dmachine_bind(dmachine, action_binding->realm, action_binding->input, 0, digit_action_callback, action_binding);
bind = bind->next;
}
@ -1022,6 +1021,10 @@ static switch_status_t parse_record(const char *tag_name, client_t *client, swit
status = switch_ivr_record_file(client->session, &fh, tmp_record_path, args, record_limit);
}
if (switch_channel_ready(client->channel)) {
status = SWITCH_STATUS_SUCCESS;
}
if (client->matching_action_binding) {
if (client->matching_action_binding->action) {
sub_action = client->matching_action_binding->action;
@ -1326,7 +1329,6 @@ static void cleanup_attachments(client_t *client)
for (hp = client->params->headers; hp; hp = hp->next) {
if (!strncasecmp(hp->name, "attach_file:", 12)) {
if (switch_file_exists(hp->value, client->pool) == SWITCH_STATUS_SUCCESS) {
printf("DELETE %s\n", hp->value);
unlink(hp->value);
}
}