]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of belledonne-communications.com:linphone-private
authorSimon Morlat <simon.morlat@linphone.org>
Thu, 17 Jun 2010 10:18:43 +0000 (12:18 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Thu, 17 Jun 2010 10:18:43 +0000 (12:18 +0200)
1  2 
coreapi/linphonecore.c

diff --combined coreapi/linphonecore.c
index 8f86188ba5915c03bf9247a13600d8601f56676e,75bfee8ab6343caa28321550d24ed44ee877dcce..a68acd244b62181519936cff96e211d6ad8fe160
@@@ -646,9 -646,16 +646,16 @@@ static void sip_config_read(LinphoneCor
        }
        linphone_core_enable_ipv6(lc,ipv6);
        memset(&tr,0,sizeof(tr));
-       tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",5060);
-       tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
+       if (lp_config_get_int(lc->config,"sip","sip_random_port",0)) {
+               tr.udp_port=(0xDFF&+random())+1024;
+       } else {
+               tr.udp_port=lp_config_get_int(lc->config,"sip","sip_port",5060);
+       }
+       if (lp_config_get_int(lc->config,"sip","sip_tcp_random_port",0)) {
+               tr.tcp_port=(0xDFF&+random())+1024;
+       } else {
+               tr.tcp_port=lp_config_get_int(lc->config,"sip","sip_tcp_port",0);
+       }
        /*start listening on ports*/
        linphone_core_set_sip_transports(lc,&tr);
  
@@@ -1553,7 -1560,7 +1560,7 @@@ int linphone_core_set_sip_transports(Li
   * is not used.
   * @ingroup network_parameters
  **/
- int linphone_core_get_sip_transport(LinphoneCore *lc, LCSipTransports *tr){
+ int linphone_core_get_sip_transports(LinphoneCore *lc, LCSipTransports *tr){
        memcpy(tr,&lc->sip_conf.transports,sizeof(*tr));
        return 0;
  }
@@@ -1639,6 -1646,16 +1646,16 @@@ static void monitor_network_state(Linph
  
  static void proxy_update(LinphoneCore *lc){
        ms_list_for_each(lc->sip_conf.proxies,(void (*)(void*))&linphone_proxy_config_update);
+       MSList* list=ms_list_copy(lc->sip_conf.deleted_proxies);
+       for(;list!=NULL;list=list->next){
+               LinphoneProxyConfig* cfg = (LinphoneProxyConfig*) list->data;
+               if (ms_time(NULL) - cfg->deletion_date > 5) {
+                       lc->sip_conf.deleted_proxies =ms_list_remove(lc->sip_conf.deleted_proxies,(void *)cfg);
+                       ms_message("clearing proxy config for [%s]",linphone_proxy_config_get_addr(cfg));
+                       linphone_proxy_config_destroy(cfg);
+               }
+       }
+       ms_list_free(list);
  }
  
  static void assign_buddy_info(LinphoneCore *lc, BuddyInfo *info){
@@@ -2142,13 -2159,6 +2159,13 @@@ bool_t linphone_core_inc_invite_pending
        return FALSE;
  }
  
 +#ifdef TEST_EXT_RENDERER
 +static void rendercb(void *data, const MSPicture *local, const MSPicture *remote){
 +      ms_message("rendercb, local buffer=%p, remote buffer=%p",
 +                 local ? local->planes[0] : NULL, remote? remote->planes[0] : NULL);
 +}
 +#endif
 +
  void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
        SalMediaDescription *md=call->localdesc;
        lc->audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc));
                rtp_session_set_transports(lc->audiostream->session,lc->a_rtp,lc->a_rtcp);
  
  #ifdef VIDEO_ENABLED
 -      if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0)
 +      if ((lc->video_conf.display || lc->video_conf.capture) && md->streams[1].port>0){
                lc->videostream=video_stream_new(md->streams[1].port,linphone_core_ipv6_enabled(lc));
 +#ifdef TEST_EXT_RENDERER
 +              video_stream_set_render_callback(lc->videostream,rendercb,NULL);
 +#endif
 +      }
  #else
        lc->videostream=NULL;
  #endif
@@@ -2655,11 -2661,7 +2672,11 @@@ void linphone_core_set_ring_level(Linph
        if (sndcard) ms_snd_card_set_level(sndcard,MS_SND_CARD_PLAYBACK,level);
  }
  
 -
 +/**
 + * Sets call playback gain in db
 + *
 + * @ingroup media_parameters
 +**/
  void linphone_core_set_soft_play_level(LinphoneCore *lc, float level){
        float gain=level;
        lc->sound_conf.soft_play_lev=level;
                ms_filter_call_method(st->volrecv,MS_VOLUME_SET_DB_GAIN,&gain);
        }else ms_warning("Could not apply gain: gain control wasn't activated.");
  }
 +
 +/**
 + * Returns call playback gain in db
 + *
 + * @ingroup media_parameters
 +**/
  float linphone_core_get_soft_play_level(LinphoneCore *lc) {
        float gain=0;
        AudioStream *st=lc->audiostream;
        if (st->volrecv){
 -              ms_filter_call_method(st->volrecv,MS_VOLUME_GET,&gain);
 +              ms_filter_call_method(st->volrecv,MS_VOLUME_GET_GAIN_DB,&gain);
        }else ms_warning("Could not get gain: gain control wasn't activated.");
  
        return gain;