Change linphone_proxy_ocnifg_normalize_number API to return a boolean value:...

Change linphone_proxy_ocnifg_normalize_number API to return a boolean value: TRUE if input was a phone number, FALSE otherwise

Conflicts:
	coreapi/linphonecore.h
parent a79a5cea
This diff is collapsed.
......@@ -409,7 +409,7 @@ void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char
LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc, int index);
void linphone_proxy_config_write_to_config_file(struct _LpConfig* config,LinphoneProxyConfig *obj, int index);
int linphone_proxy_config_normalize_number(LinphoneProxyConfig *cfg, const char *username, char *result, size_t result_len);
bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *cfg, const char *username, char *result, size_t result_len);
void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage *msg);
void linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op, const SalIsComposing *is_composing);
......
......@@ -927,8 +927,7 @@ static void replace_plus(const char *src, char *dest, size_t destlen, const char
}
int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len){
int numlen;
bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len){
if (is_a_phone_number(username)){
char *flatten;
flatten=flatten_number(username);
......@@ -938,7 +937,6 @@ int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const cha
/*no prefix configured, nothing else to do*/
strncpy(result,flatten,result_len);
ms_free(flatten);
return 0;
}else{
dial_plan_t dialplan;
lookup_dial_plan(proxy->dial_prefix,&dialplan);
......@@ -949,8 +947,8 @@ int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const cha
/*eventually replace the plus*/
replace_plus(flatten,result,result_len,proxy->dial_escape_plus ? dialplan.icp : NULL);
ms_free(flatten);
return 0;
}else{
int numlen;
int i=0;
int skip;
numlen=strlen(flatten);
......@@ -975,8 +973,11 @@ int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const cha
ms_free(flatten);
}
}
}else strncpy(result,username,result_len);
return 0;
return TRUE;
} else {
strncpy(result,username,result_len);
return FALSE;
}
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment