mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-28 00:29:21 +00:00
Merge branch 'master' of git.linphone.org:linphone into dev_edge_optim
This commit is contained in:
commit
f75692eb02
10 changed files with 72 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -542,6 +542,7 @@ struct _LinphoneCore
|
|||
int device_rotation;
|
||||
int max_calls;
|
||||
LinphoneTunnel *tunnel;
|
||||
char* device_id;
|
||||
};
|
||||
|
||||
LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue