mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Add linphone_proxy_config_is_phone_number in public API
This commit is contained in:
parent
b8f297f6be
commit
a14fa22cf6
2 changed files with 11 additions and 2 deletions
|
|
@ -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){
|
|||
strcpy(plan->ccc,ccc);
|
||||
}
|
||||
|
||||
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;
|
||||
for(p=username;*p!='\0';++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;
|
||||
flatten=flatten_number(username);
|
||||
ms_debug("Flattened number is '%s'",flatten);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue