Abhishek Punia
Abhishek Punia

Reputation: 133

Linphone change "replace + by 00" funcation

i all i am making a project using linphone in account there is option of "Replace + by 00".
Example :- if number the number is saved in our phone
+91-12345678 after using this option "replace + 00" what it does change this number to 0091-12345678.
what i need is i want to change "replace + 00" to "replace + 900" mean
the number should be 90091-12345678 i am not able to find where that string is where i can change 00 by 900. if anyone is using the linphone or any other user please help me with it.
Thanks

Upvotes: 1

Views: 1302

Answers (1)

J.M. Robles
J.M. Robles

Reputation: 652

I'm afraid the configuration supports only changeing ICP (International Calling Prefix) with '+'.

The struct _LinphoneDialplan is defined in core_utils.h

typedef struct _LinphoneDialPlan {
    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*/
} LinphoneDialPlan;

In dial_plan.c, the ICPs are constants for each country

static LinphoneDialPlan const dial_plans[]={
    //Country                   , iso country code, e164 country calling code, number length, international usual prefix
...
    {"India"                        ,"IN"       , "91"      , 10    , "00"  },
...
};

And the value dial_escape_plus, taken from the confiuguration is only used in proxy.c in this way:

result = ms_strdup_printf("%s%s%s"
                        , tmpproxy->dial_escape_plus ? dialplan.icp : "+"
                        , dialplan.ccc
                        , nationnal_significant_number_start);

All this is in version 3.11 of linphone, in previous versions the conversion between "+" and "00" is more "explicit".

So, without patching the library, I think you cannot change the number in the way you intend to. It is always possible to manipulate the string according to your needs

Upvotes: 2

Related Questions