如何在 pjsip 和 Asterisk 13 中允许入站呼叫? [英] How to allow inbound calls in pjsip and Asterisk 13?

查看:46
本文介绍了如何在 pjsip 和 Asterisk 13 中允许入站呼叫?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用 PJProject 2.5.5 配置了 Asterisk 13.13.1 并启用 PJSIP 作为 SIP 驱动程序(不编译 chan_sip).

I have configured Asterisk 13.13.1 with PJProject 2.5.5 and enable PJSIP as SIP driver (without compiling chan_sip).

我拥有完整配置的系统并且可以正常工作,但是我在接听电话时遇到了一些问题.我的主机连接的号码很少,当我从任何公共号码拨打电话时,我在 asterisk 远程控制台上注意到了此信息:

I have the fully configured system and it's working but I have some problems with incoming calls. I have few numbers connected with my host and when I calling from any public number I noticed this info on asterisk remote console:

[Feb 24 14:27:16] NOTICE[5291]: res_pjsip/pjsip_distributor.c:525 log_failed_request: Request 'INVITE' from '"zzzzz" <sip:zzzzz@192.168.34.1>' failed for '192.168.34.1:5062' (callid: 0e07e7607f8f62dd225347363173bb9f@192.168.34.1:5062) - No matching endpoint found

如果我将呼叫我的 Asterisk 的号码添加到端点,那么它就可以工作了 - 我可以接听这个电话.

And if I add the number which is calling to my Asterisk to endpoints then it's working - I can pick up this call.

如何添加允许所有入站呼叫的可能性?

How to add the possibility to allow all inbound calls?

推荐答案

您需要创建一个匿名端点来接受来自未知端点的入站呼叫.

You need to create an anonymous endpoint to accept inbound calls from unknown endpoints.

请注意,添加匿名端点会使系统受到扩展扫描攻击,扫描器会尝试找出您在系统中配置的扩展.他们这样做要么是通过广告电话向您发送垃圾邮件,要么是利用呼叫转移来拨打长途号码,或者是出于其他不可告人的目的.

Be aware that adding an anonymous endpoint opens the system to extension scanning attacks where scanners try to find out which extensions you have configured in your system. They do this either to spam you with advertising calls, or exploit call transferring to call long distance numbers, or for some other ulterior motive.

创建匿名端点后,将其与与您的扩展使用的上下文不同的上下文相关联.这可以防止他们通过您的中继线拨打长途电话.

After creating an anonymous endpoint, associate it with a context different from that used by your extensions. This prevents them from dialing long-distance through your trunks.

要在 pjsip.conf 中添加匿名端点,请添加以下几行:

To add an anonymous endpoint in pjsip.conf, add the following lines:

[anonymous]
type=endpoint
context=anonymous
disallow=all
allow=speex,g726,g722,ilbc,gsm,alaw

在拨号方案extensions.conf中:

[anonymous]
exten => _XXXXX,1,GotoIf(${DIALPLAN_EXISTS(local-extensions,${EXTEN},1)}?local-extensions,${EXTEN},1)
 same => n,Hangup(1)

local-extensions 是列出本地扩展的上下文.

local-extensions is the context listing your local extensions.

这篇关于如何在 pjsip 和 Asterisk 13 中允许入站呼叫?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