$ 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
switch(call->reason){
case LinphoneReasonDeclined:
call->log->status=LinphoneCallDeclined;
- break;
+ break;
case LinphoneReasonNotAnswered:
call->log->status=LinphoneCallMissed;
break;
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) {
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);
}
}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;
+}
/* 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);
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
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;
int device_rotation;
int max_calls;
LinphoneTunnel *tunnel;
+ char* device_id;
};
LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc);
*/
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;
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);
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);
* 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);
}