我正在熟悉 Asterisk,并且正在阅读《Asterisk:电话的未来》这本书。
我已经配置完毕sip.conf
并extensions.conf
按照书上说的做了。
sip.conf
:
[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
[1000]
type=friend
context=phones
host=dynamic
extensions.conf
:
[globals]
[general]
autofallthrough=yes
[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()
[incoming_calls]
[internal]
exten => 500,1,Verbose(1|Echo test application)
exten => 500,n,Echo()
exten => 500,n,Hangup()
[phones]
include => internal
我的 Asterisk 服务器在我的桌面和软件电话 (Ekiga) 上运行。当我添加帐户时,它显示Could not register sip:1000@localhost
。我还尝试将 Ekiga 中的注册器设置为127.0.0.1
。
我只是想让 Asterisk 使用基本设置,以便我可以对其进行试验。
系统详细信息:
blaine :: /etc/asterisk » uname -a
Linux blaine 2.6.32-24-generic #38-Ubuntu SMP Mon Jul 5 09:20:59 UTC 2010 x86_64 GNU/Linux
blaine :: /etc/asterisk » cat /etc/issue
Ubuntu 10.04.1 LTS
更新
我在本地主机上运行了 nmap,发现以下内容
blaine :: /etc/asterisk » nmap localhost
Starting Nmap 5.00 ( http://nmap.org ) at 2010-08-04 10:38 MDT
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Interesting ports on localhost (127.0.0.1):
Not shown: 987 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
631/tcp open ipp
1720/tcp open H.323/Q.931
2000/tcp open callbook
3306/tcp open mysql
5222/tcp open unknown
5269/tcp open unknown
7070/tcp open realserver
7443/tcp open unknown
7777/tcp open unknown
9090/tcp open zeus-admin
9091/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.35 seconds
答案1
我相信我已经搞清楚了。由于 SIP 客户端和服务器都在端口 5060 上运行,因此我无法在与软件电话相同的机器上运行 Asterisk 服务器。我在远程服务器上安装了 Asterisk,我可以按照书中的说明使用 Ekiga 连接到它。
哈,书上也这么说。我真丢脸。
If you are running Asterisk and a softphone on the same system (i.e.,
running an X-Lite softphone and Asterisk on a laptop or desktop), then
you will need to modify the SIP port that client listens on. It will need
to be changed from 5060 to 5061 (or some other unused port) so that
Asterisk and the softphone do not interfere with each other.
答案2
在同一系统上同时运行星号和 SIP 软件电话时,我通常会将软件电话更改为使用端口 5070。
只要 asterisk 在软电话之前启动,asterisk 就会获得端口 5060 并且一切正常,但这并不完全可靠......