SEMS application development tutorial
SEMS
程序开发指南
免责:下面的文字是自己研究时笔记,对错不负责任:)转载请注明 MWG_arden 2007
Short description:
简述
this tutorial explains how to write SEMSi applications, both in C++ and (using the IVRi) in Python. All examples are available with their complete sources.
this tutorial explains how to write SEMSi applications, both in C++ and (using the IVRi) in Python. All examples are available with their complete sources.
此指南展示如何用
C++
或
Python
编写
SMES
应用程序。所有的例子都有完整的代码可以利用。
Steps:
步骤
The tutorial consists of the pdf document and the sources of the examples. In "semsi-tutorial-apps.tgz" all examples are contained, in "sems-tutorial-app-xxx" only one module. "ccard_wav.tgz" is an archive with sample announcements for the calling card application.
指南包括一份
pdf
文档和示例的代码。在
"semsi-tutorial-apps.tgz"
中包含了所有的示例,在
"sems-tutorial-app-xxx"
中只包含
”xxx”
模块。
"ccard_wav.tgz"
是
calling card
应用程序需要的声音文件。
We will download SER and SEMS, add the applications from the howto and start SER and SEMS from their source directories. If you install SER/SEMS using make install you will have to adapt the paths in the configuration files.
我们需要下载
SER
和
SEMS
,添加应用程序并从
SER
和
SEMS
的代码目录启动它们。如果安装
SER/SEMS
时使用了
”make install”
,你需要修改配置文件中的一些目录。
We will place SER and SEMS source trees under /usr/local/src, make sure that you have the appropriate rights to create files there.
我们将
SER
和
SEMS
代码树放在
under /usr/local/src
目录下,请确认你使用的用户拥有此目录建立文件的权限。
We will use two SER instances: one, at port 5060, will be the home proxy, and one, at port 5070, will be the SIPi stack of SEMS. The SER/SEMS combination at port 5070 acts just like another UA.
我们将使用两个
SER
实例:一个监听
5060
端口,做为本地代理,另一个监听
5070
端口,做为
SEMS
的
SIP
栈。
SER/SEMS
绑定在
5070
端口,扮演用户代理
(UA)
的角色。
Download and make SER 0.9.6
下载并编译
SER 0.9.6
译注:下面都是命令,我只大概介绍命令的作用
cd /usr/local/src
进入
/usr/local/src
目录
cvs -d :pserver:anonymous@cvs.berlios.de:/cvsroot/seri co -r rel_0_9_0 -d ser-0.9.6 sip_router 从 CVS 上下载源代码
cd ser-0.9.6 ; make ; make modules 进入源代码目录并编译
cvs -d :pserver:anonymous@cvs.berlios.de:/cvsroot/seri co -r rel_0_9_0 -d ser-0.9.6 sip_router 从 CVS 上下载源代码
cd ser-0.9.6 ; make ; make modules 进入源代码目录并编译
Download SEMS
下载SEMS
我们可以使用
0.10.0
版的源码包或者从
SVN
直接签出
Either we use the tarball of 0.10.0 rc1
cd /usr/local/src ; 到目录
wget ftp://ftp.iptel.org/pub/sems/sems-0.10.0_rc1.tar.gz ; 下载源码包
tar xzvf sems-0.10.0_rc1.tar.gz ; mv sems-0.10.0_rc1 ; sems-0.10.0 解包,改目录名。 mv sems-0.10.0_rc1 ; sems-0.10.0 应该去掉中间的 ”;”
or we checkout trunki SEMS from SVN:
cd /usr/local/src ; 到目录
svn checkout http://svn.berlios.de/svnroot/repos/sems/trunk ; 从 SVN 签出
mv trunk sems-0.10.0 修改目录名
cd /usr/local/src ; 到目录
wget ftp://ftp.iptel.org/pub/sems/sems-0.10.0_rc1.tar.gz ; 下载源码包
tar xzvf sems-0.10.0_rc1.tar.gz ; mv sems-0.10.0_rc1 ; sems-0.10.0 解包,改目录名。 mv sems-0.10.0_rc1 ; sems-0.10.0 应该去掉中间的 ”;”
or we checkout trunki SEMS from SVN:
cd /usr/local/src ; 到目录
svn checkout http://svn.berlios.de/svnroot/repos/sems/trunk ; 从 SVN 签出
mv trunk sems-0.10.0 修改目录名
Download the tutorial's applications
下载指南示例程序
cd /usr/local/src/sems-0.10.0/apps ;
到目录
wget http://www.iptel.org/files/sems-tutorial-apps.tgz ; 下载
tar xzvf sems-tutorial-apps.tgz ; rm sems-tutorial-apps.tgz 解包,删除原始包
wget http://www.iptel.org/files/sems-tutorial-apps.tgz ; 下载
tar xzvf sems-tutorial-apps.tgz ; rm sems-tutorial-apps.tgz 解包,删除原始包
Make SEMS
编译SEMS
cd /usr/local/src/sems-0.10.0/ ;
到目录
make 编译
ignoring (for the moment) some error messages complaining about mp3/lame,python or flite.h not found.
make 编译
ignoring (for the moment) some error messages complaining about mp3/lame,python or flite.h not found.
忽略掉一些
mp3/lame
、
python
及没找到
flite.h
的错误消息
Download the sample configuration files for the tutorial
下载示例配置文件
A set of sample configuration files for SER and SEMS is available for this tutorial.
这里有一些用于本文的
SER/SEMS
示例配置文件
cd /usr/local/src ; wget http://www.iptel.org/files/sems-tutorial-config.tgz;
tar xzvf sems-tutorial-config.tgz 到目录;下载;解包;
tar xzvf sems-tutorial-config.tgz 到目录;下载;解包;
Download the sample wave file set for the cc application
下载cc程序的示例声音文件
cd /usr/local/src/sems-tutorial-config ; wget http://www.iptel.org/files/ccard_wav.tgz;
tar xzvf ccard_wav.tgz 到目录;下载;解包;
tar xzvf ccard_wav.tgz 到目录;下载;解包;
Start SER home proxy
启动SER本地代理
We will start one SER at port 5060, that will forward all calls that come to a number starting with 1 to "localhost:5070".
我们在端口
5060
启动一个
SER
,它将所有开头为
1
的呼叫传给
"localhost:5070"
cd /usr/local/src/ser-0.9.6 ; ./ser -f ../sems_tutorial_config/ser_main.cfg
到目录;启动
ser
配置文件为
../sems_tutorial_config/ser_main.cfg
Start SER for SEMS
启动用于SEMS的SER
The second SER at port 5070, will forward all calls to SEMS.
第二个
SER
监听端口
5070
,它将所有呼叫传给
SEMS
cd /usr/local/src/ser-0.9.6 ; ./ser -f ../sems_tutorial_config/ser_sems.cfg
到目录;启动
ser
配置文件为
../sems_tutorial_config/ser_sems.cf
Start SEMS
启动SEMS
cd /usr/local/src/sems-0.10.0/core ; ./sems -f ../../sems_tutorial_config/sems.conf
到目录;启动
SEMS
配置文件为
../../sems_tutorial_config/sems.conf
The SEMS configuration is set to no-forki and debug, such that we can follow all debug logging of SEMS.
SEMS
配置文件设置为
no-fork
及
debug
,我们可以跟踪到所有
debug
信息
Try out the applications
尝试这些程序
Now we can try out the applications by calling the numbers 101, 102, 103, ...
现在我们可以通过呼叫号码
101, 102, 103, ...
来试验一下这些应用程序,下面是号码对应的程序
101
|
myapp
|
102
|
myconfigurableapp
|
103
|
myannounceapp
|
104
|
myjukebox
|
105
|
mycc
|
106
|
ivr_announce
|
110
|
echo
|
111
|
announcement
|
112
|
conference
|
113
|
mailbox
|
114
|
early_announce
|
115
|
voicemail
|
Notes:
注意
- default ivr script path is set to ivr_announce source dir, change this in ivr.conf if you want to try other python apps (mailbox, or your own scripts)
默认的
ivr
脚本路径设置为
ivr_announce
代码目录,如果你想尝试其他
python
程序如
mailbox
,可以在
ivr.conf
修改这个设置。
- If the ivr doesnt want to build, you probably have to set the python path prefix,version and no TTS/flite path in apps/ivr/Makefile.defs (see doc/COMPILING)
如果不想建立
ivr
,你需要在
apps/ivr/Makefile.defs
中设置
python
路径前缀,版本及
no TTS/flite
。
Have Fun!
玩的开心
……..
Attachment
附件
|
Size
大小
|
161 KB
| |
6.96 KB
| |
1.25 KB
| |
1.19 KB
| |
606 bytes
| |
1.21 KB
| |
787 bytes
| |
3.1 KB
| |
1.14 KB
| |
1.35 KB
| |
295.77 KB
| |
3.47 KB
|