diff options
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 68 |
1 files changed, 7 insertions, 61 deletions
diff --git a/main/channel.c b/main/channel.c index 304fae18a..869b29f5e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -520,12 +520,6 @@ void ast_channel_setwhentohangup_tv(struct ast_channel *chan, struct timeval off return; } -void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset) -{ - struct timeval when = { offset, }; - ast_channel_setwhentohangup_tv(chan, when); -} - /*! \brief Compare a offset with when to hangup channel */ int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offset) { @@ -542,12 +536,6 @@ int ast_channel_cmpwhentohangup_tv(struct ast_channel *chan, struct timeval offs return ast_tvdiff_ms(whentohangup, *ast_channel_whentohangup(chan)); } -int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset) -{ - struct timeval when = { offset, }; - return ast_channel_cmpwhentohangup_tv(chan, when); -} - /*! \brief Register a new telephony channel in Asterisk */ int ast_channel_register(const struct ast_channel_tech *tech) { @@ -2389,16 +2377,6 @@ static void ast_dummy_channel_destructor(void *obj) ast_channel_internal_cleanup(chan); } -struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_info *info, const char *uid) -{ - return ast_datastore_alloc(info, uid); -} - -int ast_channel_datastore_free(struct ast_datastore *datastore) -{ - return ast_datastore_free(datastore); -} - int ast_channel_datastore_inherit(struct ast_channel *from, struct ast_channel *to) { struct ast_datastore *datastore = NULL, *datastore2; @@ -6485,11 +6463,15 @@ static int ast_channel_make_compatible_helper(struct ast_channel *from, struct a * to use SLINEAR between channels, but only if there is * no direct conversion available. If generic PLC is * desired, then transcoding via SLINEAR is a requirement + * even if the formats are the same. */ - if (ast_format_cmp(best_dst_fmt, best_src_fmt) == AST_FORMAT_CMP_NOT_EQUAL - && (ast_opt_generic_plc || ast_opt_transcode_via_slin)) { + if (ast_opt_generic_plc_on_equal_codecs + || (ast_format_cmp(best_dst_fmt, best_src_fmt) == AST_FORMAT_CMP_NOT_EQUAL + && (ast_opt_generic_plc || ast_opt_transcode_via_slin))) { + int use_slin = (ast_format_cache_is_slinear(best_src_fmt) - || ast_format_cache_is_slinear(best_dst_fmt)) ? 1 : 0; + || ast_format_cache_is_slinear(best_dst_fmt)) + ? 1 : ast_opt_generic_plc_on_equal_codecs; if (use_slin || ast_translate_path_steps(best_dst_fmt, best_src_fmt) != 1) { int best_sample_rate = (ast_format_get_sample_rate(best_src_fmt) > ast_format_get_sample_rate(best_dst_fmt)) ? @@ -7581,22 +7563,6 @@ static int ast_channel_hash_cb(const void *obj, const int flags) return ast_str_case_hash(name); } -int ast_plc_reload(void) -{ - struct ast_variable *var; - struct ast_flags config_flags = { 0 }; - struct ast_config *cfg = ast_config_load("codecs.conf", config_flags); - if (cfg == CONFIG_STATUS_FILEMISSING || cfg == CONFIG_STATUS_FILEUNCHANGED || cfg == CONFIG_STATUS_FILEINVALID) - return 0; - for (var = ast_variable_browse(cfg, "plc"); var; var = var->next) { - if (!strcasecmp(var->name, "genericplc")) { - ast_set2_flag(&ast_options, ast_true(var->value), AST_OPT_FLAG_GENERIC_PLC); - } - } - ast_config_destroy(cfg); - return 0; -} - /*! * \internal * \brief Print channel object key (name). @@ -7820,8 +7786,6 @@ int ast_channels_init(void) ast_cli_register_multiple(cli_channel, ARRAY_LEN(cli_channel)); - ast_plc_reload(); - ast_register_cleanup(channels_shutdown); AST_RWLIST_HEAD_INIT(&ami_vars); @@ -8027,24 +7991,6 @@ void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_sil } -/*! \ brief Convert channel reloadreason (ENUM) to text string for manager event */ -const char *channelreloadreason2txt(enum channelreloadreason reason) -{ - switch (reason) { - case CHANNEL_MODULE_LOAD: - return "LOAD (Channel module load)"; - - case CHANNEL_MODULE_RELOAD: - return "RELOAD (Channel module reload)"; - - case CHANNEL_CLI_RELOAD: - return "CLIRELOAD (Channel module reload by CLI command)"; - - default: - return "MANAGERRELOAD (Channel module reload by manager)"; - } -}; - /* * Wrappers for various ast_say_*() functions that call the full version * of the same functions. |