- Linphone client monitors the user’s contact info, if changed use LibLinphone to synchronize the contact.
- How synchronize?
- Linphone use a struct named LinphonePorxy to manager the settings of Linphone, all changed contact info should should save to Linphone Core Store via it.
- In order to toggle the contact, firstly validate new contact info. Only all details are correct, it will turn to next, otherwise do alert that “Toggle Contact Failed!”
- If all the new contact info has passed the checks, Liblinphone can use its methods to Unregister the old contact and then REGISTER new contact.
- In the codes, just use both methods
linphone_proxy_config_edit(cfg);
andlinphone_proxy_config_done(cfg);
to stop a struct named Refresher, then the refresher can automatically send a SIP REGISTER message with “Expires: 0” to OpenSIPS. Although SIP server will send a “401 Unauthorized” message, linphone will discard the stateless response [401] - Then, use
linphone_core_add_proxy_config(lc, proxycfg)
to set a new proxy to “Linphone Core”. In this method, it will send a new REGISTER message with new contact info and “Expires: 3600” to register the newly contact.
- In the codes, just use both methods
How Does Linphone Toggle SIP Contact?
最新推荐文章于 2024-02-07 15:18:04 发布