How Does Linphone Toggle SIP Contact?

  1. Linphone client monitors the user’s contact info, if changed use LibLinphone to synchronize the contact.
  2. How synchronize?
    1. 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.
    2. 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!”
    3. 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.
      1. In the codes, just use both methods linphone_proxy_config_edit(cfg); and linphone_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]
      2. 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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值