]> sjero.net Git - linphone/commitdiff
Merge branch 'master' into dev_sal
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 3 Mar 2010 15:16:16 +0000 (16:16 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 3 Mar 2010 15:16:16 +0000 (16:16 +0100)
Conflicts:
coreapi/address.c
coreapi/linphonecore.c

1  2 
coreapi/Makefile.am
coreapi/address.c
coreapi/linphonecore.c
gtk-glade/main.c

Simple merge
index 51e3a1eee81c83943e44608b5d66993bdf2e7568,9c69a2641385c51a594dc85a0d308a70a733c8e8..1d893aedea7af3731f8497cb75da396869be299e
@@@ -30,8 -31,15 +30,10 @@@ Foundation, Inc., 59 Temple Place - Sui
   * Constructs a LinphoneAddress object by parsing the user supplied address,
   * given as a string.
  **/
 -LinphoneAddress * linphone_address_new(const char *uri){
 -      osip_from_t *from;
 -      osip_from_init(&from);
 -      if (osip_from_parse(from,uri)!=0){
 -              osip_from_free(from);
 -              ms_error("Cannot create LinphoneAddress, bad uri [%s]",uri);
 -              return NULL;
 -      }
 -      return from;
 +LinphoneAddress * linphone_address_new(const char *addr){
-       return sal_address_new(addr);
++      SalAddress *saddr=sal_address_new(addr);
++      if (saddr==NULL) ms_error("Cannot create LinphoneAddress, bad uri [%s]",addr);
++      return saddr;
  }
  
  /**
index 58dde3adc0367b9ecbcc30d01cfe74e72ff308a5,bc12c08e5a5c8ebfc787bab21b7ff606ceb61149..ecb50a0a189a214eba07e9d9fbc1da99f141ba22
@@@ -1615,13 -1590,46 +1619,15 @@@ void linphone_core_iterate(LinphoneCor
  }
  
  
 -bool_t linphone_core_is_in_main_thread(LinphoneCore *lc){
 -      return TRUE;
 -}
 -
 -static char *guess_route_if_any(LinphoneCore *lc, osip_to_t *parsed_url){
 -      const MSList *elem=linphone_core_get_proxy_config_list(lc);
 -      for(;elem!=NULL;elem=elem->next){
 -              LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
 -              char prx[256];
 -              if (cfg->ssctx && sip_setup_context_get_proxy(cfg->ssctx,parsed_url->url->host,prx,sizeof(prx))==0){
 -                      ms_message("We have a proxy for domain %s",parsed_url->url->host);
 -                      if (strcmp(parsed_url->url->host,prx)!=0){
 -                              char *route=NULL;
 -                              osip_route_t *rt;
 -                              osip_route_init(&rt);
 -                              if (osip_route_parse(rt,prx)==0){
 -                                      char *rtstr;
 -                                      osip_uri_uparam_add(rt->url,osip_strdup("lr"),NULL);
 -                                      osip_route_to_str(rt,&rtstr);
 -                                      route=ms_strdup(rtstr);
 -                                      osip_free(rtstr);
 -                              }
 -                              osip_route_free(rt);
 -                              ms_message("Adding a route: %s",route);
 -                              return route;
 -                      }
 -              }
 -      }
 -      return NULL;
 -}
 -
  bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneAddress **real_parsed_url, char **route){
        enum_lookup_res_t *enumres=NULL;
 -      osip_to_t *parsed_url=NULL;
 +      LinphoneAddress *parsed_url=NULL;       
        char *enum_domain=NULL;
-       LinphoneProxyConfig *proxy;
+       LinphoneProxyConfig *proxy=lc->default_proxy;;
        char *tmpurl;
        const char *tmproute;
+       LinphoneAddress *uri;
+       
        if (real_parsed_url!=NULL) *real_parsed_url=NULL;
        *route=NULL;
        tmproute=linphone_core_get_route(lc);
                        linphone_address_set_username(uri,normalized_username);
                                                                                
                        if (real_parsed_url!=NULL) *real_parsed_url=uri;
 -#if 0
 -                      /*if the prompted uri was auto-suffixed with proxy domain,
 -                      then automatically set a route so that the request goes
 -                      through the proxy*/
 -                      if (tmproute==NULL){
 -                              osip_route_t *rt=NULL;
 -                              char *rtstr=NULL;
 -                              osip_route_init(&rt);
 -                              if (osip_route_parse(rt,linphone_proxy_config_get_addr(proxy))==0){
 -                                      osip_uri_uparam_add(rt->url,osip_strdup("lr"),NULL);
 -                                      osip_route_to_str(rt,&rtstr);
 -                                      *route=ms_strdup(rtstr);
 -                                      osip_free(rtstr);
 -                              }
 -                              ms_message("setting automatically a route to %s",*route);
 -                      }
 -                      else *route=ms_strdup(tmproute);
 -#else
 -                      if (tmproute==NULL) *route=guess_route_if_any(lc,*real_parsed_url);
                        if (tmproute) *route=ms_strdup(tmproute);
 -#endif
                        return TRUE;
-               }
+               }else return FALSE;
        }
        parsed_url=linphone_address_new(url);
        if (parsed_url!=NULL){
@@@ -3172,6 -3327,6 +3187,9 @@@ void sip_config_uninit(LinphoneCore *lc
        lp_config_set_int(lc->config,"sip","use_rfc2833",config->use_rfc2833);
        lp_config_set_int(lc->config,"sip","use_ipv6",config->ipv6_enabled);
        lp_config_set_int(lc->config,"sip","register_only_when_network_is_up",config->register_only_when_network_is_up);
++
++      lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
++      
        for(elem=config->proxies,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
                LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)(elem->data);
                linphone_proxy_config_write_to_config_file(lc->config,cfg,i);
@@@ -3313,7 -3469,7 +3331,6 @@@ static void linphone_core_uninit(Linpho
        /* save all config */
        net_config_uninit(lc);
        sip_config_uninit(lc);
--      lp_config_set_int(lc->config,"sip","default_proxy",linphone_core_get_default_proxy(lc,NULL));
        rtp_config_uninit(lc);
        sound_config_uninit(lc);
        video_config_uninit(lc);
Simple merge