[asterisk-commits] kharwell: branch kharwell/pimp_sip_video r383518 - /team/kharwell/pimp_sip_vi...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 21 11:51:54 CDT 2013


Author: kharwell
Date: Thu Mar 21 11:51:51 2013
New Revision: 383518

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383518
Log:
removed some commented out code

Modified:
    team/kharwell/pimp_sip_video/res/res_sip_sdp_audio.c

Modified: team/kharwell/pimp_sip_video/res/res_sip_sdp_audio.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_video/res/res_sip_sdp_audio.c?view=diff&rev=383518&r1=383517&r2=383518
==============================================================================
--- team/kharwell/pimp_sip_video/res/res_sip_sdp_audio.c (original)
+++ team/kharwell/pimp_sip_video/res/res_sip_sdp_audio.c Thu Mar 21 11:51:51 2013
@@ -424,40 +424,6 @@
 	}
 	ast_format_cap_iter_end(caps);
 
-	/* /\* Add formats *\/ */
-	/* for (index = 0; (index < AST_CODEC_PREF_SIZE); index++) { */
-	/* 	struct ast_format format; */
-	/* 	int rtp_code; */
-	/* 	pjmedia_sdp_rtpmap rtpmap; */
-	/* 	struct ast_codec_pref *pref = &ast_rtp_instance_get_codecs(session_media->rtp)->pref; */
-
-	/* 	if (!ast_codec_pref_index(&session->endpoint->prefs, index, &format)) { */
-	/* 		break; */
-	/* 	} else if (AST_FORMAT_GET_TYPE(format.id) != AST_FORMAT_TYPE_AUDIO) { */
-	/* 		continue; */
-	/* 	} else if ((rtp_code = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(session_media->rtp), */
-	/* 							   1, &format, 0)) == -1) { */
-	/* 		return -1; */
-	/* 	} */
-
-	/* 	snprintf(tmp, sizeof(tmp), "%d", rtp_code); */
-	/* 	pj_strdup2(pool, &media->desc.fmt[media->desc.fmt_count++], tmp); */
-	/* 	rtpmap.pt = media->desc.fmt[media->desc.fmt_count - 1]; */
-	/* 	rtpmap.clock_rate = ast_rtp_lookup_sample_rate2(1, &format, 0); */
-	/* 	pj_strdup2(pool, &rtpmap.enc_name, ast_rtp_lookup_mime_subtype2(1, &format, 0, 0)); */
-	/* 	rtpmap.param.slen = 0; */
-
-	/* 	pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr); */
-	/* 	media->attr[media->attr_count++] = attr; */
-
-	/* 	if (pref) { */
-	/* 		struct ast_format_list fmt = ast_codec_pref_getsize(pref, &format); */
-	/* 		if (fmt.cur_ms && ((fmt.cur_ms < min_packet_size) || !min_packet_size)) { */
-	/* 			min_packet_size = fmt.cur_ms; */
-	/* 		} */
-	/* 	} */
-	/* } */
-
 	/* Add non-codec formats */
 	for (index = 1LL; index <= AST_RTP_MAX; index <<= 1) {
 		int rtp_code;
@@ -640,153 +606,6 @@
 	return 1;
 }
 
