From: Ghislain MARY Date: Mon, 23 Jul 2012 12:28:19 +0000 (+0200) Subject: Specify local RTCP port explicitly. X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=f97f51d4f38eaaa4380ff281d258021e9c00f65c Specify local RTCP port explicitly. --- diff --git a/console/sipomatic.c b/console/sipomatic.c index e0d3f67e..e7a1c6a8 100644 --- a/console/sipomatic.c +++ b/console/sipomatic.c @@ -97,7 +97,7 @@ void call_accept(Call *call) osip_message_set_content_type(msg,"application/sdp"); osip_message_set_body(msg,call->sdpc->answerstr,strlen(call->sdpc->answerstr)); eXosip_call_send_answer(call->tid,200,msg); - call->audio_stream=audio_stream_new(call->audio.localport,call->root->ipv6); + call->audio_stream=audio_stream_new(call->audio.localport,call->audio.localport+1,call->root->ipv6); audio_stream_start_with_files(call->audio_stream, call->profile, call->audio.remaddr,call->audio.remoteport,call->audio.remoteport+1, call->audio.pt,20,hellofile,record_file); diff --git a/coreapi/conference.c b/coreapi/conference.c index d4abc1a9..1b6903fd 100644 --- a/coreapi/conference.c +++ b/coreapi/conference.c @@ -104,7 +104,7 @@ static RtpProfile *make_dummy_profile(int samplerate){ static void add_local_endpoint(LinphoneConference *conf,LinphoneCore *lc){ /*create a dummy audiostream in order to extract the local part of it */ /* network address and ports have no meaning and are not used here. */ - AudioStream *st=audio_stream_new(65000,FALSE); + AudioStream *st=audio_stream_new(65000,65001,FALSE); MSSndCard *playcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard; MSSndCard *captcard=lc->sound_conf.capt_sndcard; diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 825e5679..432adc34 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -212,7 +212,9 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li /*set audio capabilities */ strncpy(md->streams[0].rtp_addr,call->localip,sizeof(md->streams[0].rtp_addr)); + strncpy(md->streams[0].rtcp_addr,call->localip,sizeof(md->streams[0].rtcp_addr)); md->streams[0].rtp_port=call->audio_port; + md->streams[0].rtcp_port=call->audio_port+1; md->streams[0].proto=(call->params.media_encryption == LinphoneMediaEncryptionSRTP) ? SalProtoRtpSavp : SalProtoRtpAvp; md->streams[0].type=SalAudio; @@ -227,6 +229,7 @@ static SalMediaDescription *_create_local_media_description(LinphoneCore *lc, Li if (call->params.has_video){ md->nstreams++; md->streams[1].rtp_port=call->video_port; + md->streams[1].rtcp_port=call->video_port+1; 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); @@ -930,7 +933,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){ AudioStream *audiostream; IceSession *ice_session = sal_op_get_ice_session(call->op); - call->audiostream=audiostream=audio_stream_new(md->streams[0].rtp_port,linphone_core_ipv6_enabled(lc)); + call->audiostream=audiostream=audio_stream_new(md->streams[0].rtp_port,md->streams[0].rtcp_port,linphone_core_ipv6_enabled(lc)); if (linphone_core_echo_limiter_enabled(lc)){ const char *type=lp_config_get_string(lc->config,"sound","el_type","mic"); if (strcasecmp(type,"mic")==0) @@ -973,7 +976,7 @@ void linphone_call_init_media_streams(LinphoneCall *call){ if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].rtp_port>0){ int video_recv_buf_size=lp_config_get_int(lc->config,"video","recv_buf_size",0); - call->videostream=video_stream_new(md->streams[1].rtp_port,linphone_core_ipv6_enabled(lc)); + call->videostream=video_stream_new(md->streams[1].rtp_port,md->streams[1].rtcp_port,linphone_core_ipv6_enabled(lc)); video_stream_enable_display_filter_auto_rotate(call->videostream, lp_config_get_int(lc->config,"video","display_filter_auto_rotate",0)); if (video_recv_buf_size>0) rtp_session_set_recv_buf_size(call->videostream->session,video_recv_buf_size); @@ -1244,7 +1247,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna call->audio_profile, stream->rtp_addr[0]!='\0' ? stream->rtp_addr : call->resultdesc->addr, stream->rtp_port, - linphone_core_rtcp_enabled(lc) ? (stream->rtp_port+1) : 0, + linphone_core_rtcp_enabled(lc) ? (stream->rtcp_port) : 0, used_pt, jitt_comp, playfile, @@ -1360,7 +1363,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna video_stream_set_device_rotation(call->videostream, lc->device_rotation); video_stream_start(call->videostream, call->video_profile, addr, vstream->rtp_port, - linphone_core_rtcp_enabled(lc) ? (vstream->rtp_port+1) : 0, + linphone_core_rtcp_enabled(lc) ? (vstream->rtcp_port) : 0, used_pt, lc->rtp_conf.audio_jitt_comp, cam); video_stream_set_rtcp_information(call->videostream, cname,LINPHONE_RTCP_SDES_TOOL); } diff --git a/coreapi/offeranswer.c b/coreapi/offeranswer.c index 62782921..118f2420 100644 --- a/coreapi/offeranswer.c +++ b/coreapi/offeranswer.c @@ -211,7 +211,9 @@ static void initiate_outgoing(const SalStreamDescription *local_offer, if (result->payloads && !only_telephone_event(result->payloads)){ strcpy(result->rtp_addr,remote_answer->rtp_addr); + strcpy(result->rtcp_addr,remote_answer->rtcp_addr); result->rtp_port=remote_answer->rtp_port; + result->rtcp_port=remote_answer->rtcp_port; result->bandwidth=remote_answer->bandwidth; result->ptime=remote_answer->ptime; }else{ @@ -235,8 +237,10 @@ static void initiate_incoming(const SalStreamDescription *local_cap, result->dir=compute_dir_incoming(local_cap->dir,remote_offer->dir); if (result->payloads && !only_telephone_event(result->payloads) && (remote_offer->rtp_port!=0 || remote_offer->rtp_port==SalStreamSendOnly)){ strcpy(result->rtp_addr,local_cap->rtp_addr); + strcpy(result->rtcp_addr,local_cap->rtcp_addr); memcpy(result->candidates,local_cap->candidates,sizeof(result->candidates)); result->rtp_port=local_cap->rtp_port; + result->rtcp_port=local_cap->rtcp_port; result->bandwidth=local_cap->bandwidth; result->ptime=local_cap->ptime; }else{ diff --git a/coreapi/sal.c b/coreapi/sal.c index de812c4f..5b592b8d 100644 --- a/coreapi/sal.c +++ b/coreapi/sal.c @@ -182,6 +182,8 @@ bool_t sal_stream_description_equals(const SalStreamDescription *sd1, const SalS if (sd1->type!=sd2->type) return FALSE; if (strcmp(sd1->rtp_addr,sd2->rtp_addr)!=0) return FALSE; if (sd1->rtp_port!=sd2->rtp_port) return FALSE; + if (strcmp(sd1->rtcp_addr,sd2->rtcp_addr)!=0) return FALSE; + if (sd1->rtcp_port!=sd2->rtcp_port) return FALSE; if (!payload_list_equals(sd1->payloads,sd2->payloads)) return FALSE; if (sd1->bandwidth!=sd2->bandwidth) return FALSE; if (sd1->ptime!=sd2->ptime) return FALSE; diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index fe5e1b8e..42f11eca 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -535,9 +535,11 @@ static void sdp_process(SalOp *h){ for(i=0;iresult->nstreams;++i){ if (h->result->streams[i].rtp_port>0){ strcpy(h->result->streams[i].rtp_addr,h->base.remote_media->streams[i].rtp_addr); + strcpy(h->result->streams[i].rtcp_addr,h->base.remote_media->streams[i].rtcp_addr); h->result->streams[i].ptime=h->base.remote_media->streams[i].ptime; h->result->streams[i].bandwidth=h->base.remote_media->streams[i].bandwidth; h->result->streams[i].rtp_port=h->base.remote_media->streams[i].rtp_port; + h->result->streams[i].rtcp_port=h->base.remote_media->streams[i].rtcp_port; if (h->result->streams[i].proto == SalProtoRtpSavp) { h->result->streams[i].crypto[0] = h->base.remote_media->streams[i].crypto[0]; diff --git a/media_api/mediaflow.c b/media_api/mediaflow.c index 8ccdadb7..e0e6be40 100644 --- a/media_api/mediaflow.c +++ b/media_api/mediaflow.c @@ -109,7 +109,7 @@ MSFilter *set_MSFilter(EndPoint *endpoint, int type, FlowDirections *fdir){ switch(endpoint->protocol){ case MEDIA_RTP: rtps = rtp_session_new(RTP_SESSION_RECVONLY); - rtp_session_set_local_addr(rtps,"0.0.0.0",8000); + rtp_session_set_local_addr(rtps,"0.0.0.0",8000,8001); rtp_session_set_scheduling_mode(rtps,0); rtp_session_set_blocking_mode(rtps,0);