linphone_core_get_local_ip(lc,linphone_address_get_domain(to),call->localip);
linphone_call_init_common(call,from,to);
_linphone_call_params_copy(&call->params,params);
+ sal_op_set_custom_header(call->op,call->params.custom_headers);
+
if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseIce) {
call->ice_session = ice_session_new();
ice_session_set_role(call->ice_session, IR_Controlling);
if (obj->auth_token) {
ms_free(obj->auth_token);
}
- if (obj->params.record_file)
- ms_free(obj->params.record_file);
-
+ linphone_call_params_uninit(&obj->params);
ms_free(obj);
}
cp->low_bandwidth=TRUE;
}
}
+ cp->custom_headers=(SalCustomHeader*)sal_op_get_custom_header(call->op);
return cp;
}
}
#endif
}
+#ifdef VIDEO_ENABLED
+/**
+ * Request remote side to send us a Video Fast Update.
+**/
+void linphone_call_send_vfu_request(LinphoneCall *call)
+{
+ if (LinphoneCallStreamsRunning == linphone_call_get_state(call))
+ sal_call_send_vfu_request(call->op);
+}
+#endif
+
+
/**
* Take a photo of currently received video and write it into a jpeg file.
**/
return cp->has_video;
}
+/**
+ * Returns kind of media encryption selected for the call.
+**/
enum LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp) {
return cp->media_encryption;
}
+/**
+ * Set requested media encryption for a call.
+**/
void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, enum LinphoneMediaEncryption e) {
cp->media_encryption = e;
}
cp->real_early_media=enabled;
}
+/**
+ * Indicates whether sending of early media was enabled.
+**/
bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp){
return cp->real_early_media;
}
cp->audio_bw=bandwidth;
}
-#ifdef VIDEO_ENABLED
-/**
- * Request remote side to send us a Video Fast Update.
-**/
-void linphone_call_send_vfu_request(LinphoneCall *call)
-{
- if (LinphoneCallStreamsRunning == linphone_call_get_state(call))
- sal_call_send_vfu_request(call->op);
+void linphone_call_params_add_custom_header(LinphoneCallParams *params, const char *header_name, const char *header_value){
+ params->custom_headers=sal_custom_header_append(params->custom_headers,header_name,header_value);
}
-#endif
+const char *linphone_call_params_get_custom_header(LinphoneCallParams *params, const char *header_name){
+ return sal_custom_header_find(params->custom_headers,header_name);
+}
void _linphone_call_params_copy(LinphoneCallParams *ncp, const LinphoneCallParams *cp){
memcpy(ncp,cp,sizeof(LinphoneCallParams));
if (cp->record_file) ncp->record_file=ms_strdup(cp->record_file);
+ /*
+ * 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);
}
/**
- *
+ * Copy existing LinphoneCallParams to a new LinphoneCallParams object.
**/
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp){
LinphoneCallParams *ncp=ms_new0(LinphoneCallParams,1);
return ncp;
}
+void linphone_call_params_uninit(LinphoneCallParams *p){
+ if (p->record_file) ms_free(p->record_file);
+ if (p->custom_headers) sal_custom_header_free(p->custom_headers);
+}
+
/**
- *
+ * Destroy LinphoneCallParams.
**/
void linphone_call_params_destroy(LinphoneCallParams *p){
- if (p->record_file) ms_free(p->record_file);
+ linphone_call_params_uninit(p);
ms_free(p);
}
+
/**
* @}
**/