diff --git a/README.macos b/README.macos index 3ec0d0429..aecd2922f 100644 --- a/README.macos +++ b/README.macos @@ -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 diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 9136eb1e4..b60517136 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -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) { diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 47f8a61ae..e4f35e387 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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; +} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 2972bc090..637630997 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -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); diff --git a/coreapi/linphonecore_utils.h b/coreapi/linphonecore_utils.h index bd41ec2b9..964385683 100644 --- a/coreapi/linphonecore_utils.h +++ b/coreapi/linphonecore_utils.h @@ -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 diff --git a/coreapi/misc.c b/coreapi/misc.c index a696cd7f4..a2a61ce85 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -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; diff --git a/coreapi/private.h b/coreapi/private.h index b1b16ed03..d5e98c956 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -542,6 +542,7 @@ struct _LinphoneCore int device_rotation; int max_calls; LinphoneTunnel *tunnel; + char* device_id; }; LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc); diff --git a/coreapi/proxy.c b/coreapi/proxy.c index bb01f14ee..47fe08bdd 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -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; diff --git a/coreapi/sal_eXosip2.c b/coreapi/sal_eXosip2.c index 076839a10..447ce34eb 100644 --- a/coreapi/sal_eXosip2.c +++ b/coreapi/sal_eXosip2.c @@ -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); diff --git a/java/common/org/linphone/core/LinphoneChatRoom.java b/java/common/org/linphone/core/LinphoneChatRoom.java index a8ef5e215..f06e8fda5 100644 --- a/java/common/org/linphone/core/LinphoneChatRoom.java +++ b/java/common/org/linphone/core/LinphoneChatRoom.java @@ -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); }