您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ switch_channel_test_flag函数代码示例

51自学网 2021-06-03 08:35:04
  C++
这篇教程C++ switch_channel_test_flag函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中switch_channel_test_flag函数的典型用法代码示例。如果您正苦于以下问题:C++ switch_channel_test_flag函数的具体用法?C++ switch_channel_test_flag怎么用?C++ switch_channel_test_flag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了switch_channel_test_flag函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch_core_standard_on_init

static void switch_core_standard_on_init(switch_core_session_t *session){	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard INIT/n", switch_channel_get_name(session->channel));	if (switch_channel_test_flag(session->channel, CF_RECOVERING_BRIDGE)) {		switch_channel_set_state(session->channel, CS_RESET);	} else {		if (switch_channel_test_flag(session->channel, CF_RECOVERING)) {			switch_channel_set_state(session->channel, CS_EXECUTE);		} else {			switch_channel_set_state(session->channel, CS_ROUTING);		}	}}
开发者ID:bearjb,项目名称:FreeSWITCH,代码行数:14,


示例2: SWITCH_DECLARE

SWITCH_DECLARE(void) bridge(CoreSession &session_a, CoreSession &session_b){	switch_input_callback_function_t dtmf_func = NULL;	switch_input_args_t args;	switch_channel_t *channel_a = NULL, *channel_b = NULL;	const char *err = "Channels not ready/n";		if (session_a.allocated && session_a.session && session_b.allocated && session_b.session) {		channel_a = switch_core_session_get_channel(session_a.session);		channel_b = switch_core_session_get_channel(session_b.session);		if (switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {			session_a.begin_allow_threads();			if (!switch_channel_test_flag(channel_a, CF_OUTBOUND) && !switch_channel_media_ready(channel_a)) {				switch_channel_pre_answer(channel_a);			}			if (switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {				args = session_a.get_cb_args();  // get the cb_args data structure for session a				dtmf_func = args.input_callback;   // get the call back function				err = NULL;				switch_ivr_multi_threaded_bridge(session_a.session, session_b.session, dtmf_func, args.buf, args.buf);			}			session_a.end_allow_threads();		}	}	if (err) {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a.session), SWITCH_LOG_ERROR, "%s", err);	}}
开发者ID:gujun,项目名称:sscore,代码行数:33,


示例3: switch_core_standard_on_hangup

static void switch_core_standard_on_hangup(switch_core_session_t *session){	switch_caller_extension_t *extension;	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard HANGUP, cause: %s/n",					  switch_channel_get_name(session->channel), switch_channel_cause2str(switch_channel_get_cause(session->channel)));		if (!switch_channel_test_flag(session->channel, CF_ZOMBIE_EXEC)) {		return;	}	if ((extension = switch_channel_get_caller_extension(session->channel)) == 0) {		return;	}	while(extension->current_application) {		switch_caller_application_t *current_application = extension->current_application;		switch_status_t status;		extension->current_application = extension->current_application->next;		status = switch_core_session_execute_application(session,														 current_application->application_name, current_application->application_data);														 				if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_IGNORE) {			return;		}	}}
开发者ID:AricGod,项目名称:FreeSWITCH,代码行数:32,


示例4: conference_event_adv_la

void conference_event_adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join){	//if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {	switch_channel_set_flag(member->channel, CF_VIDEO_REFRESH_REQ);	switch_core_media_gen_key_frame(member->session);	//}	if (conference && conference->la && member->session &&		!switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {		cJSON *msg, *data;		const char *uuid = switch_core_session_get_uuid(member->session);		const char *cookie = switch_channel_get_variable(member->channel, "event_channel_cookie");		const char *event_channel = cookie ? cookie : uuid;		switch_event_t *variables;		switch_event_header_t *hp;		msg = cJSON_CreateObject();		data = json_add_child_obj(msg, "pvtData", NULL);		cJSON_AddItemToObject(msg, "eventChannel", cJSON_CreateString(event_channel));		cJSON_AddItemToObject(msg, "eventType", cJSON_CreateString("channelPvtData"));		cJSON_AddItemToObject(data, "action", cJSON_CreateString(join ? "conference-liveArray-join" : "conference-liveArray-part"));		cJSON_AddItemToObject(data, "laChannel", cJSON_CreateString(conference->la_event_channel));		cJSON_AddItemToObject(data, "laName", cJSON_CreateString(conference->la_name));		cJSON_AddItemToObject(data, "role", cJSON_CreateString(conference_utils_member_test_flag(member, MFLAG_MOD) ? "moderator" : "participant"));		cJSON_AddItemToObject(data, "chatID", cJSON_CreateString(conference->chat_id));		cJSON_AddItemToObject(data, "canvasCount", cJSON_CreateNumber(conference->canvas_count));		if (conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {			cJSON_AddItemToObject(data, "secondScreen", cJSON_CreateTrue());		}		if (conference_utils_member_test_flag(member, MFLAG_MOD)) {			cJSON_AddItemToObject(data, "modChannel", cJSON_CreateString(conference->mod_event_channel));		}		cJSON_AddItemToObject(data, "chatChannel", cJSON_CreateString(conference->chat_event_channel));		switch_core_get_variables(&variables);		for (hp = variables->headers; hp; hp = hp->next) {			if (!strncasecmp(hp->name, "conference_verto_", 17)) {				char *var = hp->name + 17;				if (var) {					cJSON_AddItemToObject(data, var, cJSON_CreateString(hp->value));				}			}		}		switch_event_destroy(&variables);		switch_event_channel_broadcast(event_channel, &msg, "mod_conference", conference_globals.event_channel_id);		if (cookie) {			switch_event_channel_permission_modify(cookie, conference->la_event_channel, join);			switch_event_channel_permission_modify(cookie, conference->mod_event_channel, join);			switch_event_channel_permission_modify(cookie, conference->chat_event_channel, join);		}	}}
开发者ID:prashantchoudhary,项目名称:FreeswitchModified,代码行数:60,


示例5: switch_core_standard_on_reset

static void switch_core_standard_on_reset(switch_core_session_t *session){	switch_channel_set_variable(session->channel, "call_uuid", switch_core_session_get_uuid(session));	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard RESET/n", switch_channel_get_name(session->channel));	if (switch_channel_test_flag(session->channel, CF_RECOVERING_BRIDGE)) {		switch_core_session_t *other_session = NULL;		const char *uuid = switch_core_session_get_uuid(session);		if (switch_channel_test_flag(session->channel, CF_BRIDGE_ORIGINATOR)) {			const char *other_uuid = switch_channel_get_partner_uuid(session->channel);			int x = 0;			if (other_uuid) {				for (x = 0; other_session == NULL && x < 20; x++) {					if (!switch_channel_up(session->channel)) {						break;					}					other_session = switch_core_session_locate(other_uuid);					switch_yield(100000);				}			}			if (other_session) {				switch_channel_t *other_channel = switch_core_session_get_channel(other_session);				switch_channel_clear_flag(session->channel, CF_BRIDGE_ORIGINATOR);				switch_channel_wait_for_state_timeout(other_channel, CS_RESET, 5000);				switch_channel_wait_for_flag(other_channel, CF_MEDIA_ACK, SWITCH_TRUE, 2000, NULL);				if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) && switch_channel_test_flag(other_channel, CF_PROXY_MODE)) {					switch_ivr_signal_bridge(session, other_session);				} else {					switch_ivr_uuid_bridge(uuid, other_uuid);				}				switch_core_session_rwunlock(other_session);			}		}		switch_channel_clear_flag(session->channel, CF_RECOVERING_BRIDGE);	}}
开发者ID:odmanV2,项目名称:freecenter,代码行数:43,


示例6: switch_core_standard_on_execute

static void switch_core_standard_on_execute(switch_core_session_t *session){	switch_caller_extension_t *extension;	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s Standard EXECUTE/n", switch_channel_get_name(session->channel));	if (switch_channel_get_variable(session->channel, "recovered") && !switch_channel_test_flag(session->channel, CF_RECOVERED)) {		switch_channel_set_flag(session->channel, CF_RECOVERED);	}  top:	switch_channel_clear_flag(session->channel, CF_RESET);		if ((extension = switch_channel_get_caller_extension(session->channel)) == 0) {		switch_channel_hangup(session->channel, SWITCH_CAUSE_NORMAL_CLEARING);		return;	}	while (switch_channel_get_state(session->channel) == CS_EXECUTE && extension->current_application) {		switch_caller_application_t *current_application = extension->current_application;		extension->current_application = extension->current_application->next;		if (switch_core_session_execute_application(session,													current_application->application_name,													current_application->application_data) != SWITCH_STATUS_SUCCESS) {			return;		}		if (switch_channel_test_flag(session->channel, CF_RESET)) {			goto top;		}	}	if (switch_channel_ready(session->channel) && switch_channel_get_state(session->channel) == CS_EXECUTE) {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_NOTICE, "%s has executed the last dialplan instruction, hanging up./n",						  switch_channel_get_name(session->channel));		switch_channel_hangup(session->channel, SWITCH_CAUSE_NORMAL_CLEARING);	}}
开发者ID:kgrofelnik,项目名称:mod_portaudio-endpoints,代码行数:41,


示例7: my_on_reporting

static switch_status_t my_on_reporting(switch_core_session_t *session){	switch_xml_t cdr = NULL;	switch_channel_t *channel = switch_core_session_get_channel(session);	rc_handle *rad_config;	switch_status_t retval = SWITCH_STATUS_TERM;	VALUE_PAIR *send = NULL;	uint32_t client_port = 0;	uint32_t framed_addr = 0;	uint32_t status_type = PW_STATUS_STOP;	switch_time_t callstartdate = 0;	switch_time_t callanswerdate = 0;	switch_time_t callenddate = 0;	switch_time_t calltransferdate = 0;	switch_time_t billusec = 0;	uint32_t billsec = 0;	char *uuid_str;	switch_time_exp_t tm;	char buffer[32] = "";	if (globals.shutdown) {		return SWITCH_STATUS_FALSE;	}	if (channel) {		const char *disable_flag = switch_channel_get_variable(channel, "disable_radius_stop");		if (switch_true(disable_flag)) {			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[mod_radius_cdr] Not Sending RADIUS Stop/n");			return SWITCH_STATUS_SUCCESS;		}	}	switch_thread_rwlock_rdlock(globals.rwlock);	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[mod_radius_cdr] Entering my_on_reporting/n");	rad_config = my_radius_init();	if (rad_config == NULL) {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[mod_radius_cdr] Error initializing radius, session not logged./n");		goto end;	}	if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) {		uuid_str = switch_core_session_get_uuid(session);	} else {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "[mod_radius_cdr] Error Generating Data!/n");		goto end;	}	/* Create the radius packet */	/* Set Status Type */	if (rc_avpair_add(rad_config, &send, PW_ACCT_STATUS_TYPE, &status_type, -1, 0) == NULL) {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "failed adding Acct-Session-ID: %s/n", uuid_str);		rc_destroy(rad_config);		goto end;	}	if (rc_avpair_add(rad_config, &send, PW_ACCT_SESSION_ID, uuid_str, -1, 0) == NULL) {		switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "failed adding Acct-Session-ID: %s/n", uuid_str);		rc_destroy(rad_config);		goto end;	}	/* Add VSAs */	if (channel) {		switch_call_cause_t cause;		switch_caller_profile_t *profile;		cause = switch_channel_get_cause(channel);		if (rc_avpair_add(rad_config, &send, PW_FS_HANGUPCAUSE, &cause, -1, PW_FS_PEC) == NULL) {			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "failed adding Freeswitch-Hangupcause: %d/n", cause);			rc_destroy(rad_config);			goto end;		}		profile = switch_channel_get_caller_profile(channel);		if (profile) {			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "[mod_radius_cdr] Calculating billable time/n");			/* calculate billable time */			callstartdate = profile->times->created;			callanswerdate = profile->times->answered;			calltransferdate = profile->times->transferred;			callenddate = profile->times->hungup;			if (switch_channel_test_flag(channel, CF_ANSWERED)) {				if (callstartdate && callanswerdate) {					if (callenddate)						billusec = callenddate - callanswerdate;					else if (calltransferdate)						billusec = calltransferdate - callanswerdate;				}			} else if (switch_channel_test_flag(channel, CF_TRANSFER)) {//.........这里部分代码省略.........
开发者ID:AricGod,项目名称:FreeSWITCH,代码行数:101,


示例8: channel_on_execute

static switch_status_t channel_on_execute(switch_core_session_t *session){	switch_channel_t *channel = NULL;	loopback_private_t *tech_pvt = NULL;	switch_caller_extension_t *exten = NULL;	const char *bowout = NULL;	int bow = 0;	channel = switch_core_session_get_channel(session);	assert(channel != NULL);	tech_pvt = switch_core_session_get_private(session);	assert(tech_pvt != NULL);	switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s CHANNEL EXECUTE/n", switch_channel_get_name(channel));	if ((bowout = switch_channel_get_variable(tech_pvt->channel, "loopback_bowout_on_execute")) && switch_true(bowout)) {		/* loopback_bowout_on_execute variable is set */		bow = 1;	} else if ((exten = switch_channel_get_caller_extension(channel))) {		/* check for bowout flag */		switch_caller_application_t *app_p;		for (app_p = exten->applications; app_p; app_p = app_p->next) {			int32_t flags;			switch_core_session_get_app_flags(app_p->application_name, &flags);			if ((flags & SAF_NO_LOOPBACK)) {				bow = 1;				break;			}		}	}	if (bow) {		switch_core_session_t *other_session = NULL;		switch_caller_profile_t *cp, *clone;		const char *other_uuid = NULL;		switch_set_flag(tech_pvt, TFLAG_BOWOUT);		if ((find_non_loopback_bridge(tech_pvt->other_session, &other_session, &other_uuid) == SWITCH_STATUS_SUCCESS)) {			switch_channel_t *other_channel = switch_core_session_get_channel(other_session);			if (switch_channel_test_flag(other_channel, CF_BRIDGED)) {				/* Wait for real channel to be exchanging media */				switch_channel_wait_for_state(other_channel, channel, CS_EXCHANGE_MEDIA);			}			switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_INFO, "BOWOUT Replacing loopback channel with real channel: %s/n",							  switch_channel_get_name(other_channel));			if ((cp = switch_channel_get_caller_profile(channel))) {				clone = switch_caller_profile_clone(other_session, cp);				clone->originator_caller_profile = NULL;				clone->originatee_caller_profile = NULL;				switch_channel_set_caller_profile(other_channel, clone);			}			switch_channel_caller_extension_masquerade(channel, other_channel, 0);			switch_channel_set_state(other_channel, CS_RESET);			switch_channel_wait_for_state(other_channel, NULL, CS_RESET);			switch_channel_set_state(other_channel, CS_EXECUTE);			switch_core_session_rwunlock(other_session);			switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_UNSPECIFIED);		}	}	return SWITCH_STATUS_SUCCESS;}
开发者ID:jrd,项目名称:FreeSWITCH,代码行数:70,


示例9: iks_find

//.........这里部分代码省略.........	if (switch_file_exists(fax_document, pool) != SWITCH_STATUS_SUCCESS) {		return iks_new_error_detailed_printf(iq, STANZA_ERROR_BAD_REQUEST, "file not found: %s", fax_document);	}	/* get fax identity and header */	fax_identity = iks_find_attrib_soft(document, "identity");	if (!zstr(fax_identity)) {		switch_channel_set_variable(channel, "fax_ident", fax_identity);	} else {		switch_channel_set_variable(channel, "fax_ident", NULL);	}	fax_header = iks_find_attrib_soft(document, "header");	if (!zstr(fax_header)) {		switch_channel_set_variable(channel, "fax_header", fax_header);	} else {		switch_channel_set_variable(channel, "fax_header", NULL);	}	/* get pages to send */	pages = iks_find_attrib_soft(document, "pages");	if (!zstr(pages)) {		if (switch_regex_match(pages, "[1-9][0-9]*(-[1-9][0-9]*)?") == SWITCH_STATUS_FALSE) {			return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "invalid pages value");		} else {			int start = 0;			int end = 0;			char *pages_dup = switch_core_session_strdup(session, pages);			char *sep = strchr(pages_dup, '-');			if (sep) {				*sep = '/0';				sep++;				end = atoi(sep);			}			start = atoi(pages_dup);			if (end && end < start) {				return iks_new_error_detailed(iq, STANZA_ERROR_BAD_REQUEST, "invalid pages value");			}			switch_channel_set_variable(channel, "fax_start_page", pages_dup);			switch_channel_set_variable(channel, "fax_end_page", sep);		}	} else {		switch_channel_set_variable(channel, "fax_start_page", NULL);		switch_channel_set_variable(channel, "fax_end_page", NULL);	}	/* create sendfax component */	switch_core_new_memory_pool(&pool);	sendfax_component = switch_core_alloc(pool, sizeof(*sendfax_component));	rayo_component_init((struct rayo_component *)sendfax_component, pool, RAT_CALL_COMPONENT, "sendfax", NULL, call, iks_find_attrib(iq, "from"));	/* add channel variable so that fax component can be located from fax events */	switch_channel_set_variable(channel, "rayo_fax_jid", RAYO_JID(sendfax_component));	/* clear fax result variables */	switch_channel_set_variable(channel, "fax_success", NULL);	switch_channel_set_variable(channel, "fax_result_code", NULL);	switch_channel_set_variable(channel, "fax_result_text", NULL);	switch_channel_set_variable(channel, "fax_document_transferred_pages", NULL);	switch_channel_set_variable(channel, "fax_document_total_pages", NULL);	switch_channel_set_variable(channel, "fax_image_resolution", NULL);	switch_channel_set_variable(channel, "fax_image_size", NULL);	switch_channel_set_variable(channel, "fax_bad_rows", NULL);	switch_channel_set_variable(channel, "fax_transfer_rate", NULL);	switch_channel_set_variable(channel, "fax_ecm_used", NULL);	switch_channel_set_variable(channel, "fax_local_station_id", NULL);	switch_channel_set_variable(channel, "fax_remote_station_id", NULL);	/* clear fax interrupt variable */	switch_channel_set_variable(switch_core_session_get_channel(session), "rayo_read_frame_interrupt", NULL);	rayo_call_set_faxing(RAYO_CALL(call), 1);	/* execute txfax APP */	if (switch_event_create(&execute_event, SWITCH_EVENT_COMMAND) == SWITCH_STATUS_SUCCESS) {		switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "call-command", "execute");		switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "execute-app-name", "txfax");		switch_event_add_header_string(execute_event, SWITCH_STACK_BOTTOM, "execute-app-arg", fax_document);		if (!switch_channel_test_flag(channel, CF_PROXY_MODE)) {			switch_channel_set_flag(channel, CF_BLOCK_BROADCAST_UNTIL_MEDIA);		}		if (switch_core_session_queue_private_event(session, &execute_event, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) {			response = iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "failed to txfax (queue event failed)");			if (execute_event) {				switch_event_destroy(&execute_event);			}			rayo_call_set_faxing(RAYO_CALL(call), 0);			RAYO_UNLOCK(sendfax_component);		} else {			/* component starting... */			rayo_component_send_start(RAYO_COMPONENT(sendfax_component), iq);		}	} else {		response = iks_new_error_detailed(iq, STANZA_ERROR_INTERNAL_SERVER_ERROR, "failed to create txfax event");		rayo_call_set_faxing(RAYO_CALL(call), 0);		RAYO_UNLOCK(sendfax_component);	}	return response;}
开发者ID:lzcykevin,项目名称:FreeSWITCH,代码行数:101,


示例10: conference_loop_input

/* marshall frames from the call leg to the conference thread for muxing to other call legs */void *SWITCH_THREAD_FUNC conference_loop_input(switch_thread_t *thread, void *obj){	switch_event_t *event;	conference_member_t *member = obj;	switch_channel_t *channel;	switch_status_t status;	switch_frame_t *read_frame = NULL;	uint32_t hangover = 40, hangunder = 5, hangover_hits = 0, hangunder_hits = 0, diff_level = 400;	switch_core_session_t *session = member->session;	uint32_t flush_len;	switch_frame_t tmp_frame = { 0 };	if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {		goto end;	}	switch_assert(member != NULL);	conference_utils_member_clear_flag_locked(member, MFLAG_TALKING);	channel = switch_core_session_get_channel(session);	switch_core_session_get_read_impl(session, &member->read_impl);	switch_channel_audio_sync(channel);	flush_len = switch_samples_per_packet(member->conference->rate, member->conference->interval) * 2 * member->conference->channels * (500 / member->conference->interval);	/* As long as we have a valid read, feed that data into an input buffer where the conference thread will take it	   and mux it with any audio from other channels. */	while (conference_utils_member_test_flag(member, MFLAG_RUNNING) && switch_channel_ready(channel)) {		if (switch_channel_ready(channel) && switch_channel_test_app_flag(channel, CF_APP_TAGGED)) {			switch_yield(100000);			continue;		}		/* Read a frame. */		status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);		switch_mutex_lock(member->read_mutex);		/* end the loop, if appropriate */		if (!SWITCH_READ_ACCEPTABLE(status) || !conference_utils_member_test_flag(member, MFLAG_RUNNING)) {			switch_mutex_unlock(member->read_mutex);			break;		}		if (switch_channel_test_flag(channel, CF_VIDEO) && !conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO)) {			conference_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO);			conference_video_check_avatar(member, SWITCH_FALSE);			switch_core_session_video_reinit(member->session);			conference_video_set_floor_holder(member->conference, member, SWITCH_FALSE);		} else if (conference_utils_member_test_flag(member, MFLAG_ACK_VIDEO) && !switch_channel_test_flag(channel, CF_VIDEO)) {			conference_video_check_avatar(member, SWITCH_FALSE);		}		/* if we have caller digits, feed them to the parser to find an action */		if (switch_channel_has_dtmf(channel)) {			char dtmf[128] = "";			switch_channel_dequeue_dtmf_string(channel, dtmf, sizeof(dtmf));			if (conference_utils_member_test_flag(member, MFLAG_DIST_DTMF)) {				conference_member_send_all_dtmf(member, member->conference, dtmf);			} else if (member->dmachine) {				char *p;				char str[2] = "";				for (p = dtmf; p && *p; p++) {					str[0] = *p;					switch_ivr_dmachine_feed(member->dmachine, str, NULL);				}			}		} else if (member->dmachine) {			switch_ivr_dmachine_ping(member->dmachine, NULL);		}		if (switch_queue_size(member->dtmf_queue)) {			switch_dtmf_t *dt;			void *pop;			if (switch_queue_trypop(member->dtmf_queue, &pop) == SWITCH_STATUS_SUCCESS) {				dt = (switch_dtmf_t *) pop;				switch_core_session_send_dtmf(member->session, dt);				free(dt);			}		}		if (switch_channel_test_flag(member->channel, CF_CONFERENCE_RESET_MEDIA)) {			member->reset_media = 10;			switch_channel_audio_sync(member->channel);			switch_channel_clear_flag(member->channel, CF_CONFERENCE_RESET_MEDIA);		}		if (member->reset_media) {			if (--member->reset_media > 0) {				goto do_continue;			}//.........这里部分代码省略.........
开发者ID:odmanV2,项目名称:freecenter,代码行数:101,


示例11: conference_loop_output

//.........这里部分代码省略.........		conference_member_play_file(member, "tone_stream://%(500,0,640)", 0, SWITCH_TRUE);	}	if (!conference_utils_test_flag(member->conference, CFLAG_ANSWERED)) {		switch_channel_answer(channel);	}	sanity = 2000;	while(!conference_utils_member_test_flag(member, MFLAG_ITHREAD) && sanity > 0) {		switch_cond_next();		sanity--;	}	/* Fair WARNING, If you expect the caller to hear anything or for digit handling to be processed,      */	/* you better not block this thread loop for more than the duration of member->conference->timer_name!  */	while (!member->loop_loop && conference_utils_member_test_flag(member, MFLAG_RUNNING) && conference_utils_member_test_flag(member, MFLAG_ITHREAD)		   && switch_channel_ready(channel)) {		switch_event_t *event;		int use_timer = 0;		switch_buffer_t *use_buffer = NULL;		uint32_t mux_used = 0;		//if (member->reset_media || switch_channel_test_flag(member->channel, CF_CONFERENCE_RESET_MEDIA)) {		//	switch_cond_next();		//	continue;		//}		switch_mutex_lock(member->write_mutex);		if (switch_channel_test_flag(member->channel, CF_CONFERENCE_ADV)) {			if (member->conference->la) {				conference_event_adv_la(member->conference, member, SWITCH_TRUE);			}			switch_channel_clear_flag(member->channel, CF_CONFERENCE_ADV);		}		if (switch_core_session_dequeue_event(member->session, &event, SWITCH_FALSE) == SWITCH_STATUS_SUCCESS) {			if (event->event_id == SWITCH_EVENT_MESSAGE) {				char *from = switch_event_get_header(event, "from");				char *to = switch_event_get_header(event, "to");				char *body = switch_event_get_body(event);				if (to && from && body) {					if (strchr(to, '+') && strncmp(to, CONF_CHAT_PROTO, strlen(CONF_CHAT_PROTO))) {						switch_event_del_header(event, "to");						switch_event_add_header(event, SWITCH_STACK_BOTTOM,												"to", "%s+%[email
C++ switch_clear_flag函数代码示例
C++ switch_channel_set_variable函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。