Commit a14fa22c authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

Add linphone_proxy_config_is_phone_number in public API

parent b8f297f6
......@@ -1040,6 +1040,15 @@ LINPHONE_PUBLIC void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
LINPHONE_PUBLIC void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
LINPHONE_PUBLIC SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
* Detect if the given input is a phone number or not.
* @param proxy #LinphoneProxyConfig argument, unused yet but may contain useful data. Can be NULL.
* @param username string to parse.
* @return TRUE if input is a phone number, FALSE otherwise.
LINPHONE_PUBLIC bool_t linphone_proxy_config_is_phone_number(LinphoneProxyConfig *proxy, const char *username);
* Normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
* or +33888444222 depending on the #LinphoneProxyConfig argument. This function will always
......@@ -879,7 +879,7 @@ static void lookup_dial_plan(const char *ccc, dial_plan_t *plan){
static bool_t is_a_phone_number(const char *username){
bool_t linphone_proxy_config_is_phone_number(LinphoneProxyConfig *proxy, const char *username){
const char *p;
if (isdigit(*p) ||
......@@ -928,7 +928,7 @@ static void replace_plus(const char *src, char *dest, size_t destlen, const char
bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len){
if (is_a_phone_number(username)){
if (linphone_proxy_config_is_phone_number(proxy, username)){
char *flatten;
ms_debug("Flattened number is '%s'",flatten);
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