如题,在编译DAHDI时,应先检查并安装这些包:
apt-get install libncurses5-dev bison libssl-dev libnewt-dev zlib1g-dev procps gcc make binutils doxygen
Cheers!
如题,在编译DAHDI时,应先检查并安装这些包:
apt-get install libncurses5-dev bison libssl-dev libnewt-dev zlib1g-dev procps gcc make binutils doxygen
Cheers!
名字: dahdi_monitor –用于查看DAHDI通道的接收/发送电平信号.
语法:
dahdi-monitor num [-v[v] ] dahdi_monitor num [-o] [<-f|-F> FILE] dahdi_monitor num [[<-f|-R> FILE]] [[<-t|-T> FILE]]
描述:
dahdi_monitor监视一个DAHDI通道.它可以将一个输出录制到一个文件里,将它播放给说话者,或者将语音电平信号显示到中断. 被录制的语音文件默认是原始的线性符PCM.如果文件以.wav为后缀,那么被录制的文件就是一个wav文件. 直观显示的是当前Rx(Asterisk接收语音)方向的语音电平和Tx(Asterisk传送出去的语音)方向的电平信号. 按Ctri-C可以退出该应用.
选项:
第一个(命令)参数是需要监视的通道号码.
-m: 多通道,不要在单通道里多路复用RX和TX. 正常情况下, 应该有一个不同的选项用来指明它. (这个参数不知道怎么样用,求例子!)
-0:将输出播放给OSS(/dev/dsp)。此时不启用-m选项.
-v : 显示虚拟的语音电平信号.用两个-v. 冗余模式被启用时,将显示实际的语音电平信号表示为号码. 应该主要的是,这里中断需要超过80列的宽度才能确切地显示出来. 暗含-m(还没搞懂这里是什么意思)
-f FILE: 录通道(RX和TX方向)的内容到一个文件.
-F FILE: 在回音消除之前录制通道(TX和RX方向)的内容到一个文件.
-r FILE: 录通道rx方向的内容到一个文件.
-R FILE: 在回音消除之前录通道rx方向的内容到一个文件.
-s FILE: 录通道rx和tx方向的内容到一个文件.
-S FILE: 在回音消除之前,录通道的一个rx和tx两个方向的立体声到一个文件.
-t FILE: 录通道的tx方向的内容到一个文件.
-T FILE: 在回音消除之前录通道tx方向的内容到一个文件.
例子:
在DAHDI通道2上进行可视化的录音:
dahdi_monitor 2 -v
将通道2的录音内容录下,并保存到一个文件:
dahdi_monitor 2 -f output.raw
这里将会产生一个原始的PCM文件(根据样品:线性符,8KHZ,单声道, 16位进行存储). tx和rx双向将会复用到一个单通道上. 用如下的方法它可以转换成为一个wav文件:
sox -s -c1 -2 -r8000 ouput.raw output.wav
将通道5的rx和tx方向的内容录制下来分别存储到独立的两个文件,这次直接用wav格式存储.
dahdi_monitor 5 -r output_rx.wav -t output_tx.wav
录制通道8的内容到一个立体声文件(rx和tx在它们各自的通道上)
dahdi_monitor 8 -s ouput.raw
将它转换成wav格式的文件:
sox -s -c2 -2 -r8000 ouput.wav output.wav
经常用的是:
dahdi_monitor 1 -v -r output_rx.raw -t output_tx.raw
Cheers!
Elastix已经在4月3日正式发布。下载地点在这里。
该版本中的接口,安全和性能方面有重要的改进和提升。优化了Web界面周边的数据表和报表,以及Asterisk,DAHDI,Wanpipe,CentOS版本等都做了升级。
在这个Elastix新版本中,Addons模块做了一个完全的重新设计,使得它对于所有第三方应用程序的下载更加形象化。
对于那些想自定义他们自己的Elastix的开发者来说,他们将会发现在所有坐标模型的模块里,可以根据需要进行修改和进行多种自定义操作。
另外,本次发布的一个重要更新就是那些用来处理硬件驱动RPM包不再是直接链接到一个内核了。因此你可以升级至任何一个内核而不至于造成内核不兼容的问题. 因为这是使用了缺乏权威的更新.
在这个版本中的主要更新和新功能如下:
Asterisk升级至1.8.11.0-0
CentOS升级至5.7
DAHDI升级至2.4.1.2-10
Wanpipe升级至3.5.25-0
jquery升级至1.7.1
Addons做重新设计,以及在Calendar,Call Center, Fax, PBX, Reporting, Security 和 System modules方面做改进和提升.
检查过滤用report表.
译自:http://www.elastix.org/index.php/en/component/content/article/783-elastix230.html
Cheers!
今天有个客户终于把它的要求说明白了。搞得晕头转向。误解误解。。沟通依然重要啊。
其实他就是想憋开常见的拨号终端(例如:SIP,IAX等)来发起呼叫,好在Asterisk已经有了这样的应用程序,originate救了一命。哈哈。 如下是我做的一些事情。大家参考参考。
译自:http://www.voip-info.org/wiki/view/Asterisk+cmd+Originate
Originate作用:发起一通呼叫。而不用其他类似SIP的终端来发起。(从Asterisk-1.6.2开始有这个功能)
语法:
Originate(tech_data,type,arg1[,arg2[,arg3]])
参数:
tech_data: 用于创建外呼的通道类型或数据。例如:SIP/1234
type: 这里应该是’app’或者’exten’,这取决于外呼的通道类型应该连接到一个应用还是一个分机上
arg1: 如果类型为’app’,这个arg1则为应用的名字.如果类型为’exten’,这个arg1则为与外呼通道连接的context
arg2: 如果类型是’app’,这个arg2则为传进这个应用的数据(将该数据作为参数).如果类型是’exten’,这个arg2则为与通道相连接的分机
arg3: 如果类型是’exten’,这个arg3则为与通道相连的优先级(priority).如果类型是’app’,则这个参数将会被忽略.
描述:
这个应用程序主要用于向外发起一通呼叫,并与指定的分机或者别的应用相连接。该应用程序将会堵塞直到外呼失败或者应答。在那个时候,
该应用程序将会在退出之前设置的状态变量,然后拨号计划将会继续进行。
该应用程序在退出之前设置了如下几个通道变量:${ORIGINATE_STATUS}: 用以表示发起呼叫的结果。
FAILED
SUCCESS
BUSY
CONGESTION
HANGUP
RINGING
UNKNOWN:在实际的操作中,你应该看不到这个值。如果你遇见了,请报告它到问题跟踪。
示例:
环境信息:Asterisk-1.6.2.11, OpenVox G400P,chan-extra-2.0.1
首先做一个落地。我这里用的是Asterisk的一个SIP分机6666.在extensions.conf里头添加如下:
[from-openvox]
exten =>s,1,Answer()
exten =>s,n,MixMonitor(OpenVox.wav,b)
exten =>s,n,Dial(SIP/6666)
exten =>s,n,Hangup()
然后在Asterisk CLI执行:
localhost*CLI> originate extra/1/13714254453 extension s@from-openvox
这时详细信息如下:
-- Requested transfer capability: 0x00 - SPEECH
-- PROGRESS with cause code 0 received
-- Executing [s@from-openvox:1] Answer("EXTRA/1-1", "") in new stack
-- Executing [s@from-openvox:2] MixMonitor("EXTRA/1-1", "OpenVox.wav,b") in new stack
-- Executing [s@from-openvox:3] Dial("EXTRA/1-1", "SIP/6666") in new stack
== Using SIP RTP CoS mark 5
-- Called 6666
== Begin MixMonitor Recording EXTRA/1-1
-- SIP/6666-00000002 is ringing
-- SIP/6666-00000002 answered EXTRA/1-1
-- Channel 1, span 1 got hangup, cause 16
-- Channel 1, span 1 received AOC-E charging 165683344 units
== Spawn extension (from-openvox, s, 3) exited non-zero on 'EXTRA/1-1'
-- Hungup 'EXTRA/1-1'
== MixMonitor close filestream
== End MixMonitor Recording EXTRA/1-1
localhost*CLI>
上面的信息就是从OpenVox G400P的extra通道的第一个GSM模块出去然后拨13714254453这时这个手机会振铃,当你接听的时候,SIP分机6666将会振铃。如果你应答的话,那么SIP和这个手机就可以通话了。
Cheers!
VoIP Phone Manufacturers:
Yealink Snom Aastra Grandstream Polycom Cisco Polycom Lync Digium Panasonic Glgaset Atcom Citel Doro Linksys Norphonic Cloud TC Xorcom
VoIP Phone Manufacturers(wireless):
Grandstream Snom Glgaset Panasonic UniData Polycom Aastra Polycom Kirk Cisco
Asterisk Cards, Hardware & Components
Sangoma Digium OpenVox Xorcom Dialogic BeroNet Redfone Voismart Rhino Junghanns Atcom Sirrix Octasic Asterisk Voice Prompts
VoIP Video Conferencing
AVer Vu Telepresence Yealink Grandstream Polycom Cisco
IP Conference Phone
Polycom Snom Konftel ClearOne
Analog Adapter
Grandstream Linksys Atcom Patton
IP PBXs
Xorcom Digium Switchvox Pika WARP Atcom Snom Grandstream Rhino Gigaset Cisco Aastara 3CX
VoIP Gateways
Microsoft OCS, Lync Sangoma Dialogic Patton Quintum Digium Grandstream PROTech Mediatrix 2N Vegastream BeroNet Aculab Applian Redfone VoiSmart TelecomFM Topex Industry Dynamics Parlay Dinstar
Cheers!
今晚在调试<C语言编程百例>的一个程序:
#include <math.h>
#include <stdio.h>
/*
* 如果小于等于i的平方根的数都除不尽,则i必是素数
* */
int main()
{
int i, j, num;
int p, q, flagp, flagq;
printf("Please inpu a plus integer: ");
scanf("%d", &num);
/* 代码(num %2 != 0)表示num不能被2整除 */
if (((num % 2) != 0) || (num <= 4))
printf("input data error!\n");
else
{
p = 1;
/* do-while 循环体 */
do
{
p = p + 1;
q = num - p;
flagp = 1;
flagq = 1;
/* for 循环体 */
/* floor(double num)函数的功能是返回不大于num的最大整数(表示浮点值)*/
for (i = 2; i <= (int)(floor(sqrt((double)(p)))); i++)
{
if ((p % i ) == 0)
{
flagp = 0;
break;
}
}
/* while 循环 */
j = 2;
while (j <= (int)(floor(sqrt((double)(q)))))
{
if ((q % j) == 0)
{
flagq = 0;
break;
}
j++;
}
} while (flagp * flagq == 0);
printf("%d = %d + %d\n", num, p, q);
}
}
但是不能和之前的练习一样,简单地用gcc 18_integration.c 这样编译。因为报题目那样的错。编译器似乎找不到sqrt这个函数,也就是说没有这个函数的库.
Google了一下,说编译的时候记得带上参数-lm即可。
gcc 18_integration.c -lm即可编译通过.
Cheers!
-Asterisk SIP Trunk Configuration ( Asterisk sip.conf ) Guide
Asterisk is the world’s most powerful and popular telephony development tool-kit. It is used by small businesses, large businesses, call centers, carriers and governments worldwide.
Asterisk is open source telephony project. Under development since 1999, Asterisk is free, open source software turns an ordinary computer into a feature-rich voice communications server. Asterisk makes it simple to create and deploy a wide range of telephony applications and services.
Digium makes Asterisk available to the open source community under the GNU General Public License (GPL).
Some of the features of Asterisk is as follows;
- Supports various VoIP protocols including IAX, SIP, MGCP, SCCP and H323.
- Support for PSTN interface cards and devices.
- Routing and call handling for incoming calls.
- Outbound call generation and routing.
- Media management functions (record, play, generate tone, etc.).
- Call detail recording for accounting and billing.
- Transcoding (conversion from one media format to another).
- Protocol conversion (conversion from one protocol to another).
- Database integration for accessing information on relational databases.
- Web services integration for accessing data using standard internet protocols.
- LDAP integration for accessing corporate directory systems.
- Single and multi-party call bridging.
- Call recording and monitoring functions.
- Integrated “Dialplan” scripting language for call processing.
- External call management in any programming or scripting language through Asterisk Gateway Interface (AGI)
- Event notification and CTI integration via the Asterisk Manager Interface (AMI).
- Speech synthesis (aka “text-to-speech”) in various languages and dialects using third party engines.
- Speech recognition in various languages using third party recognition engines.
This combination of components allows an integrator or developer to quickly create voice-enabled applications. Asterisk integrators have built everything from very small IP PBX systems to massive carrier media servers.
Asterisk can be configured as the core of an IP or hybrid PBX, switching calls, managing routes, enabling features, and connecting callers with the outside world over IP, analog (POTS), and digital (T1/E1) connections.
Asterisk runs on a wide variety of operating systems including Linux, Mac OS X, OpenBSD, FreeBSD and Sun Solaris and provides all of the features you would expect from a PBX including many advanced features that are often associated with high end (and high cost) proprietary PBXs. Asterisk’s architecture is designed for maximum flexibility and supports Voice over IP in many protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware.
If you are not an advanced user of Asterisk, we highly recommend the use of one of GUI interfaces of Asterisk for SIP Configuraiton.
There are several GUI interfaces for Asterisk that simplify installation of Asterisk. These interfaces allow administrators to view, edit, and change most aspects of Asterisk via a web interface.
You can download free GUI versions of Asterisk from one the below links below:
While our goal is to make all Bring Your Own Device installations as easy as possible, this option is intended for advanced users. VoiceTrunking does not provide technical support for Asterisk SIP Configuration.
Below you can find Asterisk SIP Trunk configuration guide for VoiceTrunking SIP Trunk service.
Peer Details
username=5551231234 (your VoiceTrunking account assigned while signing up)
type=peer
secret=XXXXX (your VoiceTrunking password)
nat=auto
insecure=very
host=sip.VoiceTrunking.com
fromuser=5551231234
(your VoiceTrunking SIP account assigned while signing up)
fromdomain=sip.VoiceTrunking.com
dtmfmode=rfc2833
disallow=all
allow=g729
allow=ilbc
allow=ulaw
allow=alaw
USER Details
username=5551231234
(your VoiceTrunking SIP account assigned while signing up)
type=user
secret=XXXXXX (your VoiceTrunking password)
nat=auto
insecure=very
host=sip.VoiceTrunking.com
fromdomain=sip.VoiceTrunking.com
dtmfmode=rfc2833
disallow=all
context=from-trunk
allow=g729
allow=ulaw
allow=alaw
allow=ilbc
5551231234:XXXXXXXX@sip.voicetrunking.com/55551231234
(for 5551231234 use your VoiceTrunking SIP account and for XXXXXXXX use your VoiceTrunking password)
NOTE: Asterisk does not support DNS SERVER lookups for inbound calls.
If you also have virtual phone number with your SIP Trunk service please add the following line to the “sip_general_custom.conf” file
srvlookup=no
Copied from: http://www.voicetrunking.com/asterisk-sip/
Cheers!
Read( ) 作用:读取来自主叫的DTMF按键输入并将其结果分派给一个指定的变量。
语法:
Read(variable,[, filename[, maxdigits[,option[,attempts[,timeout]]]]])
从用户读取一个(串)以#结尾的数字(数字串)并将其存入一个指定的变量variable.
其他的参数包括:
filename: 在读取按键输入之前播放的文件。类似于Background(welcome)里头的welcome.
maxdigits: 设置可以接受的按键的位数。如果指定了这个参数,那么系统会停止读取maxdigits后面的按键输入(无需用户按#键)。该参数默认值为0(表示没有限制,等待用户按#键),任何小于0的值均被视为0. 最大可以接受的位数是255.
option:
s: 如果线路没有被应答时就快速返回.
i: 解释播放的文件并将其作为在indications.conf里设置的指示音.
n: 读取按键输入即便线路没有被应答.
attempts:如果大于1,而且没有任何按键输入的情况下,则进行多次的尝试。
timeout: 如果大于0, 则该值将覆盖掉默认超时时间.
实例1:
;读取两个数字输入并将其重复给主叫
exten =>123,1, Read(NUMBER,,2)
exten =>123,2, SayNumber(${NUMBER})
exten =>123,3, Goto(1)
———————————————-
实例2:
exten =>s, 1, Read(digits,welcome, 2,,3,5)
exten =>s,n,SayDigits(${digits})
exten =>s,n,Hangup()
在这个实例里,将DTMF输入保存到变量digits,welcome为用户输入DTMF按键前听到的语音文件.2表示可以接受两个数字的输入,但按完第一个数字按键后必须按#结尾,然后再按第二个数字按键. 中间的,,之间滞空.如果用户在不按任何按键输入时,该过程循环三遍。如果在5秒内没有任何按键动作将会提示超时.
第二行的意思是如果用户有按键动作,则将保存在digits里面的内容将会被读出给用户.
第三行的意思是挂机.
实例3:
如果在按键输入前,有多个语音文件需要播放。此时可以用&符号将它们连起来。如:
exten =>s,1,Read(Digits, welcome&enter-your-digit(s),2,,3,5)
exten =>s,n,SayDigits(${Digits})
exten =>s,n,Hangup()
以上为个人理解,仅供参考!
Cheers!
MixMonitor()–录当前通道的声音,但在它被写入一个文件前将其混合.
MixMonitor(fileprefix.format[, options[,command]])
开始录当前通道的声音。与Monitor不同的是,Monitor用两个独立的文件来录每个方向的声音.而MixMonitor却是自动地将两个方向的语音流混合在一起并将这个混音体写进到一个指定的文件.
Options:选项
a 追加语音流到一个现有的文件.
b 当通道被桥接成功了,将保存录音保存到一个文件中.例如:一旦一则对话事实上已经启动(过滤掉前面一段振铃音),直至通话结束为止.
v(x) –通过一个增幅(范围-4到4)调节听筒音量.
V(x)–通过一个增幅(范围-4到4)调节话筒音量.
W(x) –通过一个增幅(范围-4到4)调节听筒和话筒的音量.
实例参考:
[from-internal]
exten =>_X.,1,MixMonitor(voipevents.wav,b)
exten=>_X.,n,Dial(DAHDI/g0/{EXTEN})
exten=>_X.,n,Hangup()
示例将外呼的双向(rx,tx)语音叠加成一个名为voipevents.wav的语音文件.语音文件从通话正式建立(正式桥接应答成功,去掉前期的DTMF和振铃音)开始,直至通话结束为止.
以上为个人理解,仅供参考.
详细情况请参考:
http://www.voip-info.org/wiki/view/MixMonitor
Cheers!