解决办法:error=Too many objects of the specified type (PJ_ETOOMANY)

在某种异常情况下,pjsip客户端会出现重注册失败,此时如果注册失败的该用户呼叫,就会出现错误:operation=make_call(), error=Too many objects of the specified type (PJ_ETOOMANY)

解决办法:

    pjsua提供一种方法:

class AccountInfo:
    """This describes Account info. Application retrives account info
    with Account.info().
   。。。。。。。。
    reg_status      -- the registration status. If the value is less than
                       700, it specifies SIP status code. Value greater than

   。。。。。。。。

所以只要在呼叫之前判定主被叫注册状态即可,具体实例如下(python):

class MyAccountCallback(pj.AccountCallback):
   。。。。。。。。

    def on_reg_state(self):
        global iRegStatus
        if self.sem:
            iRegStatus = self.account.info().reg_status
            if self.account.info().reg_status >= 200:
                self.sem.release()

   。。。。。。。。


            accCaller = lib.create_account(pj.AccountConfig(SipUser.Domain,”3001“,”111111“),True,None)
            acc_cbCaller = MyAccountCallback(accCaller)
            accCaller.set_callback(acc_cbCaller)
            acc_cbCaller.wait()

            accCaller.on_reg_state()

            if iRegStatus == 200:

                bRegStatus = True





          






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值