]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.linphone.org:linphone-private
authorJehan Monnier <jehan.monnier@linphone.org>
Thu, 3 Jun 2010 06:45:50 +0000 (08:45 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Thu, 3 Jun 2010 06:45:50 +0000 (08:45 +0200)
1  2 
coreapi/linphonecore.c

diff --combined coreapi/linphonecore.c
index 518d887b203bf7247430d4ea0baef235f1912e01,73c3bdc2b6fa097f37095c82e1404eec04490edb..54de627f12cc34c176553bae35c8de57ab775532
@@@ -646,18 -646,7 +646,18 @@@ static void sip_config_read(LinphoneCor
        }
        linphone_core_enable_ipv6(lc,ipv6);
        port=lp_config_get_int(lc->config,"sip","sip_port",5060);
 -      linphone_core_set_sip_port(lc,port);
 +
 +      tmpstr=lp_config_get_string(lc->config,"sip","transport","udp");
 +      if (strcmp("udp",tmpstr) == 0 ) {
 +              lc->sip_conf.transport=SalTransportDatagram;
 +      } else if (strcmp("tcp",tmpstr) == 0) {
 +              lc->sip_conf.transport=SalTransportStream;
 +      } else {
 +              lc->sip_conf.transport=SalTransportDatagram;
 +              ms_warning("unsupported transport, using udp");
 +      }
 +      /*start listening on port*/
 +      linphone_core_set_sip_port(lc,port);
  
        tmpstr=lp_config_get_string(lc->config,"sip","contact",NULL);
        if (tmpstr==NULL || linphone_core_set_primary_contact(lc,tmpstr)==-1) {
                        break;
                }
        }
 +
 +
 +
 +
 +      lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
        
        /*for tuning or test*/
        lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
@@@ -1498,11 -1482,9 +1498,11 @@@ void linphone_core_set_sip_port(Linphon
                anyaddr="::0";
        else
                anyaddr="0.0.0.0";
 -      err=sal_listen_port (lc->sal,anyaddr,port, SalTransportDatagram,FALSE);
 +
 +
 +      err=sal_listen_port (lc->sal,anyaddr,port, lc->sip_conf.transport,FALSE);
        if (err<0){
 -              char *msg=ortp_strdup_printf("UDP port %i seems already in use ! Cannot initialize.",port);
 +              char *msg=ortp_strdup_printf("Port %i seems already in use ! Cannot initialize.",port);
                ms_warning(msg);
                lc->vtable.display_warning(lc,msg);
                ms_free(msg);
@@@ -2204,6 -2186,7 +2204,7 @@@ static RtpProfile *make_profile(Linphon
        RtpProfile *prof=rtp_profile_new("Call profile");
        bool_t first=TRUE;
        int remote_bw=0;
+       *used_pt=-1;
        
        for(elem=desc->payloads;elem!=NULL;elem=elem->next){
                PayloadType *pt=(PayloadType*)elem->data;
@@@ -2255,7 -2238,7 +2256,7 @@@ void linphone_core_start_media_streams(
        {
                const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
                                                        SalProtoRtpAvp,SalAudio);
-               if (stream){
+               if (stream && stream->port!=0){
                        call->audio_profile=make_profile(lc,call->resultdesc,stream,&used_pt);
                        if (!lc->use_files){
                                MSSndCard *playcard=lc->sound_conf.play_sndcard;
                        video_preview_stop(lc->previewstream);
                        lc->previewstream=NULL;
                }
-               if (stream && (lc->video_conf.display || lc->video_conf.capture)) {
+               if (stream && stream->port!=0 && (lc->video_conf.display || lc->video_conf.capture)) {
                        const char *addr=stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr;
                        call->video_profile=make_profile(lc,call->resultdesc,stream,&used_pt);
                        video_stream_set_sent_video_size(lc->videostream,linphone_core_get_preferred_video_size(lc));
                                stream->port+1,
                                used_pt, jitt_comp, lc->video_conf.device);
                        video_stream_set_rtcp_information(lc->videostream, cname,tool);
+               }else{
+                       ms_warning("No valid video stream defined.");
                }
        }
  #endif