Commit 21945138 authored by johan's avatar johan
Browse files

Merge remote-tracking branch 'origin/master' into dev_dtls

parents c95fd551 acab82a2
......@@ -7,6 +7,8 @@ SUBDIRS = build m4 pixmaps po @ORTP_DIR@ @MS2_DIR@ \
coreapi console gtk share scripts tools tester include
GITVERSION=`cd $(top_srcdir) && git describe --always || echo $(VERSION)`
ACLOCAL_FLAGS=-I$(top_srcdir)/m4
......@@ -20,11 +22,11 @@ OPTIONAL_SOUNDS=\
INSTALLDIR=$(abs_top_builddir)/linphone-install
INSTALLDIR_WITH_PREFIX=$(INSTALLDIR)/$(prefix)
ZIPFILE=$(abs_top_builddir)/$(PACKAGE)-win32-$(VERSION).zip
ZIPFILE=$(abs_top_builddir)/$(PACKAGE)-win32-$(GITVERSION).zip
ZIP_EXCLUDED=include lib \
$(OPTIONAL_SOUNDS)
SDK_ZIPFILE=$(abs_top_builddir)/lib$(PACKAGE)-win32-$(VERSION).zip
SDK_ZIPFILE=$(abs_top_builddir)/lib$(PACKAGE)-win32-sdk-$(GITVERSION).zip
SDK_EXCLUDED= \
bin/linphone.exe \
lib/*.la \
......@@ -173,7 +175,7 @@ setup.exe: filelist
cp $(ISS_SCRIPT) $(INSTALLDIR_WITH_PREFIX)/.
cd $(INSTALLDIR_WITH_PREFIX) && \
$(ISCC) $(ISS_SCRIPT)
mv $(INSTALLDIR_WITH_PREFIX)/Output/setup.exe $(PACKAGE)-$(VERSION)-setup.exe
mv $(INSTALLDIR_WITH_PREFIX)/Output/setup.exe $(PACKAGE)-setup-$(GITVERSION).exe
rm -rf $(INSTALLDIR_WITH_PREFIX)/Output
rm -f $(INSTALLDIR_WITH_PREFIX)/$(PACKAGE_WIN32_FILELIST)
rm -f $(INSTALLDIR_WITH_PREFIX)/$(ISS_SCRIPT)
......@@ -201,8 +203,8 @@ Portfile-devel: $(top_srcdir)/scripts/Portfile-devel.tmpl dist
### MAC
MACAPPNAME=Linphone.app
MACAPPZIP=$(PACKAGE)-$(VERSION).app.zip
MACAPPDMG=$(PACKAGE)-$(VERSION).dmg
MACAPPZIP=$(PACKAGE)-$(GITVERSION).app.zip
MACAPPDMG=$(PACKAGE)-$(GITVERSION).dmg
BUNDLEPREFIX=./
BUNDLEDIR=$(BUNDLEPREFIX)$(MACAPPNAME)
#a path prefix where additional libs can be cherry-picked by the bundler.
......
......@@ -53,7 +53,7 @@ Install `GTK`. It is recommended to use the `quartz` backend for better integrat
brew install cairo --without-x11
brew install gtk+ --without-x11
brew install gettext gtk-mac-integration libsoup
brew install gettext gtk-mac-integration libsoup hicolor-icon-theme
#readline is required from linphonec.c otherwise compilation will fail
brew link readline --force
......@@ -148,6 +148,15 @@ If you don't need plugins, remove or comment out this line from the bundler file
${prefix:ms2plugins}/lib/mediastreamer/plugins/*.*.so
</binary>
If using HomeBrew, this is not working yet. However you will at least need to:
brew install shared-mime-info glib-networking hicolor-icon-theme
update-mime-database /usr/local/share/mime
And modify also:
<prefix name="default">/usr/local</prefix>
Then run, inside Linphone source tree configure as told before but with `--enable-relativeprefix` appended.
make && make bundle
......
......@@ -33,6 +33,11 @@ fi
INTLTOOLIZE=$(which intltoolize)
#workaround for mingw bug in intltoolize script.
if test "$INTLTOOLIZE" = "/bin/intltoolize" ; then
INTLTOOLIZE=/usr/bin/intltoolize
fi
echo "Generating build scripts in linphone..."
set -x
$LIBTOOLIZE --copy --force
......
......@@ -18,7 +18,8 @@ common_SRC_FILES := \
transport_tester.c \
player_tester.c \
dtmf_tester.c \
accountmanager.c
accountmanager.c \
offeranswer_tester.c
common_C_INCLUDES += \
$(LOCAL_PATH) \
......
......@@ -26,6 +26,8 @@
<string>Copyright 2011 Belledonne Communications</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
<key>NSAppSleepDisabled</key>
<string>YES</string>
</dict>
</plist>
......@@ -62,7 +62,10 @@ case $target in
*mingw*)
CFLAGS="$CFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501 "
CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
LIBS="$LIBS -L/lib -lws2_32"
dnl Workaround for mingw, whose compiler does not check in /usr/include ...
CPPFLAGS="$CPPFLAGS -I/usr/include"
LDFLAGS="$LDFLAGS -L/usr/lib"
LIBS="$LIBS -lws2_32"
GUI_FLAGS="-mwindows"
CONSOLE_FLAGS="-mconsole"
mingw_found=yes
......@@ -298,7 +301,7 @@ if test "$build_zlib" != "false" ; then
AC_MSG_NOTICE([zlib library and headers not found])
else
AC_DEFINE( HAVE_ZLIB, 1, [ZLIB support] )
ZLIBS_LIBS='-z'
ZLIB_LIBS='-lz'
AC_SUBST(ZLIB_LIBS)
fi
else
......
......@@ -159,6 +159,13 @@ bool_t linphone_address_is_secure(const LinphoneAddress *uri){
return sal_address_is_secure(uri);
}
/**
* returns true if address is a routable sip address
*/
bool_t linphone_address_is_sip(const LinphoneAddress *uri){
return sal_address_is_sip(uri);
}
static bool_t strings_equals(const char *s1, const char *s2){
if (s1==NULL && s2==NULL) return TRUE;
if (s1!=NULL && s2!=NULL && strcmp(s1,s2)==0) return TRUE;
......
......@@ -151,6 +151,11 @@ char *sal_address_as_string(const SalAddress *addr){
return ms_strdup(tmp);
}
bool_t sal_address_is_sip(const SalAddress *addr){
belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr);
return belle_sip_header_address_get_uri(header_addr) != NULL;
}
char *sal_address_as_string_uri_only(const SalAddress *addr){
belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr);
belle_sip_uri_t* sip_uri = belle_sip_header_address_get_uri(header_addr);
......@@ -210,7 +215,7 @@ void sal_address_unref(SalAddress *addr){
belle_sip_object_unref(BELLE_SIP_HEADER_ADDRESS(addr));
}
bool_t sal_address_is_ipv6(SalAddress *addr){
bool_t sal_address_is_ipv6(const SalAddress *addr){
belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr);
belle_sip_uri_t* uri = belle_sip_header_address_get_uri(header_addr);
if (uri){
......
......@@ -97,6 +97,7 @@ static int set_sdp(belle_sip_message_t *msg,belle_sdp_session_description_t* ses
error = belle_sip_object_marshal(BELLE_SIP_OBJECT(session_desc),buff,bufLen,&length);
if( error != BELLE_SIP_OK ){
bufLen *= 2;
length = 0;
buff = belle_sip_realloc(buff,bufLen);
}
}
......@@ -687,6 +688,11 @@ int sal_call(SalOp *op, const char *from, const char *to){
ms_message("[%s] calling [%s] on op [%p]", from, to, op);
invite=sal_op_build_request(op,"INVITE");
if( invite == NULL ){
/* can happen if the op has an invalid address */
return -1;
}
sal_op_fill_invite(op,invite);
sal_op_call_fill_cbs(op);
......
......@@ -198,6 +198,9 @@ int sal_subscribe(SalOp *op, const char *from, const char *to, const char *event
sal_op_subscribe_fill_cbs(op);
/*???sal_exosip_fix_route(op); make sure to ha ;lr*/
req=sal_op_build_request(op,"SUBSCRIBE");
if( req == NULL ) {
return -1;
}
if (eventname){
if (op->event) belle_sip_object_unref(op->event);
op->event=belle_sip_header_create("Event",eventname);
......
......@@ -150,20 +150,37 @@ belle_sip_request_t* sal_op_build_request(SalOp *op,const char* method) {
belle_sip_provider_t* prov=op->base.root->prov;
belle_sip_request_t *req;
belle_sip_uri_t* req_uri;
belle_sip_uri_t* to_uri;
const SalAddress* to_address;
const MSList *elem=sal_op_get_route_addresses(op);
char token[10];
/* check that the op has a correct to address */
to_address = sal_op_get_to_address(op);
if( to_address == NULL ){
ms_error("No To: address, cannot build request");
return NULL;
}
to_uri = belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(to_address));
if( to_uri == NULL ){
ms_error("To: address is invalid, cannot build request");
return NULL;
}
if (strcmp("REGISTER",method)==0 || op->privacy==SalPrivacyNone) {
from_header = belle_sip_header_from_create(BELLE_SIP_HEADER_ADDRESS(sal_op_get_from_address(op))
,belle_sip_random_token(token,sizeof(token)));
,belle_sip_random_token(token,sizeof(token)));
} else {
from_header=belle_sip_header_from_create2("Anonymous <sip:anonymous@anonymous.invalid>",belle_sip_random_token(token,sizeof(token)));
}
/*make sure to preserve components like headers or port*/
req_uri = (belle_sip_uri_t*)belle_sip_object_clone((belle_sip_object_t*)belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(sal_op_get_to_address(op))));
req_uri = (belle_sip_uri_t*)belle_sip_object_clone((belle_sip_object_t*)to_uri);
belle_sip_uri_set_secure(req_uri,sal_op_is_secure(op));
to_header = belle_sip_header_to_create(BELLE_SIP_HEADER_ADDRESS(sal_op_get_to_address(op)),NULL);
to_header = belle_sip_header_to_create(BELLE_SIP_HEADER_ADDRESS(to_address),NULL);
req=belle_sip_request_create(
req_uri,
......@@ -218,7 +235,10 @@ int sal_ping(SalOp *op, const char *from, const char *to){
void sal_op_set_remote_ua(SalOp*op,belle_sip_message_t* message) {
belle_sip_header_user_agent_t* user_agent=belle_sip_message_get_header_by_type(message,belle_sip_header_user_agent_t);
char user_agent_string[256];
if(user_agent && belle_sip_header_user_agent_get_products_as_string(user_agent,user_agent_string,sizeof(user_agent_string))>0) {
if (user_agent && belle_sip_header_user_agent_get_products_as_string(user_agent,user_agent_string,sizeof(user_agent_string))>0) {
if (op->base.remote_ua!=NULL){
ms_free(op->base.remote_ua);
}
op->base.remote_ua=ms_strdup(user_agent_string);
}
}
......
......@@ -172,6 +172,9 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
op->dir=SalOpDirOutgoing;
req=sal_op_build_request(op,"MESSAGE");
if (req == NULL ){
return -1;
}
if (sal_op_get_contact_address(op)){
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(sal_op_create_contact(op)));
}
......
......@@ -306,8 +306,10 @@ int sal_subscribe_presence(SalOp *op, const char *from, const char *to, int expi
belle_sip_parameters_remove_parameter(BELLE_SIP_PARAMETERS(op->base.from_address),"tag");
belle_sip_parameters_remove_parameter(BELLE_SIP_PARAMETERS(op->base.to_address),"tag");
req=sal_op_build_request(op,"SUBSCRIBE");
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),op->event);
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_expires_create(expires)));
if( req ){
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),op->event);
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(belle_sip_header_expires_create(expires)));
}
return sal_op_send_request(op,req);
}
......
......@@ -76,6 +76,11 @@ int sal_publish_presence(SalOp *op, const char *from, const char *to, int expire
op->type=SalOpPublish;
req=sal_op_build_request(op,"PUBLISH");
if( req == NULL ){
return -1;
}
if (sal_op_get_contact_address(op)){
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(sal_op_create_contact(op)));
}
......@@ -101,6 +106,10 @@ int sal_publish(SalOp *op, const char *from, const char *to, const char *eventna
sal_op_publish_fill_cbs(op);
req=sal_op_build_request(op,"PUBLISH");
if( req == NULL ){
return -1;
}
if (sal_op_get_contact_address(op)){
belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(sal_op_create_contact(op)));
}
......
......@@ -96,7 +96,23 @@ static void prepare_early_media_forking(LinphoneCall *call){
if (call->videostream){
rtp_session_set_symmetric_rtp(call->videostream->ms.sessions.rtp_session,FALSE);
}
}
void linphone_call_update_frozen_payloads(LinphoneCall *call, SalMediaDescription *result_desc){
SalMediaDescription *local=call->localdesc;
int i;
for(i=0;i<result_desc->nb_streams;++i){
MSList *elem;
for (elem=result_desc->streams[i].payloads;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
if (is_payload_type_number_available(local->streams[i].already_assigned_payloads, payload_type_get_number(pt), NULL)){
/*new codec, needs to be added to the list*/
local->streams[i].already_assigned_payloads=ms_list_append(local->streams[i].already_assigned_payloads, payload_type_clone(pt));
ms_message("LinphoneCall[%p] : payload type %i %s/%i fmtp=%s added to frozen list.",
call, payload_type_get_number(pt), pt->mime_type, pt->clock_rate, pt->recv_fmtp ? pt->recv_fmtp : NULL);
}
}
}
}
void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md){
......@@ -181,6 +197,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
if (call->state==LinphoneCallPausing && call->paused_by_app && ms_list_size(lc->calls)==1){
linphone_core_play_named_tone(lc,LinphoneToneCallOnHold);
}
linphone_call_update_frozen_payloads(call, new_md);
end:
if (oldmd)
sal_media_description_unref(oldmd);
......@@ -597,7 +614,7 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call, bool_t
}
}
if (call->state==LinphoneCallStreamsRunning) {
if ( call->state == LinphoneCallStreamsRunning) {
/*reINVITE and in-dialogs UPDATE go here*/
linphone_core_notify_display_status(lc,_("Call is updated by remote."));
call->defer_update=FALSE;
......@@ -605,8 +622,21 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call, bool_t
if (call->defer_update==FALSE){
linphone_core_accept_call_update(lc,call,NULL);
}
if (rmd==NULL)
if (rmd==NULL){
call->expect_media_in_ack=TRUE;
}
} else if( call->state == LinphoneCallPausedByRemote ){
/* Case where no SDP is present and we were paused by remote.
* We send back an ACK with our SDP and expect the remote to send its own.
* No state change here until an answer is received. */
call->defer_update=FALSE;
if (call->defer_update==FALSE){
_linphone_core_accept_call_update(lc,call,NULL,call->state,linphone_call_state_to_string(call->state));
}
if (rmd==NULL){
call->expect_media_in_ack=TRUE;
}
} else if (is_update){ /*SIP UPDATE case, can occur in early states*/
linphone_call_set_state(call, LinphoneCallEarlyUpdatedByRemote, "EarlyUpdatedByRemote");
_linphone_core_accept_call_update(lc,call,NULL,call->prevstate,linphone_call_state_to_string(call->prevstate));
......
......@@ -234,35 +234,154 @@ void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t
propagate_encryption_changed(call);
}
static MSList *make_codec_list(LinphoneCore *lc, const MSList *codecs, int bandwidth_limit,int* max_sample_rate, int nb_codecs_limit){
MSList *l=NULL;
static int get_max_codec_sample_rate(const MSList *codecs){
int max_sample_rate=0;
const MSList *it;
int nb = 0;
if (max_sample_rate) *max_sample_rate=0;
for(it=codecs;it!=NULL;it=it->next){
PayloadType *pt=(PayloadType*)it->data;
if (pt->flags & PAYLOAD_TYPE_ENABLED){
int sample_rate = payload_type_get_rate(pt);
int sample_rate;
if( strcasecmp("G722",pt->mime_type) == 0 ){
/* G722 spec says 8000 but the codec actually requires 16000 */
sample_rate = 16000;
}else sample_rate=pt->clock_rate;
if (sample_rate>max_sample_rate) max_sample_rate=sample_rate;
}
return max_sample_rate;
}
if( strcasecmp("G722",pt->mime_type) == 0 ){
/* G722 spec says 8000 but the codec actually requires 16000 */
ms_debug("Correcting sample rate for G722");
sample_rate = 16000;
static int find_payload_type_number(const MSList *assigned, const PayloadType *pt){
const MSList *elem;
const PayloadType *candidate=NULL;
for(elem=assigned;elem!=NULL;elem=elem->next){
const PayloadType *it=(const PayloadType*)elem->data;
if ((strcasecmp(pt->mime_type, payload_type_get_mime(it)) == 0)
&& (it->clock_rate==pt->clock_rate)
&& (it->channels==pt->channels || pt->channels<=0)) {
candidate=it;
if ((it->recv_fmtp!=NULL && pt->recv_fmtp!=NULL && strcasecmp(it->recv_fmtp, pt->recv_fmtp)==0)
|| (it->recv_fmtp==NULL && pt->recv_fmtp==NULL)){
break;/*exact match*/
}
}
}
return candidate ? payload_type_get_number(candidate) : -1;
}
if (bandwidth_limit>0 && !linphone_core_is_payload_type_usable_for_bandwidth(lc,pt,bandwidth_limit)){
ms_message("Codec %s/%i eliminated because of audio bandwidth constraint of %i kbit/s",
pt->mime_type,pt->clock_rate,bandwidth_limit);
continue;
bool_t is_payload_type_number_available(const MSList *l, int number, const PayloadType *ignore){
const MSList *elem;
for (elem=l; elem!=NULL; elem=elem->next){
const PayloadType *pt=(PayloadType*)elem->data;
if (pt!=ignore && payload_type_get_number(pt)==number) return FALSE;
}
return TRUE;
}
static void linphone_core_assign_payload_type_numbers(LinphoneCore *lc, MSList *codecs){
MSList *elem;
int dyn_number=lc->codecs_conf.dyn_pt;
for (elem=codecs; elem!=NULL; elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
int number=payload_type_get_number(pt);
/*check if number is duplicated: it could be the case if the remote forced us to use a mapping with a previous offer*/
if (number!=-1 && !(pt->flags & PAYLOAD_TYPE_FROZEN_NUMBER)){
if (!is_payload_type_number_available(codecs, number, pt)){
ms_message("Reassigning payload type %i %s/%i because already offered.", number, pt->mime_type, pt->clock_rate);
number=-1; /*need to be re-assigned*/
}
}
if (number==-1){
while(dyn_number<127){
if (is_payload_type_number_available(codecs, dyn_number, NULL)){
payload_type_set_number(pt, dyn_number);
dyn_number++;
break;
}
dyn_number++;
}
if (linphone_core_check_payload_type_usability(lc,pt)){
l=ms_list_append(l,payload_type_clone(pt));
nb++;
if (max_sample_rate && sample_rate>*max_sample_rate) *max_sample_rate=sample_rate;
if (dyn_number==127){
ms_error("Too many payload types configured ! codec %s/%i is disabled.", pt->mime_type, pt->clock_rate);
payload_type_set_enable(pt, FALSE);
}
}
}
}
static bool_t has_telephone_event_at_rate(const MSList *tev, int rate){
const MSList *it;
for(it=tev;it!=NULL;it=it->next){
const PayloadType *pt=(PayloadType*)it->data;
if (pt->clock_rate==rate) return TRUE;
}
return FALSE;
}
static MSList * create_telephone_events(LinphoneCore *lc, const MSList *codecs){
const MSList *it;
MSList *ret=NULL;
for(it=codecs;it!=NULL;it=it->next){
const PayloadType *pt=(PayloadType*)it->data;
if (!has_telephone_event_at_rate(ret,pt->clock_rate)){
PayloadType *tev=payload_type_clone(&payload_type_telephone_event);
tev->clock_rate=pt->clock_rate;
/*let it choose the number dynamically as for normal codecs*/
payload_type_set_number(tev, -1);
if (ret==NULL){
/*But for first telephone-event, prefer the number that was configured in the core*/
if (is_payload_type_number_available(codecs, lc->codecs_conf.telephone_event_pt, NULL)){
payload_type_set_number(tev, lc->codecs_conf.telephone_event_pt);
}
}
ret=ms_list_append(ret,tev);
}
if ((nb_codecs_limit > 0) && (nb >= nb_codecs_limit)) break;
}
return ret;
}
typedef struct _CodecConstraints{
int bandwidth_limit;
int max_codecs;
MSList *previously_used;
}CodecConstraints;
static MSList *make_codec_list(LinphoneCore *lc, CodecConstraints * hints, const MSList *codecs){
MSList *l=NULL;
MSList *tevs=NULL;
const MSList *it;
int nb = 0;
for(it=codecs;it!=NULL;it=it->next){
PayloadType *pt=(PayloadType*)it->data;
int num;
if (!(pt->flags & PAYLOAD_TYPE_ENABLED))
continue;
if (hints->bandwidth_limit>0 && !linphone_core_is_payload_type_usable_for_bandwidth(lc,pt,hints->bandwidth_limit)){
ms_message("Codec %s/%i eliminated because of audio bandwidth constraint of %i kbit/s",
pt->mime_type,pt->clock_rate,hints->bandwidth_limit);
continue;
}
if (!linphone_core_check_payload_type_usability(lc,pt)){
continue;
}
pt=payload_type_clone(pt);
/*look for a previously assigned number for this codec*/
num=find_payload_type_number(hints->previously_used, pt);
if (num!=-1){
payload_type_set_number(pt,num);
payload_type_set_flag(pt, PAYLOAD_TYPE_FROZEN_NUMBER);
}
l=ms_list_append(l, pt);
nb++;
if ((hints->max_codecs > 0) && (nb >= hints->max_codecs)) break;
}
tevs=create_telephone_events(lc,l);
l=ms_list_concat(l,tevs);
linphone_core_assign_payload_type_numbers(lc, l);
return l;
}
......@@ -401,9 +520,16 @@ void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall
#endif //BUILD_UPNP
}
static void transfer_already_assigned_payload_types(SalMediaDescription *old, SalMediaDescription *md){
int i;
for(i=0;i<old->nb_streams;++i){
md->streams[i].already_assigned_payloads=old->streams[i].already_assigned_payloads;
old->streams[i].already_assigned_payloads=NULL;
}
}
void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *call){
MSList *l;
PayloadType *pt;
SalMediaDescription *old_md=call->localdesc;
int i;
int nb_active_streams = 0;
......@@ -412,6 +538,7 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
LinphoneAddress *addr;
char* local_ip=call->localip;
const char *subject=linphone_call_params_get_session_name(call->params);
CodecConstraints codec_hints={0};
linphone_core_adapt_to_network(lc,call->ping_time,call->params);
......@@ -445,9 +572,11 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
md->streams[0].ptime=call->params->down_ptime;
else
md->streams[0].ptime=linphone_core_get_download_ptime(lc);
l=make_codec_list(lc,lc->codecs_conf.audio_codecs,call->params->audio_bw,&md->streams[0].max_rate,-1);
pt=payload_type_clone(rtp_profile_get_payload_from_mime(lc->default_profile,"telephone-event"));
l=ms_list_append(l,pt);
codec_hints.bandwidth_limit=call->params->audio_bw;
codec_hints.max_codecs=-1;
codec_hints.previously_used=old_md ? old_md->streams[0].already_assigned_payloads : NULL;
l=make_codec_list(lc, &codec_hints, lc->codecs_conf.audio_codecs);
md->streams[0].max_rate=get_max_codec_sample_rate(l);
md->streams[0].payloads=l;
if (call->audiostream && call->audiostream->ms.sessions.rtp_session) {
char* me = linphone_address_as_string_uri_only(call->me);
......@@ -467,7 +596,10 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
md->streams[1].rtcp_port=call->media_ports[1].rtcp_port;
md->streams[1].proto=md->streams[0].proto;
md->streams[1].type=SalVideo;
l=make_codec_list(lc,lc->codecs_conf.video_codecs,0,NULL,-1);
codec_hints.bandwidth_limit=0;
codec_hints.max_codecs=-1;
codec_hints.previously_used=old_md ? old_md->streams[1].already_assigned_payloads : NULL;
l=make_codec_list(lc, &codec_hints, lc->codecs_conf.video_codecs);
md->streams[1].payloads=l;
if (call->videostream && call->videostream->ms.sessions.rtp_session) {
char* me = linphone_address_as_string_uri_only(call->me);
......@@ -490,7 +622,10 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
md->streams[i].proto = call->biggestdesc->streams[i].proto;
md->streams[i].type = call->biggestdesc->streams[i].type;
md->streams[i].dir = SalStreamInactive;
l = make_codec_list(lc, lc->codecs_conf.video_codecs, 0, NULL, 1);
codec_hints.bandwidth_limit=0;
codec_hints.max_codecs=1;
codec_hints.previously_used=NULL;
l = make_codec_list(lc, &codec_hints, lc->codecs_conf.video_codecs);
md->streams[i].payloads = l;
}
......@@ -511,6 +646,7 @@ void linphone_call_make_local_media_description(LinphoneCore *lc, LinphoneCall *
linphone_call_update_local_media_description_from_ice_or_upnp(call);
linphone_address_destroy(addr);