免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7676 | 回复: 8
打印 上一主题 下一主题

我的家用Asterisk PBX [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-16 06:19 |只看该作者 |倒序浏览
参照
http://www.nslu2-linux.org/wiki/Unslung/Asterisk

我实现那家用Asterisk PBX, 往国内打普通电话,手机便宜了许多。

照片:



[ 本帖最后由 mac93 于 2006-12-12 05:52 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2006-11-22 13:26 |只看该作者

可否多介绍

可否介绍以下硬件方面的配置、连接?

论坛徽章:
3
2015年迎新春徽章
日期:2015-03-03 17:23:07综合交流区版块每日发帖之星
日期:2015-08-19 06:20:00综合交流区版块每日发帖之星
日期:2015-09-15 06:20:00
3 [报告]
发表于 2006-11-24 00:30 |只看该作者
Asterisk

(redirected from Unslung.Asterisk)
The Open Source VoIP PBX System

http://www.asterisk.org/

Download the O'Reilly book "Asterisk: The Future of Telephony" http://www.asteriskdocs.org/modules/tinycontent/index.php?id=11
Installation

From the root prompt, type:
ipkg install asterisk

Optionally install the additional sound package:
ipkg -force-overwrite install asterisk-sounds
Configuration:

The original sample configuration files are in /opt/etc/asterisk/sample

Take a look at it, consult the voip-info.org Asterisk wiki and create your configuration files in /opt/etc/asterisk

Because the NSLU has only 32MB of RAM I'll recommend you to use a slim configuration (modules.conf).

I have tested it with the second Asterisk slim configuration with the iLBC codec disabled as it requires a floating point unit which isn't present on the IXP420.

You have to configure the path to the various asterisk component in asterisk.conf:
[directories]
astetcdir => /opt/etc/asterisk
astmoddir => /opt/lib/asterisk/modules
astvarlibdir => /opt/var/lib/asterisk
astagidir => /opt/var/lib/asterisk/agi-bin
astspooldir => /opt/var/spool/asterisk
astrundir => /opt/var/run
astlogdir => /opt/var/log/asterisk

Use the voip-info.org Asterisk wiki to find out how to configure:
extensions.conf
iax.conf
sip.conf
voicemail.conf
Performance expectations

The slug's IXP420 should have enough horse power for a home PBX with up to 4 lines, when less CPU intensive codecs (like GSM, G711u, G711a or G726) are used.

The CPU intensive codecs (iLBC, G729, Speex) are not working, but it should be possible to rewrite them using the DSP exetended instruction set supported by the IXP4xx. The Intel(R) IXP4XX DSP Software Library contains efficient implementations of all codecs including G729 and other VoIP goodies, but it looks that it cannot be used by asterisk: http://www.intel.com/design/netw ... mily/ixp425swr1.htm
Flash installation

To install on a USB flash disk, 128Mb or more is recommended to allow room for voicemail files etc.. See Ext3flash. It has been reported to run on 64Mb.
Asterisk sample configuration for Slug

If you want to try the Asterisk VoIP PBX without going trough the hassle of configuring it from the scratch, you can start with this sample configuration and you will have Asterisk running on the Slug in minutes.
Starting and stopping Asterisk

If you have just installed and configured Asterisk, you can try running it for the first time in console mode with some debugging applied with this command:
   /opt/sbin/asterisk -vvvc

Use the command "stop now" to shut down Asterisk from the CLI console.

If run with no arguments, Asterisk is launched as a daemon process:
   /opt/sbin/asterisk

You can get a CLI console to an already-running daemon by typing:
   /opt/sbin/asterisk -r

on the same computer on which Asterisk is running. More than one console CLI can connect to Asterisk simultaneously.

You can list all the available CLI commands by entering "help", or get information on a particular command by entering "help <command>".

To start asterisk at boot time, create a script whose name starts with S[number][number] in /opt/etc/init.d/ that executes asterisk:
   /opt/etc/init.d # cat S99asterisk
   #!/bin/sh
   /opt/sbin/asterisk
How to connect a standard phone and to a PSTN phone line

An Analog Telephone Adaper (ATA) like Sipura SPA-3000 can be used to connect a standard analog phone and to connect Asterisk to a PSTN phone line.
How to use a Gizmo Project account with asterisk

Add the following in sip.conf and replace YourGizmoSIPnumber and YourGizmoPassword with your 11 digits gizmo SIP number and password:

; register to gizmo
register => YourGizmoSIPnumber:YourGizmoPassword@proxy01.sipphone.com/YourGizmoSIPnumber

[gizmo]
type=friend
insecure=very
context=from-gizmo
username=YourGizmoSIPnumber
secret=YourGizmoPassword
host=proxy01.sipphone.com
fromuser=YourGizmoSIPnumber
fromdomain=proxy01.sipphone.com
nat=yes
canreinvite=no
disallow=all
allow=ulaw
allow=gsm
dtmfmode=rfc2833

Add the following in extensions.conf:

; outgoing gizmo
exten => _9.,1,SetCallerID("your name" <YourGizmoSIPnumber>)
exten => _9.,2,Dial(SIP/${EXTEN:1}@gizmo,120,T)
exten => _9.,3,Congestion
exten => _9.,103,Congestion

[from-gizmo]
exten => YourGizmoSIPnumber,1,Macro(stdexten,${INRINGSEXT},${INRINGSDEV})
exten => YourGizmoSIPnumber,2,Hangup

Note:
This will allow you to make outgoing calls to Gizmo by preceding the called number with 9. The stdexten macro assumes that the variables INRINGSEXT, INRINGSDEV are defined in your dial plan and represents the extension and device to ring when incoming calls are received from Gizmo.
How to configure music on hold

Playing MP3 on the slug will not work. You will have to convert your MP3 files to native format GSM and/or ULAW (using for example the free sound conversion software from http://www.nch.com.au/switch ) and configure asterisk to use the native format.

Your musiconhold.conf file should look like this:
; Music on hold class definitions
;
;[native-random]
[default]
mode=files
directory=/opt/var/lib/asterisk/moh-native ; Change to path of actual files
random=yes ; Play the files in a random order

No volume or other sound adjustments are available (but you can use the WavePad sound editor from http://www.nch.com.au to do that or add effects).
If the file is available in the same format as the channel's codec, then it will be played without transcoding.
Files can be present in as many formats as you wish, and the 'best' format will be chosen at playback time.

NOTE:
If you are not using "autoload" in modules.conf, then you must ensure that the format modules for any formats you wish to use are loaded _before_ res_musiconhold. If you do not do this, res_musiconhold will skip the files it is not able to understand when it loads.

To transcode to ULAW (for example) using the 'switch' sound conversion software:
set the output format to .raw
in the encoder setings select:
Format: G711 ULAW
Sample: 8000
Channels 1 - Mono
put the transcoded files in the directory specified in musiconhold.conf
change the .raw extension to .ulaw
How to configure the voicemail system to send messages by email

I was not able to make Asterisk to work with the email client that came with the Linksys firmware (the voicemail message showed up appended to the text, instead of being attached as .wav file). I've installed esmtp which has a sendmail compatible syntax:

> ipkg install esmtp

Then, I created /opt/etc/esmtprc where I configured esmtp to use my ISP outgoing email server: hostname=smtp.my_outgoing_mail_server.net:25
username=yourusername
password=yourpassword
* note - the username/password should be the same account as used in the serveremail entry in the voicemail.conf file

In /opt/etc/asterisk/voicemail.conf I configured the following:
in [general] section I configured the 1st recording format to be wav49 because it can be played by windows media player.

format=wav49
enabled voicemail to send messages as email attachment

attach=yes
the serveremail line forms the 'From' part of the email header and will (most likely) be matched by your ISP against the username and password in the esmtprc file. (anti-spam etc)

serveremail=youusername@youremaildomain
the fromstring line forms the display portion of the 'From' email address - and as such an email from 'you' to 'you' could still bear the display name of 'myvm', and thus be sortable/filterable etc.

fromstring=emailfromdisplayname
configured the command used to send email

mailcmd=/opt/sbin/sendmail -t
note: the -t option allows esmtp to retreive the mailing information from the headers within the body (provided to esmtp by asterisk)
added the email address to each mailbox

400 => 1234,John Smith,my_email@address.com
Useful dialplan macros

Here are some useful asterisk dialplan macros I create based on examples posted on www.voip-info.org:
Standard extension macro and call forwarding administration extensions
ENUM dial out macro
Failure announcement playback macro
Provisioning a Cisco 79XX series IP phone

The TFTP and HTML server capability of the NSLU2 can be used in conjunction with Asterisk to provision a Cisco 79XX series IP phone. For further information see: http://www.ambor.com/public/home_pabx/home_pabx.html(approve sites)
How to connect a YeaLink USB phone

This article describes how to connect and use a YeaLink USB-P1K handset with the NSLU2 as a standalone SIP VoIP phone.
How to make SIP work if NAT firewall is involved
in sip.conf, set nat=yes to the client definition:

[xlite1]
type=friend
regexten=401
username=xlite1
secret=passwd
context=default
callerid="John Smith" <401>
host=dynamic
nat=yes ; X-Lite is behind a NAT router
canreinvite=no
disallow=all
allow=ulaw
allow=gsm
mailbox=401@default
in the general section of sip.conf, provide either your domain or external IP if you don't have a domain:

externhost=yourdomain.net
externip = 200.201.202.203
configure your NAT router to forward the following ports to your NSLU2:

UDP 5060 for SIP (signalling)
UDP 10000-20000 for RTP (voice)
nslu2-asterisk group

For more information on using Asterisk on NSLU2 join the nslu2-asterisk group:
http://groups.yahoo.com/group/nslu2-asterisk/

论坛徽章:
0
4 [报告]
发表于 2006-11-30 23:20 |只看该作者
原帖由 kingsz1 于 2006-11-22 13:26 发表
可否介绍以下硬件方面的配置、连接?


能具体介绍一下方案,都需要什么硬件,以及成本??

论坛徽章:
0
5 [报告]
发表于 2006-12-01 15:40 |只看该作者
我也想知道,这很有诱惑力,一直想做个例子给人家看看。

论坛徽章:
0
6 [报告]
发表于 2006-12-04 09:45 |只看该作者
新手提问:请问都需要哪些硬件设备?也像弄一个玩玩^_^
除了 传统电话 + ata + nslu + 闪存 ,还需要什么?
另外sip电话也不是很贵,如果用sip电话的话,整个系统都需要哪些硬件?
谢谢了

[ 本帖最后由 lit40 于 2006-12-4 09:50 编辑 ]

论坛徽章:
0
7 [报告]
发表于 2006-12-06 14:02 |只看该作者
SIP电话差不多的260块吧一个把。
可以用软件替代

论坛徽章:
0
8 [报告]
发表于 2006-12-12 06:04 |只看该作者
Hi guys,

I am newbie to Asterisk too, I just simply followed http://www.nslu2-linux.org/wiki/Unslung/Asterisk  to setup the system. There are a lot of info on http://www.voip-info.org/wiki-Asterisk

I lately replaced the Linksys SPA3102 with a simple Handytone 286 ATA device because I don't have landline at home, no need to have Linksys SPA3102.

论坛徽章:
0
9 [报告]
发表于 2006-12-15 18:12 |只看该作者
刚接触,很想了解。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP