]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.linphone.org:linphone into dev_edge_optim
authorSimon Morlat <simon.morlat@linphone.org>
Tue, 4 Sep 2012 13:50:23 +0000 (15:50 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Tue, 4 Sep 2012 13:50:23 +0000 (15:50 +0200)
README.macos
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/linphonecore_utils.h
coreapi/misc.c
coreapi/private.h
coreapi/proxy.c
coreapi/sal_eXosip2.c
java/common/org/linphone/core/LinphoneChatRoom.java

index 3ec0d042906bf3bb81889f01eee48bef3c6d24c9..aecd2922fab00e70e1f69e7e6165a1a72d273733 100644 (file)
@@ -16,6 +16,7 @@ You need:
  $ port install libeXosip2 #WARNING: currently outdated in macport
  $ port install ffmpeg-devel
  $ port install libvpx
+ $ port install readline
  
 - Install srtp (optional) for call encryption
  $ port install srtp
index 9136eb1e4a3e83c82d39a1a07e44d4b6ebae58b5..b60517136729436a25b951cb1324fe3bebdc7879 100644 (file)
@@ -538,7 +538,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
                        switch(call->reason){
                                case LinphoneReasonDeclined:
                                        call->log->status=LinphoneCallDeclined;
-                               break;
+                                       break;
                                case LinphoneReasonNotAnswered:
                                        call->log->status=LinphoneCallMissed;
                                break;
@@ -1768,6 +1768,7 @@ static void handle_ice_events(LinphoneCall *call, OrtpEvent *ev){
                        ice_session_eliminate_redundant_candidates(call->ice_session);
                        ice_session_choose_default_candidates(call->ice_session);
                } else {
+                       ms_warning("No STUN answer from [%s], disabling ICE",linphone_core_get_stun_server(call->core));
                        linphone_call_delete_ice_session(call);
                }
                switch (call->state) {
index 47f8a61ae63af9ce2538aa3108e0371e26e22e42..e4f35e3873cc4bbdf79468e4533b83c656f09136 100644 (file)
@@ -1903,7 +1903,8 @@ void linphone_core_iterate(LinphoneCore *lc){
                if (call->state==LinphoneCallOutgoingInit && (curtime-call->start_time>=2)){
                        /*start the call even if the OPTIONS reply did not arrive*/
                        if (call->ice_session != NULL) {
-                               /* ICE candidates gathering has not finished yet, proceed with the call without ICE anyway. */
+                               ms_warning("ICE candidates gathering from [%s] has not finished yet, proceed with the call without ICE anyway."
+                                               ,linphone_core_get_stun_server(lc));
                                linphone_call_delete_ice_session(call);
                                linphone_call_stop_media_streams(call);
                        }
@@ -5104,3 +5105,10 @@ void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx,
        }else ms_warning("Could not apply zoom: video output wasn't activated.");
 }
 
+void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id) {
+       if (lc->device_id) ms_free(lc->device_id);
+       lc->device_id=ms_strdup(device_id);
+}
+const char*  linphone_core_get_device_identifier(const LinphoneCore *lc) {
+       return lc->device_id;
+}
index 2972bc090bef4e4e4be3004f53f6391a74e35034..6376309975ec928d69c44b998fff623c6b7df1d9 100644 (file)
@@ -827,6 +827,24 @@ LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
 
 /* function to be periodically called in a main loop */
 void linphone_core_iterate(LinphoneCore *lc);
+#if 0 /*not implemented yet*/
+/**
+ * @ingroup initializing
+ * Provide Linphone Core with an unique identifier. This be later used to identified contact address coming from this device.
+ * Value is not saved.
+ * @param lc object
+ * @param string identifying the device, can be EMEI or UDID
+ *
+ */
+void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id);
+/**
+ * @ingroup initializing
+ * get Linphone unique identifier
+ *
+ */
+const char*  linphone_core_get_device_identifier(const LinphoneCore *lc);
+
+#endif
 
 LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
 
index bd41ec2b9e9b1b9dd1440a39c3e98f5a9930bbc6..9643856832fae7d3c4fce6ff24e0db0e527a748c 100644 (file)
@@ -86,7 +86,15 @@ typedef bool_t (*LinphoneCoreIterateHook)(void *data);
 void linphone_core_add_iterate_hook(LinphoneCore *lc, LinphoneCoreIterateHook hook, void *hook_data);
 
 void linphone_core_remove_iterate_hook(LinphoneCore *lc, LinphoneCoreIterateHook hook, void *hook_data);
-
+/**
+ * @ingroup misc
+ *Function to get  call country code from  ISO 3166-1 alpha-2 code, ex: FR returns 33
+ *@param iso country code alpha2
+ *@return call country code or -1 if not found
+ */
+int linphone_dial_plan_lookup_ccc_from_iso(const char* iso); 
+       
+       
 #ifdef __cplusplus
 }
 #endif
index a696cd7f43dfd7a7ed0e4c002f4fbee2a9eb6ba5..a2a61ce8503fb7bacb643109396d04c1b8474883 100644 (file)
@@ -636,6 +636,7 @@ int linphone_core_gather_ice_candidates(LinphoneCore *lc, LinphoneCall *call)
                ice_add_local_candidate(video_check_list, "host", local_addr, call->video_port + 1, 2, NULL);
        }
 
+       ms_message("ICE: gathering candidate from [%s]",server);
        /* Gather local srflx candidates. */
        ice_session_gather_candidates(call->ice_session, ss, ss_len);
        return 0;
index b1b16ed031d69196b58e494b8ba530ab274bb239..d5e98c956a5c66fc67ed53495c38c63423aa3d36 100644 (file)
@@ -542,6 +542,7 @@ struct _LinphoneCore
        int device_rotation;
        int max_calls;
        LinphoneTunnel *tunnel;
+       char* device_id;
 };
 
 LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc);
index bb01f14ee1ade10c993646db026160d6ba467da6..47fe08bdda30401886af9412814a843af33c198e 100644 (file)
@@ -375,21 +375,33 @@ bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg
  */
 typedef struct dial_plan{
        const char *country;
+       const char* iso_country_code; /* ISO 3166-1 alpha-2 code, ex: FR for France*/
        char  ccc[8]; /*country calling code*/
        int nnl; /*maximum national number length*/
        const char * icp; /*international call prefix, ex: 00 in europe*/
+       
 }dial_plan_t;
 
 /* TODO: fill with information for all countries over the world*/
 static dial_plan_t const dial_plans[]={
-       {"France"       , "33"  , 9     , "00"  },
-       {"United States", "1"   , 10    , "011" },
-       {"Turkey"       , "90"  , 10    , "00"  },
-       {"Switzerland"  , "41"  , 9     , "00"  },
-       {NULL           , ""    , 0     , NULL  }
+       {"France"                       ,"FR"           , "33"  , 9             , "00"  },
+       {"United States"        ,"US"           , "1"   , 10    , "011" },
+       {"Turkey"                       ,"TR"           , "90"  , 10    , "00"  },
+       {"Switzerland"          ,"XK"           , "41"  , 9             , "00"  },
+       {NULL           ,NULL,""        , 0     , NULL  }
 };
 
-static dial_plan_t most_common_dialplan={ "generic" , "", 10, "00"};
+static dial_plan_t most_common_dialplan={ "generic" ,"", "", 10, "00"};
+
+int linphone_dial_plan_lookup_ccc_from_iso(const char* iso) {
+       dial_plan_t* dial_plan;
+       for (dial_plan=(dial_plan_t*)dial_plans; dial_plan->country!=NULL; dial_plan++) {
+               if (strcmp(iso, dial_plan->iso_country_code)==0) {
+                       return atoi(dial_plan->ccc);
+               }
+       }
+       return -1;
+}
 
 static void lookup_dial_plan(const char *ccc, dial_plan_t *plan){
        int i;
index 076839a1077cf87d831f8d2903693baf6c68000b..447ce34eb359432277fd3b6c556f6b9a9f77e338 100644 (file)
@@ -1954,12 +1954,12 @@ static bool_t registration_failure(Sal *sal, eXosip_event_t *ev){
 static void other_request_reply(Sal *sal,eXosip_event_t *ev){
        SalOp *op=find_op(sal,ev);
        LinphoneChatMessage* chat_msg;
-       ms_message("Processing reponse status [%i] for method [%s]",ev->response->status_code,osip_message_get_method(ev->request));
        if (op==NULL){
                ms_warning("other_request_reply(): Receiving response to unknown request.");
                return;
        }
        if (ev->response){
+               ms_message("Processing reponse status [%i] for method [%s]",ev->response->status_code,osip_message_get_method(ev->request));
                update_contact_from_response(op,ev->response);
                if (ev->request && strcmp(osip_message_get_method(ev->request),"OPTIONS")==0)
                        sal->callbacks.ping_reply(op);
@@ -2179,11 +2179,21 @@ int sal_register(SalOp *h, const char *proxy, const char *from, int expires){
        if (h->rid==-1){
                SalAddress *from_parsed=sal_address_new(from);
                char domain[256];
+               char *uri, *domain_ptr = NULL;
                if (from_parsed==NULL) {
                        ms_warning("sal_register() bad from %s",from);
                        return -1;
                }
-               snprintf(domain,sizeof(domain),"sip:%s",sal_address_get_domain(from_parsed));
+               /* Get domain using sal_address_as_string_uri_only() and stripping the username part instead of
+                  using sal_address_get_domain() because to have a properly formatted domain with IPv6 proxy addresses. */
+               uri = sal_address_as_string_uri_only(from_parsed);
+               if (uri) domain_ptr = strchr(uri, '@');
+               if (domain_ptr) {
+                       snprintf(domain,sizeof(domain),"sip:%s",domain_ptr+1);
+               } else {
+                       snprintf(domain,sizeof(domain),"sip:%s",sal_address_get_domain(from_parsed));
+               }
+               if (uri) ms_free(uri);
                sal_address_destroy(from_parsed);
                eXosip_lock();
                h->rid=eXosip_register_build_initial_register(from,domain,NULL,expires,&msg);
index a8ef5e21524b1c7053efa012f9ef84c45c67ec4f..f06e8fda528bf92bef229a3e9075a883fbf4fcb4 100644 (file)
@@ -34,6 +34,6 @@ public interface LinphoneChatRoom {
        * send a message to peer member of this chat room.
        * @param        message to be sent
        */
-       void sendMessage(String message);
+       void sendMessage(Object opaque, String message);
 
 }