Skip to content
Snippets Groups Projects
core_unreal.c 27.4 KiB
Newer Older
  • Learn to ignore specific revisions
  • 	ast_channel_nativeformats_set(owner, p->reqcap);
    
    
    	/* Determine our read/write format and set it on each channel */
    
    	fmt = ast_format_cap_get_format(p->reqcap, 0);
    	if (!fmt) {
    		ast_channel_tech_pvt_set(owner, NULL);
    		ao2_ref(p, -1);
    		ast_channel_unlock(owner);
    		ast_channel_release(owner);
    		return NULL;
    	}
    
    	ast_channel_set_writeformat(owner, fmt);
    	ast_channel_set_rawwriteformat(owner, fmt);
    	ast_channel_set_readformat(owner, fmt);
    	ast_channel_set_rawreadformat(owner, fmt);
    
    
    	ast_set_flag(ast_channel_flags(owner), AST_FLAG_DISABLE_DEVSTATE_CACHE);
    
    	ast_jb_configure(owner, &p->jb_conf);
    
    	if (ast_channel_cc_params_init(owner, requestor
    		? ast_channel_get_cc_config_params((struct ast_channel *) requestor) : NULL)) {
    
    		ast_channel_tech_pvt_set(owner, NULL);
    
    		ao2_ref(p, -1);
    
    		ast_channel_tech_pvt_set(owner, NULL);
    
    		ast_channel_unlock(owner);
    
    	ast_channel_unlock(owner);
    
    
    	chan = ast_channel_alloc(1, semi2_state, NULL, NULL, NULL,
    		exten, context, &id2, owner, 0,
    		"%s/%s-%08x;2", tech->type, p->name, (unsigned)generated_seqno);
    	if (!chan) {
    
    		ast_log(LOG_WARNING, "Unable to allocate chan channel structure\n");
    
    		ast_channel_tech_pvt_set(owner, NULL);
    
    		ao2_ref(p, -1);
    
    		ast_channel_tech_pvt_set(owner, NULL);
    
    		ast_channel_release(owner);
    		return NULL;
    	}
    
    	if (callid) {
    		ast_channel_callid_set(chan, callid);
    	}
    
    	ast_channel_tech_set(chan, tech);
    	ao2_ref(p, +1);
    	ast_channel_tech_pvt_set(chan, p);
    
    
    	ast_channel_nativeformats_set(chan, p->reqcap);
    
    
    	/* Format was already determined when setting up owner */
    
    	ast_channel_set_writeformat(chan, fmt);
    	ast_channel_set_rawwriteformat(chan, fmt);
    	ast_channel_set_readformat(chan, fmt);
    	ast_channel_set_rawreadformat(chan, fmt);
    
    
    	ast_set_flag(ast_channel_flags(chan), AST_FLAG_DISABLE_DEVSTATE_CACHE);
    
    
    	ast_channel_unlock(chan);