-/* static int audio_apply_negotiated_sdp_stream(struct ast_sip_session *session, struct ast_sip_session_media *session_media, const struct pjmedia_sdp_session *local, const struct pjmedia_sdp_media *local_stream, */
-/* 	const struct pjmedia_sdp_session *remote, const struct pjmedia_sdp_media *remote_stream) */
-/* { */
-/* 	int format, othercapability = 0; */
-/* 	char host[NI_MAXHOST]; */
-/* 	RAII_VAR(struct ast_sockaddr *, addrs, NULL, ast_free_ptr); */
-/* 	struct ast_rtp_codecs codecs; */
-/* 	const pjmedia_sdp_attr *attr; */
-/* 	RAII_VAR(struct ast_format_cap *, cap, NULL, ast_format_cap_destroy); */
-/* 	RAII_VAR(struct ast_format_cap *, jointcap, NULL, ast_format_cap_destroy); */
-/* 	RAII_VAR(struct ast_format_cap *, peercap, NULL, ast_format_cap_destroy); */
-/* 	struct ast_format fmt; */
-
-/* 	if (!session->channel) { */
-/* 		return 1; */
-/* 	} */
-
-/* 	/\* Create an RTP instance if need be *\/ */
-/* 	if (!session_media->rtp && audio_create_rtp(session, session_media, session->endpoint->rtp_ipv6)) { */
-/* 		return -1; */
-/* 	} */
-
-/* 	ast_copy_pj_str(host, remote_stream->conn ? &remote_stream->conn->addr : &remote->conn->addr, sizeof(host)); */
-
-/* 	/\* Ensure that the address provided is valid *\/ */
-/* 	if (ast_sockaddr_resolve(&addrs, host, PARSE_PORT_FORBID, AST_AF_UNSPEC) <= 0) { */
-/* 		/\* The provided host was actually invalid so we error out this negotiation *\/ */
-/* 		return -1; */
-/* 	} */
-
-/* 	/\* To properly apply formats to the channel we need to keep track of capabilities *\/ */
-/* 	if (!(cap = ast_format_cap_alloc_nolock()) || */
-/* 		!(peercap = ast_format_cap_alloc_nolock())) { */
-/* 		ast_log(LOG_ERROR, "Failed to allocate audio capabilities\n"); */
-/* 		return -1; */
-/* 	} */
-
-/* 	/\* Apply connection information to the RTP instance *\/ */
-/* 	ast_sockaddr_set_port(addrs, remote_stream->desc.port); */
-/* 	ast_rtp_instance_set_remote_address(session_media->rtp, addrs); */
-
-/* 	ast_rtp_codecs_payloads_initialize(&codecs); */
-
-/* 	/\* Iterate through provided formats *\/ */
-/* 	for (format = 0; format < local_stream->desc.fmt_count; format++) { */
-/* 		/\* The payload is kept as a string for things like t38 but for audio it is always numerical *\/ */
-/* 		ast_rtp_codecs_payloads_set_m_type(&codecs, NULL, pj_strtoul(&local_stream->desc.fmt[format])); */
-
-/* 		/\* Look for the optional rtpmap attribute *\/ */
-/* 		if ((attr = pjmedia_sdp_media_find_attr2(local_stream, "rtpmap", &local_stream->desc.fmt[format]))) { */
-/* 			pjmedia_sdp_rtpmap *rtpmap; */
-
-/* 			/\* Interpret the attribute as an rtpmap *\/ */
-/* 			if ((pjmedia_sdp_attr_to_rtpmap(session->inv_session->pool_active, attr, &rtpmap)) == PJ_SUCCESS) { */
-/* 				char name[32]; */
-
-/* 				ast_copy_pj_str(name, &rtpmap->enc_name, sizeof(name)); */
-/* 				ast_rtp_codecs_payloads_set_rtpmap_type_rate(&codecs, NULL, pj_strtoul(&local_stream->desc.fmt[format]), */
-/* 										 "audio", name, 0, rtpmap->clock_rate); */
-/* 			} */
-/* 		} */
-/* 	} */
-
-/* 	ast_rtp_codecs_payload_formats(&codecs, peercap, &othercapability); */
-
-/* 	/\* Apply packetization if available and configured to do so *\/ */
-/* 	if (session->endpoint->use_ptime && (attr = pjmedia_sdp_media_find_attr2(remote_stream, "ptime", NULL))) { */
-/* 		pj_str_t value = attr->value; */
-/* 		unsigned long framing = pj_strtoul(pj_strltrim(&value)); */
-/* 		int codec; */
-/* 		struct ast_codec_pref *pref = &ast_rtp_instance_get_codecs(session_media->rtp)->pref; */
-
-/* 		for (codec = 0; codec < AST_RTP_MAX_PT; codec++) { */
-/* 			struct ast_rtp_payload_type format = ast_rtp_codecs_payload_lookup(ast_rtp_instance_get_codecs( */
-/* 				session_media->rtp), codec); */
-
-/* 			if (!format.asterisk_format) { */
-/* 				continue; */
-/* 			} */
-
-/* 			ast_codec_pref_setsize(pref, &format.format, framing); */
-/* 		} */
-
-/* 		ast_rtp_codecs_packetization_set(ast_rtp_instance_get_codecs(session_media->rtp), */
-/* 			session_media->rtp, pref); */
-/* 	} */
-
-/* 	/\* Using the configured codecs and the codecs in this SDP we determine the joint formats for *audio only* *\/ */
-/* 	ast_format_cap_copy(cap, session->endpoint->codecs); */
-/* 	ast_format_cap_remove_bytype(cap, AST_FORMAT_TYPE_VIDEO); */
-
-/* 	if (!(jointcap = ast_format_cap_joint(cap, peercap))) { */
-/* 		char usbuf[64], thembuf[64]; */
-
-/* 		ast_channel_hangupcause_set(session->channel, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL); */
-/* 		ast_getformatname_multiple(usbuf, sizeof(usbuf), cap); */
-/* 		ast_getformatname_multiple(thembuf, sizeof(thembuf), peercap); */
-/* 		ast_log(LOG_WARNING, "No joint capabilities between our configuration(%s) and incoming SDP(%s)\n", usbuf, thembuf); */
-
-/* 		ast_rtp_codecs_payloads_destroy(&codecs); */
-/* 		return -1; */
-/* 	} */
-
-/* 	ast_rtp_codecs_payloads_copy(&codecs, ast_rtp_instance_get_codecs(session_media->rtp), */
-/* 				     session_media->rtp); */
-
-/* 	/\* Now that we have joint formats for audio remove the existing ones from the channel and add the new ones *\/ */
-/* 	ast_format_cap_copy(cap, ast_channel_nativeformats(session->channel)); */
-/* 	ast_format_cap_remove_bytype(cap, AST_FORMAT_TYPE_AUDIO); */
-/* 	ast_format_cap_append(cap, jointcap); */
-
-/* 	/\* Apply the new formats to the channel, potentially changing read/write formats while doing so *\/ */
-/* 	ast_format_cap_copy(ast_channel_nativeformats(session->channel), cap); */
-/* 	ast_codec_choose(&session->endpoint->prefs, cap, 1, &fmt); */
-/* 	ast_format_copy(ast_channel_rawwriteformat(session->channel), &fmt); */
-/* 	ast_format_copy(ast_channel_rawreadformat(session->channel), &fmt); */
-/* 	ast_set_read_format(session->channel, ast_channel_readformat(session->channel)); */
-/* 	ast_set_write_format(session->channel, ast_channel_writeformat(session->channel)); */
-
-/* 	ast_channel_set_fd(session->channel, 0, ast_rtp_instance_fd(session_media->rtp, 0)); */
-/* 	ast_channel_set_fd(session->channel, 1, ast_rtp_instance_fd(session_media->rtp, 1)); */
-
-/* 	/\* If ICE support is enabled find all the needed attributes *\/ */
-/* 	audio_process_ice_attributes(session, session_media, remote, remote_stream); */
-
-/* 	if (session_media->held && (!ast_sockaddr_isnull(addrs) || */
-/* 							  !pjmedia_sdp_media_find_attr2(remote_stream, "sendonly", NULL))) { */
-/* 		/\* The remote side has taken us off hold *\/ */
-/* 		ast_queue_control(session->channel, AST_CONTROL_UNHOLD); */
-/* 		ast_queue_frame(session->channel, &ast_null_frame); */
-/* 		session_media->held = 0; */
-/* 	} else if (ast_sockaddr_isnull(addrs) || ast_sockaddr_is_any(addrs) || pjmedia_sdp_media_find_attr2(remote_stream, "sendonly", NULL)) { */
-/* 		/\* The remote side has put us on hold *\/ */
-/* 		ast_queue_control_data(session->channel, AST_CONTROL_HOLD, S_OR(session->endpoint->mohsuggest, NULL), */
-/* 					   !ast_strlen_zero(session->endpoint->mohsuggest) ? strlen(session->endpoint->mohsuggest) + 1 : 0); */
-/* 		ast_rtp_instance_stop(session_media->rtp); */
-/* 		ast_queue_frame(session->channel, &ast_null_frame); */
-/* 		session_media->held = 1; */
-/* 	} else { */
-/* 		/\* The remote side has not changed state, but make sure the instance is active *\/ */
-/* 		ast_rtp_instance_activate(session_media->rtp); */
-/* 	} */
-
-/* 	ast_rtp_codecs_payloads_destroy(&codecs); */
-/* 	return 1; */
-/* } */
-
 /*! \brief Function which updates the media stream with external media address, if applicable */
 static void audio_change_outgoing_sdp_stream_media_address(pjsip_tx_data *tdata, struct pjmedia_sdp_media *stream, struct ast_sip_transport *transport)
 {




More information about the asterisk-commits mailing list