为什么我的软电话无法连接到Asterisk?

我熟悉Asterisk,并正在阅读“Asterisk:电话的未来”一书。

根据本书,我已经configuration了sip.confextensions.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 

我相信我已经明白了。 由于SIP客户端和服务器都在端口5060上运行,我不能在软件电话的同一个盒子上运行Asterisk服务器。 我已经在远程服务器上安装了Asterisk,并且可以通过本书的指示与Ekiga连接。

哈,这本书甚至都是这样说的。 对我感到羞耻。

 If you are running Asterisk and a softphone on the same system (ie, 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. 

在同一个系统上同时运行星号和SIP软电话时,我通常将软电话更改为使用端口5070。

只要星号在softphone之前启动,星号将得到端口5060,一切正常,但这不是完全可靠的…