You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android端PJSIP(pjsua2)注册成功但SIP outbound状态异常求助

PJSIP(pjsua2) SIP Outbound状态Inactive问题排查

问题描述

将Android项目从Linphone迁移至PJSIP(pjsua2),采用TLS协议5061端口。相同的SIP凭据在Linphone中可正常工作,PJSIP也能成功注册,但SIP outbound状态始终为inactive,导致无法建立呼叫连接。

使用Telnyx凭据完成账号注册后,注册状态显示成功,但SIP outbound状态仍为inactive,无法发起呼叫。

环境信息

  • PJSIP版本:2.11.1
  • 运行环境:Android设备(Motorola、Huawei,系统版本Android 10、12)

日志信息

--end msg-- 15:49:06.080        tsx0x7694f0e0a8  .Incoming Response
msg 200/REGISTER/cseq=63080 (rdata0x76941b1b18) in state Calling
15:49:06.081        tsx0x7694f0e0a8  ..State changed from Calling to
Completed, event=RX_MSG 15:49:06.084            pjsua_acc.c  ....SIP
outbound status for acc 1 is not active 15:49:06.085
pjsua_acc.c  ....sip:Zohair24104@sip.telnyx.com: registration success,
status=200 (OK), will re-register in 293 seconds

配置代码片段

val stun_servers = StringVector()
stun_servers.add("stun.telnyx.com")
epConfig.uaConfig.stunServer = stun_servers
epConfig.uaConfig.outboundProxies.add("sip:sip.telnyx.com;transport=tls")

id = "sip:shahbaz39156@sip.telny"
reg = "sip:sip.telnyx.com"
proxy = "sip:sip.telnyx.com:5061;transport=tls"
user = "username"
pass = "password"

accCfg!!.sipConfig.proxies.add(proxy)
accCfg!!.natConfig.iceEnabled = true
accCfg!!.natConfig.contactRewriteUse = 1

accCfg!!.videoConfig.autoTransmitOutgoing = true
accCfg!!.videoConfig.autoShowIncoming = true

accCfg!!.natConfig.iceEnabled = true
accCfg!!.sipConfig.proxies.add(proxy)
accCfg!!.natConfig.iceEnabled = true
accCfg!!.natConfig.contactRewriteUse = 1
accCfg!!.natConfig.contactRewriteMethod = 1

accCfg!!.mediaConfig.srtpUse = PJMEDIA_SRTP_OPTIONAL
accCfg!!.mediaConfig.srtpSecureSignaling = 0 // 0和1都无法解决问题

accCfg!!.natConfig.sipStunUse = 1
accCfg!!.natConfig.sipOutboundUse = 1

求助

有人遇到过此类问题或能协助调试配置吗?


内容的提问来源于stack exchange,提问作者Shahbaz Naseer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 06:43:16