Commit 7588a540 authored by Ghislain MARY's avatar Ghislain MARY

Convert LinphoneCall to Call C++ class.

parent d795a305
This diff is collapsed.
This diff is collapsed.
......@@ -192,7 +192,7 @@ static LinphoneChatRoom *_linphone_core_create_chat_room(LinphoneCore *lc, Linph
}
LinphoneChatRoom *_linphone_core_create_chat_room_from_call(LinphoneCall *call){
LinphoneChatRoom *cr = _linphone_core_create_chat_room_base(call->core,
LinphoneChatRoom *cr = _linphone_core_create_chat_room_base(linphone_call_get_core(call),
linphone_address_clone(linphone_call_get_remote_address(call)));
linphone_chat_room_set_call(cr, call);
return cr;
......@@ -614,7 +614,7 @@ LinphoneStatus linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t
const uint32_t crlf = 0x0D0A;
const uint32_t lf = 0x0A;
if (!call || !call->textstream) {
if (!call || !linphone_call_get_stream(call, LinphoneStreamTypeText)) {
return -1;
}
......@@ -637,7 +637,7 @@ LinphoneStatus linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t
delete value;
}
text_stream_putchar32(call->textstream, character);
text_stream_putchar32(reinterpret_cast<TextStream *>(linphone_call_get_stream(call, LinphoneStreamTypeText)), character);
return 0;
}
......
......@@ -54,8 +54,9 @@ public:
~Participant() {
linphone_address_unref(m_uri);
#if 0
if(m_call) m_call->conf_ref = NULL;
#endif
}
const LinphoneAddress *getUri() const {
......@@ -257,7 +258,9 @@ Conference::Conference(LinphoneCore *core, LinphoneConference *conf, const Confe
int Conference::addParticipant(LinphoneCall *call) {
Participant *p =new Participant(call);
m_participants.push_back(p);
#if 0
call->conf_ref = m_conference;
#endif
return 0;
}
......@@ -424,7 +427,7 @@ int LocalConference::inviteAddresses(const std::list<const LinphoneAddress*> &ad
linphone_call_params_unref(new_params);
}else{
/*there is already a call to this address, so simply join it to the local conference if not already done*/
if (!linphone_call_params_get_in_conference(call->current_params))
if (!linphone_call_params_get_in_conference(linphone_call_get_current_params(call)))
addParticipant(call);
}
/*if the local participant is not yet created, created it and it to the conference */
......@@ -434,6 +437,7 @@ int LocalConference::inviteAddresses(const std::list<const LinphoneAddress*> &ad
}
int LocalConference::addParticipant(LinphoneCall *call) {
#if 0
if (linphone_call_params_get_in_conference(call->current_params)){
ms_error("Already in conference");
return -1;
......@@ -465,9 +469,13 @@ int LocalConference::addParticipant(LinphoneCall *call) {
return -1;
}
return 0;
#else
return 0;
#endif
}
int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){
#if 0
int err=0;
char *str;
......@@ -501,6 +509,9 @@ int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){
err=_linphone_call_pause(call);
}
return err;
#else
return 0;
#endif
}
int LocalConference::remoteParticipantsCount() {
......@@ -522,7 +533,7 @@ int LocalConference::convertConferenceToCall(){
while (calls) {
LinphoneCall *rc=(LinphoneCall*)calls->data;
calls=calls->next;
if (linphone_call_params_get_in_conference(rc->params)) { // not using current_param
if (linphone_call_params_get_in_conference(linphone_call_get_params(rc))) { // not using current_param
bool_t active_after_removed=isIn();
err=removeFromConference(rc, active_after_removed);
break;
......@@ -566,7 +577,7 @@ int LocalConference::terminate() {
while (calls) {
LinphoneCall *call=(LinphoneCall*)calls->data;
calls=calls->next;
if (linphone_call_params_get_in_conference(call->current_params)) {
if (linphone_call_params_get_in_conference(linphone_call_get_current_params(call))) {
linphone_call_terminate(call);
}
}
......@@ -639,6 +650,7 @@ int LocalConference::stopRecording() {
}
void LocalConference::onCallStreamStarting(LinphoneCall *call, bool isPausedByRemote) {
#if 0
linphone_call_params_enable_video(call->params, FALSE);
call->camera_enabled = FALSE;
ms_message("LocalConference::onCallStreamStarting(): joining AudioStream [%p] of call [%p] into conference.", call->audiostream, call);
......@@ -648,16 +660,20 @@ void LocalConference::onCallStreamStarting(LinphoneCall *call, bool isPausedByRe
call->endpoint=ep;
setState(LinphoneConferenceRunning);
Conference::addParticipant(call);
#endif
}
void LocalConference::onCallStreamStopping(LinphoneCall *call) {
#if 0
ms_audio_conference_remove_member(m_conf,call->endpoint);
ms_audio_endpoint_release_from_stream(call->endpoint);
call->endpoint=NULL;
Conference::removeParticipant(call);
#endif
}
void LocalConference::onCallTerminating(LinphoneCall *call) {
#if 0
int remote_count=remoteParticipantsCount();
ms_message("conference_check_uninit(): size=%i", getSize());
if (remote_count==1 && !m_terminating){
......@@ -672,6 +688,7 @@ void LocalConference::onCallTerminating(LinphoneCall *call) {
}
setState(LinphoneConferenceStopped);
}
#endif
}
......@@ -701,6 +718,7 @@ int RemoteConference::inviteAddresses(const std::list<const LinphoneAddress *> &
}
int RemoteConference::addParticipant(LinphoneCall *call) {
#if 0
LinphoneAddress *addr;
LinphoneCallParams *params;
......@@ -742,6 +760,9 @@ int RemoteConference::addParticipant(LinphoneCall *call) {
ms_error("Could not add call %p to the conference. Bad conference state (%s)", call, stateToString(m_state));
return -1;
}
#else
return -1;
#endif
}
int RemoteConference::removeParticipant(const LinphoneAddress *uri) {
......@@ -762,7 +783,7 @@ int RemoteConference::removeParticipant(const LinphoneAddress *uri) {
linphone_address_set_method_param(refer_to_addr, "BYE");
refer_to = linphone_address_as_string(refer_to_addr);
linphone_address_unref(refer_to_addr);
res = sal_call_refer(m_focusCall->op, refer_to);
res = sal_call_refer(linphone_call_get_op(m_focusCall), refer_to);
ms_free(refer_to);
if(res == 0) {
......
......@@ -78,8 +78,8 @@ LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore *lc){
LinphoneStatus linphone_call_send_info_message(LinphoneCall *call, const LinphoneInfoMessage *info) {
SalBodyHandler *body_handler = sal_body_handler_from_content(info->content);
sal_op_set_sent_custom_header(call->op, info->headers);
return sal_send_info(call->op,NULL, NULL, body_handler);
sal_op_set_sent_custom_header(linphone_call_get_op(call), info->headers);
return sal_send_info(linphone_call_get_op(call), NULL, NULL, body_handler);
}
void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value){
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -163,12 +163,7 @@ bool_t linphone_nat_policy_upnp_enabled(const LinphoneNatPolicy *policy) {
void linphone_nat_policy_enable_upnp(LinphoneNatPolicy *policy, bool_t enable) {
policy->upnp_enabled = enable;
if (enable) {
#ifdef BUILD_UPNP
policy->stun_enabled = policy->turn_enabled = policy->ice_enabled = FALSE;
ms_warning("Enabling uPnP NAT policy has disabled any other previously enabled policies");
#else
ms_warning("Cannot enable the uPnP NAT policy because the uPnP support is not compiled in");
#endif
ms_warning("uPnP NAT policy is no longer supported");
}
}
......
......@@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "offeranswer.h"
#include "private.h"
#include "utils/payload-type-handler.h"
static bool_t only_telephone_event(const bctbx_list_t *l){
for(;l!=NULL;l=l->next){
PayloadType *p=(PayloadType*)l->data;
......
......@@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/payload_type.h"
#include "private.h"
#include "utils/payload-type-handler.h"
struct _LinphonePayloadType {
belle_sip_object_t base;
OrtpPayloadType *pt;
......@@ -134,16 +136,16 @@ const char *linphone_payload_type_get_encoder_description(const LinphonePayloadT
}
static int _linphone_core_get_payload_type_normal_bitrate(const LinphoneCore *lc, const OrtpPayloadType *pt) {
int maxbw = get_min_bandwidth(linphone_core_get_download_bandwidth(lc),
int maxbw = LinphonePrivate::PayloadTypeHandler::getMinBandwidth(linphone_core_get_download_bandwidth(lc),
linphone_core_get_upload_bandwidth(lc));
if (pt->type==PAYLOAD_AUDIO_CONTINUOUS || pt->type==PAYLOAD_AUDIO_PACKETIZED){
return get_audio_payload_bandwidth(lc, pt, maxbw);
return LinphonePrivate::PayloadTypeHandler::getAudioPayloadTypeBandwidth(pt, maxbw);
}else if (pt->type==PAYLOAD_VIDEO){
int video_bw;
if (maxbw<=0) {
video_bw=1500; /*default bitrate for video stream when no bandwidth limit is set, around 1.5 Mbit/s*/
}else{
video_bw=get_remaining_bandwidth_for_video(maxbw,lc->audio_bw);
video_bw=LinphonePrivate::PayloadTypeHandler::getRemainingBandwidthForVideo(maxbw,lc->audio_bw);
}
return video_bw;
}
......@@ -258,7 +260,7 @@ bool_t linphone_payload_type_is_vbr(const LinphonePayloadType *pt) {
}
bool_t _linphone_core_check_payload_type_usability(const LinphoneCore *lc, const OrtpPayloadType *pt) {
int maxbw=get_min_bandwidth(linphone_core_get_download_bandwidth(lc),
int maxbw=LinphonePrivate::PayloadTypeHandler::getMinBandwidth(linphone_core_get_download_bandwidth(lc),
linphone_core_get_upload_bandwidth(lc));
return linphone_core_is_payload_type_usable_for_bandwidth(lc, pt, maxbw);
}
......@@ -293,3 +295,15 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphonePayloadType, belle_sip_object_t,
NULL, // marshale
TRUE // unown
);
void payload_type_set_enable(OrtpPayloadType *pt, bool_t value) {
if (value)
payload_type_set_flag(pt, PAYLOAD_TYPE_ENABLED);
else
payload_type_unset_flag(pt, PAYLOAD_TYPE_ENABLED);
}
bool_t payload_type_enabled(const OrtpPayloadType *pt) {
return (pt->flags & PAYLOAD_TYPE_ENABLED);
}
......@@ -112,15 +112,16 @@ void _linphone_player_destroy(LinphonePlayer *player) {
static bool_t call_player_check_state(LinphonePlayer *player, bool_t check_player){
LinphoneCall *call=(LinphoneCall*)player->impl;
if (call->state!=LinphoneCallStreamsRunning){
ms_warning("Call [%p]: in-call player not usable in state [%s]",call,linphone_call_state_to_string(call->state));
if (linphone_call_get_state(call)!=LinphoneCallStreamsRunning){
ms_warning("Call [%p]: in-call player not usable in state [%s]",call,linphone_call_state_to_string(linphone_call_get_state(call)));
return FALSE;
}
if (call->audiostream==NULL) {
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
if (astream==NULL) {
ms_error("call_player_check_state(): no audiostream.");
return FALSE;
}
if (check_player && call->audiostream->av_player.player==NULL){
if (check_player && astream->av_player.player==NULL){
ms_error("call_player_check_state(): no player.");
return FALSE;
}
......@@ -138,7 +139,8 @@ static int call_player_open(LinphonePlayer* player, const char *filename){
LinphoneCall *call=(LinphoneCall*)player->impl;
MSFilter *filter;
if (!call_player_check_state(player,FALSE)) return -1;
filter=audio_stream_open_remote_play(call->audiostream,filename);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
filter=audio_stream_open_remote_play(astream,filename);
if (!filter) return -1;
ms_filter_add_notify_callback(filter,&on_eof,player,FALSE);
return 0;
......@@ -147,33 +149,38 @@ static int call_player_open(LinphonePlayer* player, const char *filename){
static int call_player_start(LinphonePlayer *player){
LinphoneCall *call=(LinphoneCall*)player->impl;
if (!call_player_check_state(player,TRUE)) return -1;
return ms_filter_call_method_noarg(call->audiostream->av_player.player,MS_PLAYER_START);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
return ms_filter_call_method_noarg(astream->av_player.player,MS_PLAYER_START);
}
static int call_player_pause(LinphonePlayer *player){
LinphoneCall *call=(LinphoneCall*)player->impl;
if (!call_player_check_state(player,TRUE)) return -1;
return ms_filter_call_method_noarg(call->audiostream->av_player.player,MS_PLAYER_PAUSE);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
return ms_filter_call_method_noarg(astream->av_player.player,MS_PLAYER_PAUSE);
}
static MSPlayerState call_player_get_state(LinphonePlayer *player){
LinphoneCall *call=(LinphoneCall*)player->impl;
MSPlayerState state=MSPlayerClosed;
if (!call_player_check_state(player,TRUE)) return MSPlayerClosed;
ms_filter_call_method(call->audiostream->av_player.player,MS_PLAYER_GET_STATE,&state);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
ms_filter_call_method(astream->av_player.player,MS_PLAYER_GET_STATE,&state);
return state;
}
static int call_player_seek(LinphonePlayer *player, int time_ms){
LinphoneCall *call=(LinphoneCall*)player->impl;
if (!call_player_check_state(player,TRUE)) return -1;
return ms_filter_call_method(call->audiostream->av_player.player,MS_PLAYER_SEEK_MS,&time_ms);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
return ms_filter_call_method(astream->av_player.player,MS_PLAYER_SEEK_MS,&time_ms);
}
static void call_player_close(LinphonePlayer *player){
LinphoneCall *call=(LinphoneCall*)player->impl;
if (!call_player_check_state(player,TRUE)) return;
audio_stream_close_remote_play(call->audiostream);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
audio_stream_close_remote_play(astream);
}
......
This diff is collapsed.
......@@ -467,13 +467,6 @@ LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *cfg){
if (cfg->contact_uri_params){
linphone_address_set_uri_params(contact,cfg->contact_uri_params);
}
#ifdef BUILD_UPNP
if (cfg->lc->upnp != NULL && linphone_core_get_firewall_policy(cfg->lc)==LinphonePolicyUseUpnp &&
linphone_upnp_context_get_state(cfg->lc->upnp) == LinphoneUpnpStateOk) {
localip = linphone_upnp_context_get_external_ipaddress(cfg->lc->upnp);
localport = linphone_upnp_context_get_external_port(cfg->lc->upnp);
}
#endif //BUILD_UPNP
linphone_address_set_port(contact,localport);
linphone_address_set_domain(contact,localip);
linphone_address_set_display_name(contact,NULL);
......@@ -1274,14 +1267,6 @@ SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg){
static bool_t can_register(LinphoneProxyConfig *cfg){
LinphoneCore *lc=cfg->lc;
#ifdef BUILD_UPNP
if (linphone_core_get_firewall_policy(lc)==LinphonePolicyUseUpnp){
if(lc->sip_conf.register_only_when_upnp_is_ok &&
(lc->upnp == NULL || !linphone_upnp_context_is_ready_for_register(lc->upnp))) {
return FALSE;
}
}
#endif //BUILD_UPNP
if (lc->sip_conf.register_only_when_network_is_up){
return lc->sip_network_reachable;
}
......
......@@ -154,10 +154,15 @@ static uint8_t are_metrics_filled(const reporting_content_metrics_t *rm) {
}
static bool_t quality_reporting_enabled(const LinphoneCall * call) {
#if 0
return (call->dest_proxy != NULL && linphone_proxy_config_quality_reporting_enabled(call->dest_proxy));
#else
return FALSE;
#endif
}
static bool_t media_report_enabled(LinphoneCall * call, int stats_type){
#if 0
if (! quality_reporting_enabled(call))
return FALSE;
......@@ -168,6 +173,9 @@ static bool_t media_report_enabled(LinphoneCall * call, int stats_type){
return FALSE;
return (call->log->reporting.reports[stats_type] != NULL);
#else
return FALSE;
#endif
}
static void append_metrics_to_buffer(char ** buffer, size_t * size, size_t * offset, const reporting_content_metrics_t *rm) {
......@@ -351,18 +359,18 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
linphone_content_set_buffer(content, buffer, strlen(buffer));
ms_free(buffer);
if (call->log->reporting.on_report_sent != NULL) {
SalStreamType type = report == call->log->reporting.reports[0] ? SalAudio : report == call->log->reporting.reports[1] ? SalVideo : SalText;
call->log->reporting.on_report_sent(call, type, content);
if (linphone_call_get_log(call)->reporting.on_report_sent != NULL) {
SalStreamType type = report == linphone_call_get_log(call)->reporting.reports[0] ? SalAudio : report == linphone_call_get_log(call)->reporting.reports[1] ? SalVideo : SalText;
linphone_call_get_log(call)->reporting.on_report_sent(call, type, content);
}
collector_uri = linphone_proxy_config_get_quality_reporting_collector(call->dest_proxy);
collector_uri = linphone_proxy_config_get_quality_reporting_collector(linphone_call_get_dest_proxy(call));
if (!collector_uri){
collector_uri = collector_uri_allocated = ms_strdup_printf("sip:%s", linphone_proxy_config_get_domain(call->dest_proxy));
collector_uri = collector_uri_allocated = ms_strdup_printf("sip:%s", linphone_proxy_config_get_domain(linphone_call_get_dest_proxy(call)));
}
request_uri = linphone_address_new(collector_uri);
lev = linphone_core_create_one_shot_publish(call->core, request_uri, "vq-rtcpxr");
lev = linphone_core_create_one_shot_publish(linphone_call_get_core(call), request_uri, "vq-rtcpxr");
/* Special exception for quality report PUBLISH: if the collector_uri has any transport related parameters
* (port, transport, maddr), then it is sent directly.
* Otherwise it is routed as any LinphoneEvent publish, following proxy config policy.
......@@ -414,6 +422,7 @@ static const SalStreamDescription * get_media_stream_for_desc(const SalMediaDesc
}
static void update_ip(LinphoneCall * call, int stats_type) {
#if 0
SalStreamType sal_stream_type = stats_type == LINPHONE_CALL_STATS_AUDIO ? SalAudio : stats_type == LINPHONE_CALL_STATS_VIDEO ? SalVideo : SalText;
const SalStreamDescription * local_desc = get_media_stream_for_desc(call->localdesc, sal_stream_type);
const SalStreamDescription * remote_desc = get_media_stream_for_desc(sal_call_get_remote_media_description(call->op), sal_stream_type);
......@@ -438,6 +447,7 @@ static void update_ip(LinphoneCall * call, int stats_type) {
STR_REASSIGN(call->log->reporting.reports[stats_type]->info.remote_addr.ip, ms_strdup(sal_call_get_remote_media_description(call->op)->addr));
}
}
#endif
}
static void qos_analyzer_on_action_suggested(void *user_data, int datac, const char** datav){
......@@ -449,7 +459,7 @@ static void qos_analyzer_on_action_suggested(void *user_data, int datac, const c
int bitrate[3] = {-1, -1, -1};
int up_bw[3] = {-1, -1, -1};
int down_bw[3] = {-1, -1, -1};
MediaStream *streams[3] = { (MediaStream*) call->audiostream, (MediaStream *) call->videostream, (MediaStream *) call->textstream };
MediaStream *streams[3] = { linphone_call_get_stream(call, LinphoneStreamTypeAudio), linphone_call_get_stream(call, LinphoneStreamTypeVideo), linphone_call_get_stream(call, LinphoneStreamTypeText) };
for (i = 0; i < 3; i++){
if (streams[i] != NULL){
if (streams[i]->encoder != NULL){
......@@ -462,10 +472,11 @@ static void qos_analyzer_on_action_suggested(void *user_data, int datac, const c
down_bw[i] = (int)(media_stream_get_down_bw(streams[i])/1000.f);
}
}
if (call->audiostream!=NULL){
if (call->audiostream->ms.encoder!=NULL){
if(ms_filter_has_method(call->audiostream->ms.encoder,MS_AUDIO_ENCODER_GET_PTIME)){
ms_filter_call_method(call->audiostream->ms.encoder,MS_AUDIO_ENCODER_GET_PTIME,&ptime);
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
if (astream!=NULL){
if (astream->ms.encoder!=NULL){
if(ms_filter_has_method(astream->ms.encoder,MS_AUDIO_ENCODER_GET_PTIME)){
ms_filter_call_method(astream->ms.encoder,MS_AUDIO_ENCODER_GET_PTIME,&ptime);
}
}
}
......@@ -489,6 +500,7 @@ void linphone_reporting_update_ip(LinphoneCall * call) {
}
void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
#if 0
MediaStream * stream = NULL;
const PayloadType * local_payload = NULL;
const PayloadType * remote_payload = NULL;
......@@ -588,6 +600,7 @@ void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type) {
}
ms_free(dialog_id);
#endif
}
/* generate random float in interval ] 0.9 t ; 1.1 t [*/
......@@ -596,6 +609,7 @@ static float reporting_rand(float t){
}
void linphone_reporting_on_rtcp_update(LinphoneCall *call, SalStreamType stats_type) {
#if 0
reporting_session_report_t * report = call->log->reporting.reports[stats_type];
reporting_content_metrics_t * metrics = NULL;
LinphoneCallStats *stats = NULL;
......@@ -665,9 +679,11 @@ void linphone_reporting_on_rtcp_update(LinphoneCall *call, SalStreamType stats_t
linphone_reporting_update_media_info(call, stats_type);
send_report(call, report, "VQIntervalReport");
}
#endif
}
static int publish_report(LinphoneCall *call, const char *event_type){
#if 0
int ret = 0;
int i;
for (i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; i++){
......@@ -684,11 +700,18 @@ static int publish_report(LinphoneCall *call, const char *event_type){
}
}
return ret;
#else
return 0;
#endif
}
int linphone_reporting_publish_session_report(LinphoneCall* call, bool_t call_term) {
#if 0
const char * session_type = call_term?"VQSessionReport: CallTerm":"VQSessionReport";
return publish_report(call, session_type);
#else
return 0;
#endif
}
int linphone_reporting_publish_interval_report(LinphoneCall* call) {
......@@ -709,6 +732,7 @@ static bool_t set_on_action_suggested_cb(MediaStream *stream,void (*on_action_su
}
void linphone_reporting_call_state_updated(LinphoneCall *call){
#if 0
LinphoneCallState state=linphone_call_get_state(call);
if (state == LinphoneCallReleased||!quality_reporting_enabled(call)){
return;
......@@ -744,6 +768,7 @@ void linphone_reporting_call_state_updated(LinphoneCall *call){
break;
}
}
#endif
}
reporting_session_report_t * linphone_reporting_new() {
......@@ -808,5 +833,5 @@ void linphone_reporting_destroy(reporting_session_report_t * report) {
void linphone_reporting_set_on_report_send(LinphoneCall *call, LinphoneQualityReportingReportSendCb cb){
call->log->reporting.on_report_sent = cb;
linphone_call_get_log(call)->reporting.on_report_sent = cb;
}
This diff is collapsed.
/*
linphone
Copyright (C) 2012 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef LINPHONE_UPNP_H
#define LINPHONE_UPNP_H
#include "mediastreamer2/upnp_igd.h"
#include "linphone/core.h"
#include "sal/sal.h"
typedef struct _UpnpSession UpnpSession;
typedef struct _UpnpContext UpnpContext;
int linphone_call_update_local_media_description_from_upnp(SalMediaDescription *desc, UpnpSession *session);
int linphone_call_update_upnp_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md);
int linphone_call_update_upnp(LinphoneCall *call);
int linphone_upnp_call_process(LinphoneCall *call);
UpnpSession* linphone_upnp_session_new(LinphoneCall *call);
void linphone_upnp_session_destroy(UpnpSession* session);
LinphoneUpnpState linphone_upnp_session_get_state(UpnpSession *session);
UpnpContext *linphone_upnp_context_new(LinphoneCore *lc);
void linphone_upnp_context_destroy(UpnpContext *ctx);
void linphone_upnp_refresh(UpnpContext *ctx);
LinphoneUpnpState linphone_upnp_context_get_state(UpnpContext *ctx);
const char *linphone_upnp_context_get_external_ipaddress(UpnpContext *ctx);
int linphone_upnp_context_get_external_port(UpnpContext *ctx);
bool_t linphone_upnp_context_is_ready_for_register(UpnpContext *ctx);
void linphone_call_update_upnp_state_in_call_stats(LinphoneCall *call);
#endif //LINPHONE_UPNP_H
......@@ -124,9 +124,11 @@ void JitterBufferResetCommand::exec(Daemon *app, const string& args) {
}
istr >> streamtype;
if (streamtype == "video") {
rtprecv = call->videostream ? call->videostream->ms.rtprecv : NULL;
VideoStream *vstream = reinterpret_cast<VideoStream *>(linphone_call_get_stream(call, LinphoneStreamTypeVideo));
rtprecv = vstream ? vstream->ms.rtprecv : NULL;
} else {
rtprecv = call->audiostream ? call->audiostream->ms.rtprecv : NULL;
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
rtprecv = astream ? astream->ms.rtprecv : NULL;
}
} else {
AudioStream *stream = app->findAudioStream(arg2);
......
......@@ -54,11 +54,12 @@ void MSFilterAddFmtpCommand::exec(Daemon *app, const string& args) {
app->sendResponse(Response("No Call with such id."));
return;
}
if (call->audiostream == NULL || call->audiostream->ms.encoder == NULL) {
AudioStream *astream = reinterpret_cast<AudioStream *>(linphone_call_get_stream(call, LinphoneStreamTypeAudio));
if (astream == NULL || astream->ms.encoder == NULL) {
app->sendResponse(Response("This call doesn't have an active audio stream."));
return;
}
ms_filter_call_method(call->audiostream->ms.encoder, MS_FILTER_ADD_FMTP, (void *)fmtp.c_str());
ms_filter_call_method(astream->ms.encoder, MS_FILTER_ADD_FMTP, (void *)fmtp.c_str());
} else if (type.compare("stream") == 0) {
AudioStream *stream = app->findAudioStream(id);
if (stream == NULL) {
......
......@@ -28,10 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* @{
*/
/** Callback prototype */
typedef void (*LinphoneCallCbFunc)(LinphoneCall *call, void *user_data);
#ifdef __cplusplus
extern "C" {
#endif
......@@ -245,7 +241,7 @@ LINPHONE_PUBLIC const char * linphone_call_get_authentication_token(LinphoneCall
* @param call the LinphoneCall
* @return TRUE if authentication token is verifed, false otherwise.
**/
LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified(const LinphoneCall *call);
/**
* Set the result of ZRTP short code verification by user.
......@@ -345,7 +341,7 @@ LINPHONE_PUBLIC void linphone_call_set_audio_route(LinphoneCall *call, LinphoneA
* @param call
* @return 2
**/
LINPHONE_PUBLIC int linphone_call_get_stream_count(LinphoneCall *call);
LINPHONE_PUBLIC int linphone_call_get_stream_count(const LinphoneCall *call);
/**
* Returns the type of stream for the given stream index.
......@@ -353,7 +349,7 @@ LINPHONE_PUBLIC int linphone_call_get_stream_count(LinphoneCall *call);
* @param stream_index
* @return the type (MSAudio, MSVideo, MSText) of the stream of given index.
**/
LINPHONE_PUBLIC MSFormatType linphone_call_get_stream_type(LinphoneCall *call, int stream_index);
LINPHONE_PUBLIC MSFormatType linphone_call_get_stream_type(const LinphoneCall *call, int stream_index);
/**
* Returns the meta rtp transport for the given stream index.
......@@ -361,7 +357,7 @@ LINPHONE_PUBLIC MSFormatType linphone_call_get_stream_type(LinphoneCall *call, i
* @param stream_index
* @return a pointer to the meta rtp transport if it exists, NULL otherwise
**/
LINPHONE_PUBLIC RtpTransport * linphone_call_get_meta_rtp_transport(LinphoneCall *call, int stream_index);
LINPHONE_PUBLIC RtpTransport * linphone_call_get_meta_rtp_transport(const LinphoneCall *call, int stream_index);
/**
* Returns the meta rtcp transport for the given stream index.
......@@ -369,7 +365,7 @@ LINPHONE_PUBLIC RtpTransport * linphone_call_get_meta_rtp_transport(LinphoneCall
* @param stream_index
* @return a pointer to the meta rtcp transport if it exists, NULL otherwise
**/
LINPHONE_PUBLIC RtpTransport * linphone_call_get_meta_rtcp_transport(LinphoneCall *call, int stream_index);
LINPHONE_PUBLIC RtpTransport * linphone_call_get_meta_rtcp_transport(const LinphoneCall *call, int stream_index);
/**
* Pauses the call. If a music file has been setup using linphone_core_set_play_file(),
......@@ -715,7 +711,7 @@ LINPHONE_PUBLIC void linphone_call_enable_echo_cancellation(LinphoneCall *call,
/**
* Returns TRUE if echo cancellation is enabled.
**/
LINPHONE_PUBLIC bool_t linphone_call_echo_cancellation_enabled(LinphoneCall *lc);
LINPHONE_PUBLIC bool_t linphone_call_echo_cancellation_enabled(const LinphoneCall *call);
/**
* Enables or disable echo limiter for this call
......@@ -751,14 +747,14 @@ LINPHONE_PUBLIC LinphoneChatRoom * linphone_call_get_chat_room(LinphoneCall *cal
* @param call The call.
* @return float Volume level in percentage.
*/
LINPHONE_PUBLIC float linphone_call_get_play_volume(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_play_volume(const LinphoneCall *call);
/**
* Get the mesured record volume level (sent to remote) in dbm0.
* @param call The call.
* @return float Volume level in percentage.
*/
LINPHONE_PUBLIC float linphone_call_get_record_volume(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_record_volume(const LinphoneCall *call);
/**
* Get speaker volume gain.
......@@ -813,14 +809,14 @@ LINPHONE_PUBLIC void linphone_call_set_microphone_volume_gain(LinphoneCall *call
* @return The function returns -1 if no quality measurement is available, for example if no
* active audio stream exist. Otherwise it returns the quality rating.
**/
LINPHONE_PUBLIC float linphone_call_get_current_quality(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_current_quality(const LinphoneCall *call);
/**
* Returns call quality averaged over all the duration of the call.
*
* See linphone_call_get_current_quality() for more details about quality measurement.
**/
LINPHONE_PUBLIC float linphone_call_get_average_quality(LinphoneCall *call);
LINPHONE_PUBLIC float linphone_call_get_average_quality(const LinphoneCall *call);
/**
* Start call recording.
......@@ -849,7 +845,7 @@ LINPHONE_PUBLIC LinphonePlayer * linphone_call_get_player(LinphoneCall *call);