@@ -74,3 +74,32 @@ This pseudo code shows how to unregister a user associated to a #LinphoneProxyCo
.. seealso:: A complete tutorial can be found at: :ref:`"Basic registration" <basic_registration_code_sample>` source code.
Proxies dependency
------------------
As an example, a practical use case of dependent proxies could be as follows:
On a mobile device app, a proxy configuration is registered to a non-modifiable server that does not support push notifications, thus being unreachable most of the time.
To enable push notifications, we could add another proxy configuration and mark the initial one 'dependent' on a proxy pointing to a push-enabled server (refered to as 'master' or 'dependency').
The proxy configuration will wait for successful registration on its dependency before triggering its own.
Once registered, both proxy configurations will share the same contact address (the 'master' one). Meaning that calls to the dependent address will go through the push-enabled master server.
This mecanism must be enabled before the proxy configuration is added to the core (before :cpp:func:`linphone_core_add_proxy_config`).
/* Used to completely disable registration on a dependent proxy config. (Won't be enabled back even if it's 'master' proxy config state goes to LinphoneRegistrationOk) */
bool_treg_dependent_disabled;
bool_tpublish;
bool_tdial_escape_plus;
...
...
@@ -134,6 +136,7 @@ struct _LinphoneProxyConfig
char*refkey;
char*sip_etag;/*publish context*/
char*depends_on;/* NULL or points to another proxy_config->refkey */
//We do not call linphone_proxy_config_enable_register on purpose here
//Explicitely disabling register on a dependent config puts it in a disabled state (see cfg->reg_dependent_disabled) to avoid automatic re-enable if masterCfg reach LinphoneRegistrationOk