如何增加PJSUA中的最大传输数?

2024-06-12 01:13:28 发布

您现在位置:Python中文网/ 问答频道 /正文

摘要

我试图支持32个唯一的帐户和32个唯一的IP:端口地址。我目前能够在构建期间使用config_site.h成功地调整max account(PJSIP_MAX_ACC),但是传输仍然被限制为默认的8。在

除了PJ_IOQUEUE_MAX_HANDLESPJSIP_MAX_TRANSPORTS之外,还需要哪些其他设置来允许总共32个唯一传输?

额外学分:下面测试代码的C等价物是什么,所以我可以直接测试库?

历史的

struggling理解如何正确地使用config_site.h进行构建之后,我终于能够在Ubuntu 15.10安装上看到一些结果。不幸的是,在看到一些更改时,我无法看到完成我的程序所需的更改;32个传输帐户有32个帐户。在

我用来尝试这些更改的引用是通过PJSIP Mailing ListNarkive Mailing List Archive找到的,只有PJSIP Reference Documentation和{a5}的最小帮助。在

最后的结果是一个config_site.h,有8个不同的设置(参见下面的代码部分)。不幸的是,它仍然不能让我达到我想要达到的目标。在

我需要唯一的IP:端口地址,因为我正在尝试点对点VOIP呼叫,通过转发/代理服务器重定向两次,导致软件的帐户检测无法一致工作。在

代码

配置站点.h

/*
 * This file is customized by Ash to (attempt) to override the 
 * default settings of PJSIP to support much more  
 */

#define PJ_IOQUEUE_MAX_HANDLES      32
#define FD_SETSIZE_SETABLE      1
#define __FD_SETSIZE            32

#define PJSIP_MAX_TRANSPORTS        32
#define PJSIP_MAX_RESOLVED_ADDRESSES    32

#define PJSUA_MAX_ACC           32
#define PJSUA_MAX_CALLS     32
#define PJSUA_MAX_PLAYERS       32

测试代码(通过Python)

^{pr2}$

错误

Traceback (most recent call last):
  File "/Users/ashpesante/Documents/Development/PyCharms/pj/32t32a.py", line 12, in <module>
    transport[x] = (lib.create_transport(pjsua.TransportType.UDP))
  File "/Library/Python/2.7/site-packages/pjsua.py", line 2302, in create_transport
    self._err_check("create_transport()", self, err)
  File "/Library/Python/2.7/site-packages/pjsua.py", line 2721, in _err_check
    raise Error(op_name, obj, err_code, err_msg)
pjsua.Error: Object: Lib, operation=create_transport(), error=Too many objects of the specified type (PJ_ETOOMANY)
Exception AttributeError: "'NoneType' object has no attribute 'destroy'" in <bound method Lib.__del__ of <pjsua.Lib instance at 0x10c0f58c0>> ignored

未定义错误

_pjsua.c: In function ‘py_pjsua_enum_transports’:
_pjsua.c:1202:17: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     pj_status_t status;
             ^
_pjsua.c: In function ‘py_pjsua_conf_get_port_info’:
_pjsua.c:2338:9: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     int status; 
     ^
_pjsua.c: In function ‘py_pjsua_get_snd_dev’:
_pjsua.c:2714:9: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     int status; 
     ^

Tags: inpystatuscreatesite帐户variablemax