diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/ari/resource_channels.c | 4 | ||||
-rw-r--r-- | res/res_agi.c | 24 | ||||
-rw-r--r-- | res/res_pjsip/pjsip_configuration.c | 9 |
3 files changed, 14 insertions, 23 deletions
diff --git a/res/ari/resource_channels.c b/res/ari/resource_channels.c index 30ced1b2f..647344303 100644 --- a/res/ari/resource_channels.c +++ b/res/ari/resource_channels.c @@ -859,7 +859,7 @@ static void ari_channels_handle_originate_with_id(const char *args_endpoint, return; } - snapshot = ast_channel_snapshot_create(chan); + snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(chan)); ast_channel_unlock(chan); if (!ast_strlen_zero(args_app)) { @@ -1086,7 +1086,7 @@ static void ari_channels_handle_snoop_channel( return; } - snapshot = ast_channel_snapshot_create(snoop); + snapshot = ast_channel_snapshot_get_latest(ast_channel_uniqueid(snoop)); ast_ari_response_ok(response, ast_channel_snapshot_to_json(snapshot, NULL)); } diff --git a/res/res_agi.c b/res/res_agi.c index e223603a6..3adf36bac 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1481,11 +1481,11 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, int argc, char to execute based on the setup info */ ast_uri_encode(agi_buffer, ami_buffer, AMI_BUF_SIZE, ast_uri_http); startblob = ast_json_pack("{s: s}", "Env", ami_buffer); - ast_channel_lock(chan); - ast_channel_publish_blob(chan, agi_async_start_type(), startblob); - hungup = ast_check_hangup(chan); - ast_channel_unlock(chan); + ast_channel_publish_cached_blob(chan, agi_async_start_type(), startblob); + + hungup = ast_check_hangup_locked(chan); + for (;;) { /* * Process as many commands as we can. Commands are added via @@ -1529,9 +1529,7 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, int argc, char if (execblob && !ast_strlen_zero(cmd->cmd_id)) { ast_json_object_set(execblob, "CommandId", ast_json_string_create(cmd->cmd_id)); } - ast_channel_lock(chan); - ast_channel_publish_blob(chan, agi_async_exec_type(), execblob); - ast_channel_unlock(chan); + ast_channel_publish_cached_blob(chan, agi_async_exec_type(), execblob); free_agi_cmd(cmd); @@ -1591,9 +1589,7 @@ async_agi_done: ast_speech_destroy(async_agi.speech); } /* notify manager users this channel cannot be controlled anymore by Async AGI */ - ast_channel_lock(chan); - ast_channel_publish_blob(chan, agi_async_end_type(), NULL); - ast_channel_unlock(chan); + ast_channel_publish_cached_blob(chan, agi_async_end_type(), NULL); async_agi_abort: /* close the pipe */ @@ -3665,9 +3661,7 @@ static void publish_async_exec_end(struct ast_channel *chan, int command_id, con "Command", command, "ResultCode", result_code, "Result", result); - ast_channel_lock(chan); - ast_channel_publish_blob(chan, agi_exec_end_type(), blob); - ast_channel_unlock(chan); + ast_channel_publish_cached_blob(chan, agi_exec_end_type(), blob); } static enum agi_result agi_handle_command(struct ast_channel *chan, AGI *agi, char *buf, int dead) @@ -3685,9 +3679,7 @@ static enum agi_result agi_handle_command(struct ast_channel *chan, AGI *agi, ch startblob = ast_json_pack("{s: i, s: s}", "CommandId", command_id, "Command", ami_cmd); - ast_channel_lock(chan); - ast_channel_publish_blob(chan, agi_exec_start_type(), startblob); - ast_channel_unlock(chan); + ast_channel_publish_cached_blob(chan, agi_exec_start_type(), startblob); parse_args(buf, &argc, argv); c = find_command(argv, 0); diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c index 511b61393..ea3326969 100644 --- a/res/res_pjsip/pjsip_configuration.c +++ b/res/res_pjsip/pjsip_configuration.c @@ -1393,8 +1393,8 @@ static int cli_channel_print_header(void *obj, void *arg, int flags) indent = CLI_INDENT_TO_SPACES(context->indent_level); filler = CLI_LAST_TABSTOP - indent - 38; ast_str_append(&context->output_buffer, 0, - "%*s: <Codec> Exten: <DialedExten%*.*s> CLCID: <ConnectedLineCID.......>\n", - indent, "Codec", filler, filler, CLI_HEADER_FILLER); + "%*s: <DialedExten%*.*s> CLCID: <ConnectedLineCID.......>\n", + indent, "Exten", filler, filler, CLI_HEADER_FILLER); context->indent_level--; } @@ -1438,9 +1438,8 @@ static int cli_channel_print_body(void *obj, void *arg, int flags) flexwidth = CLI_LAST_TABSTOP - indent - 25; ast_str_append(&context->output_buffer, 0, - "%*s: %-7s Exten: %-*.*s CLCID: \"%s\" <%s>\n", - indent, "Codec", - snapshot->nativeformats, + "%*s: %-*.*s CLCID: \"%s\" <%s>\n", + indent, "Exten", flexwidth, flexwidth, snapshot->exten, snapshot->connected_name, |