]> sjero.net Git - linphone/commitdiff
Specify local RTCP port explicitly.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Mon, 23 Jul 2012 12:28:19 +0000 (14:28 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Mon, 23 Jul 2012 12:28:19 +0000 (14:28 +0200)
console/sipomatic.c
coreapi/conference.c
coreapi/linphonecall.c
coreapi/offeranswer.c
coreapi/sal.c
coreapi/sal_eXosip2.c
media_api/mediaflow.c

index e0d3f67e7c6aa8dea158dde04862c71f1db1c93e..e7a1c6a88830640b0d3315a130a05cbc0d5f6a53 100644 (file)
@@ -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);
index d4abc1a91a05972dbb262ea88cfefb160cc24486..1b6903fd00abda0a8ccab6ada104f43d565c503c 100644 (file)
@@ -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;
index 825e567973f893f2648b61c2ec53d27ff7f7fc95..432adc34845a7278eb0eb2c2be8981b2bd580e61 100644 (file)
@@ -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);
                        }
index 62782921c610b32ace36588676da652d2cab09e5..118f2420a165ce6cd0b01365f5d3912c98913f88 100644 (file)
@@ -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{
index de812c4fb7ff2341056d8db534ea65e87b2d8b72..5b592b8d36ccdb312709001605607d2ef7eb1e60 100644 (file)
@@ -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;
index fe5e1b8e7ddf40da124905cdc57765e6ef32a100..42f11eca095333ac7838be1e6eb166e9867a0afb 100644 (file)
@@ -535,9 +535,11 @@ static void sdp_process(SalOp *h){
                for(i=0;i<h->result->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]; 
index 8ccdadb7147b86c687735a08c8ea284839bb4c38..e0e6be4036c13142a813bfbebd50f99227e15f21 100644 (file)
@@ -109,7 +109,7 @@ MSFilter *set_MSFilter(EndPoint *endpoint, int type, FlowDirections *fdir){
        switch(endpoint->protocol){\r
                case MEDIA_RTP:\r
                        rtps = rtp_session_new(RTP_SESSION_RECVONLY);\r
-                       rtp_session_set_local_addr(rtps,"0.0.0.0",8000);\r
+                       rtp_session_set_local_addr(rtps,"0.0.0.0",8000,8001);\r
                        rtp_session_set_scheduling_mode(rtps,0);\r
                        rtp_session_set_blocking_mode(rtps,0);\r
                        \r