How to forward sip call on Asterisk using PJSIP?

问题描述 投票:0回答:2

我最近使用 PJSIP 将我们的旧服务器迁移到新的 Asterisk,我们正在使用数据库和 AGI 来控制调用。我们的客户可以设置对 PSTN 或 Sip 端点的呼叫。 在旧的 sip 服务器中,我们在 AGI 中使用以下命令。

SIP/#######@sipserverip.com,30,HL(299940000:7000:5000)

现在对于 PJSIP,我已经为我的 PSTN 更改了以下内容,它工作得很好,相同的字符串,但是对于出站 SIP 呼叫,我收到错误。由于我的 PSTN 中继已注册,因此可以正常工作,

 PJSIP/#######@sipserverip.com,30,HL(299940000:7000:5000)

它给我错误

Unable to create PJSIP channel - endpoint 'sipserverip.com' was not found

我可以使用 pjsip.conf 文件修复它并添加此端点,但我的问题是我的数据库中有大量端点,应该有另一种解决方案,配置中有什么吗?因为我们不在系统中添加这些 IPS,而只是将呼叫转发到另一个 sip 端点。用户也可以选择添加更多端点。我们没有使用 sip 注册,也不允许 sipper 实时用户管理。

感谢您的帮助。

asterisk
2个回答
5
投票

感谢@arheops 经过几次尝试我解决了这个问题。我需要使用以下信息在我的 PJSIP.conf 文件中创建一个 PJSIP 端点。我知道需要减少此配置,但现在通话进行得很顺利。谢谢大家的帮助,以下是配置,也许别人会解决这个问题。

[outgoing]
type = aor
maximum_expiration = 60
minimum_expiration = 60
default_expiration = 180

[outgoing]
type = identify
endpoint = outgoing

[outgoing]
type = endpoint
context = default
dtmf_mode = none
disallow = all
allow = all
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
language = en
aors = outgoing
t38_udptl = yes
t38_udptl_ec = none

3
投票
same => n,Dial(PJSIP/default_endpoint/sip:[email protected]:5060)

请注意,defualt_endpoint应该是配置中指定的VALID端点。这样它从default_endpoint获取连接参数(编解码器等)并直接调用指定的url(忽略端点ip)。

在星号文档项目中有清楚的描述

https://wiki.asterisk.org/wiki/display/AST/Dialing+PJSIP+Channels

© www.soinside.com 2019 - 2024. All rights reserved.