- 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 发布
本文介绍了Linphone中如何使用LibLinphone库来同步用户的联系人信息。文章详细阐述了验证新联系人信息的正确性,并通过停止刷新器、取消注册旧联系人以及注册新联系人的步骤来实现联系人的切换。

5341

被折叠的 条评论
为什么被折叠?



