Ejemplo n.º 1
0
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp){
	LinphoneCallParams *ncp=linphone_call_params_new();
	memcpy(ncp,cp,sizeof(LinphoneCallParams));
	if (cp->record_file) ncp->record_file=ms_strdup(cp->record_file);
	if (cp->session_name) ncp->session_name=ms_strdup(cp->session_name);
	/*
	 * The management of the custom headers is not optimal. We copy everything while ref counting would be more efficient.
	 */
	if (cp->custom_headers) ncp->custom_headers=sal_custom_header_clone(cp->custom_headers);
	return ncp;
}
Ejemplo n.º 2
0
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp){
	unsigned int i;
	LinphoneCallParams *ncp=linphone_call_params_new();
	memcpy(ncp,cp,sizeof(LinphoneCallParams));
	if (cp->record_file) ncp->record_file=ms_strdup(cp->record_file);
	if (cp->session_name) ncp->session_name=ms_strdup(cp->session_name);
	/*
	 * The management of the custom headers is not optimal. We copy everything while ref counting would be more efficient.
	 */
	if (cp->custom_headers) ncp->custom_headers=sal_custom_header_clone(cp->custom_headers);
	if (cp->custom_sdp_attributes) ncp->custom_sdp_attributes = sal_custom_sdp_attribute_clone(cp->custom_sdp_attributes);
	for (i = 0; i < (unsigned int)LinphoneStreamTypeUnknown; i++) {
		if (cp->custom_sdp_media_attributes[i]) ncp->custom_sdp_media_attributes[i] = sal_custom_sdp_attribute_clone(cp->custom_sdp_media_attributes[i]);
	}

	return ncp;
}