Commit dd2de72f authored by Nicolas Follet's avatar Nicolas Follet Committed by Wescoeur

add functions : linphone::conference getId, linphone::conference setId,...

add functions : linphone::conference getId, linphone::conference setId, linphone::call getToHeader. delete headers from callLogs
parent f0468337
......@@ -1165,18 +1165,30 @@ static void discover_mtu(LinphoneCore *lc, const char *remote){
}
}
void linphone_call_create_op(LinphoneCall *call){
void linphone_call_create_op_to(LinphoneCall *call, LinphoneAddress *to){
if (call->op) sal_op_release(call->op);
call->op=sal_op_new(call->core->sal);
sal_op_set_user_pointer(call->op,call);
if (call->params->referer)
sal_call_set_referer(call->op,call->params->referer->op);
linphone_configure_op(call->core,call->op,call->log->to,call->params->custom_headers,FALSE);
linphone_configure_op(call->core,call->op,to,call->params->custom_headers,FALSE);
if (call->params->privacy != LinphonePrivacyDefault)
sal_op_set_privacy(call->op,(SalPrivacyMask)call->params->privacy);
/*else privacy might be set by proxy */
}
void linphone_call_create_op(LinphoneCall *call){
if (call->op) sal_op_release(call->op);
call->op=sal_op_new(call->core->sal);
sal_op_set_user_pointer(call->op,call);
if (call->params->referer)
sal_call_set_referer(call->op,call->params->referer->op);
linphone_configure_op(call->core,call->op,call->log->to,call->params->custom_headers,FALSE);
if (call->params->privacy != LinphonePrivacyDefault)
sal_op_set_privacy(call->op,(SalPrivacyMask)call->params->privacy);
/*else privacy might be set by proxy */
}
/*
* Choose IP version we are going to use for RTP streams IP address advertised in SDP.
* The algorithm is as follows:
......@@ -1366,7 +1378,7 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
call->referer=linphone_call_ref(params->referer);
}
linphone_call_create_op(call);
linphone_call_create_op_to(call, to);
return call;
}
......@@ -2171,6 +2183,10 @@ const LinphoneAddress * linphone_call_get_to_address(const LinphoneCall *call){
return (const LinphoneAddress *)sal_op_get_to_address(call->op);
}
const char *linphone_call_get_to_header(const LinphoneCall *call, const char *name){
return sal_custom_header_find(sal_op_get_recv_custom_header(call->op),name);
}
char *linphone_call_get_remote_address_as_string(const LinphoneCall *call){
return linphone_address_as_string(linphone_call_get_remote_address(call));
}
......@@ -5953,7 +5969,7 @@ end:
}
int linphone_call_restart_invite(LinphoneCall *call) {
linphone_call_create_op(call);
linphone_call_create_op(call);
linphone_call_stop_media_streams(call);
ms_media_stream_sessions_uninit(&call->sessions[call->main_audio_stream_index]);
ms_media_stream_sessions_uninit(&call->sessions[call->main_video_stream_index]);
......
......@@ -309,7 +309,11 @@ LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *fr
cl->start_date_time=time(NULL);
set_call_log_date(cl,cl->start_date_time);
cl->from=from;
cl->to=to;
LinphoneAddress * to_tmp = linphone_address_clone(to);
linphone_address_clean(to_tmp);
cl->to=to_tmp;
cl->status=LinphoneCallAborted; /*default status*/
cl->quality=-1;
cl->storage_id=0;
......
......@@ -94,17 +94,18 @@ public:
m_stateChangedCb = cb;
m_userData = userData;
}
private:
bool m_enableVideo;
LinphoneConferenceStateChangedCb m_stateChangedCb;
void *m_userData;
void *m_userData;
friend class Conference;
};
};
Conference(LinphoneCore *core, LinphoneConference *conf, const Params *params = NULL);
virtual ~Conference() {};
virtual ~Conference() {
if(m_conferenceID)
ms_free(m_conferenceID);
}
const Params &getCurrentParams() const {return m_currentParams;}
......@@ -138,20 +139,28 @@ public:
return m_core;
}
static const char *stateToString(LinphoneConferenceState state);
void setID(const char *conferenceID) {
if (m_conferenceID)
ms_free(m_conferenceID);
m_conferenceID = ms_strdup(conferenceID);
}
const char *getID() {return m_conferenceID;}
protected:
void setState(LinphoneConferenceState state);
Participant *findParticipant(const LinphoneCall *call) const;
Participant *findParticipant(const LinphoneAddress *uri) const;
protected:
char *m_conferenceID=NULL;
LinphoneCore *m_core;
AudioStream *m_localParticipantStream;
bool m_isMuted;
std::list<Participant *> m_participants;
Params m_currentParams;
LinphoneConferenceState m_state;
LinphoneConference *m_conference;
LinphoneConference *m_conference;
};
class LocalConference: public Conference {
......@@ -1170,3 +1179,11 @@ bool_t linphone_conference_check_class(LinphoneConference *obj, LinphoneConferen
LinphoneStatus linphone_conference_invite_participants(LinphoneConference *obj, const bctbx_list_t *addresses, const LinphoneCallParams *params){
return obj->conf->inviteAddresses(toStd<const LinphoneAddress*>(addresses), params);
}
const char * linphone_conference_get_ID(const LinphoneConference *obj) {
return obj->conf->getID();
}
void linphone_conference_set_ID(const LinphoneConference *obj, const char *conferenceID) {
obj->conf->setID(conferenceID);
}
......@@ -1305,6 +1305,7 @@ bool_t linphone_core_tone_indications_enabled(LinphoneCore*lc);
const char *linphone_core_create_uuid(LinphoneCore *lc);
void linphone_configure_op(LinphoneCore *lc, SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact);
void linphone_configure_op_with_proxy(LinphoneCore *lc, SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy);
void linphone_call_create_op_to(LinphoneCall *call, LinphoneAddress *to);
void linphone_call_create_op(LinphoneCall *call);
int linphone_call_prepare_ice(LinphoneCall *call, bool_t incoming_offer);
void linphone_core_notify_info_message(LinphoneCore* lc,SalOp *op, SalBodyHandler *body);
......
......@@ -96,6 +96,11 @@ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_get_remote_address(const L
**/
LINPHONE_PUBLIC const LinphoneAddress * linphone_call_get_to_address(const LinphoneCall * call);
/**
* Returns the value of the header name
**/
LINPHONE_PUBLIC const char * linphone_call_get_to_header(const LinphoneCall *call, const char *name);
/**
* Returns the remote address associated to this call as a string.
* The result string must be freed by user using ms_free().
......
......@@ -125,6 +125,16 @@ LINPHONE_PUBLIC bctbx_list_t *linphone_conference_get_participants(const Linphon
**/
LINPHONE_PUBLIC LinphoneStatus linphone_conference_invite_participants(LinphoneConference *conf, const bctbx_list_t *addresses, const LinphoneCallParams *params);
/**
*Get the conference id as string
*/
LINPHONE_PUBLIC const char *linphone_conference_get_ID(const LinphoneConference *obj);
/**
*set the conference id as string
*/
LINPHONE_PUBLIC void linphone_conference_set_ID(const LinphoneConference *obj, const char *conferenceID);
/**
* @}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment