+int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call, LinphoneProxyConfig *dest_proxy){
+ int err;
+ char *contact;
+ char *real_url,*barmsg;
+ char *from;
+ /*try to be best-effort in giving real local or routable contact address */
+ contact=get_fixed_contact(lc,call,dest_proxy);
+ if (contact){
+ sal_op_set_contact(call->op, contact);
+ ms_free(contact);
+ }
+ call->state=LCStateInit;
+ linphone_core_init_media_streams(lc,lc->call);
+ if (!lc->sip_conf.sdp_200_ack){
+ call->media_pending=TRUE;
+ sal_call_set_local_media_description(call->op,call->localdesc);
+ }
+ real_url=linphone_address_as_string(call->log->to);
+ from=linphone_address_as_string(call->log->from);
+ err=sal_call(call->op,from,real_url);
+
+ if (lc->sip_conf.sdp_200_ack){
+ call->media_pending=TRUE;
+ sal_call_set_local_media_description(call->op,call->localdesc);
+ }
+ barmsg=ortp_strdup_printf("%s %s", _("Contacting"), real_url);
+ lc->vtable.display_status(lc,barmsg);
+ ms_free(barmsg);
+
+ if (err<0){
+ ms_warning("Could not initiate call.");
+ lc->vtable.display_status(lc,_("could not call"));
+ linphone_core_stop_media_streams(lc,call);
+ linphone_call_destroy(call);
+ lc->call=NULL;
+ }else gstate_new_state(lc, GSTATE_CALL_OUT_INVITE, real_url);
+ ms_free(real_url);
+ ms_free(from);
+ return err;
+}
+