20070202 sourceinsight TabSiPlu
http://www.yippeesoft.com/
在windows下写程序的朋友好像很少有离开VC编辑环境的勇气,其实如果花点时间,用类sourceinsight的代码编辑器 + make工具功能非常强大,特别是代码规模越大越能显示它们的威力。能够让微软花钱买来用的软件不多,sourceinsight是在rational公司的工具外我见到的一个让微软这么做的工具了。
一、界面
附件是source insight网站上的一个界面图,主窗口就不介绍了,介绍一下其它三个窗口:
1、Symbol Window:最左边的是Symbol Window,是对当前打开文件的一个简单索引,当前文件的所有关键内容:包括函数和对象的生命,定义,宏定义等在这里都会有一个索引,可以通过在上面的输入窗口中输入内容进行快速选择和跳转。
2、Relation Window:现实当前对象的调用关系图,可以双击该图中的任意一个筐快速跳转。
3、Contex Window:偶认为这个窗口的功能应该是source insight最主要的优点之一了,它把主窗口中当前焦点所在关键字的内容现实在这个窗口中,可以在这里直接查看或者进行跳转。这样我们查看宏定义、简单的函数、变量定义等就不需要跳来跳去了:)
另外还有两个窗口:clipwindow(剪贴板窗口)偶很少使用,project window一般平时也不打开,避免占用屏幕,在打开文件(File->Open)时这个窗口会自然弹出。
二、使用过程
1、创建工程:单个文件或文件比较少的时候可以直接打开,不过那样实际上完全没必要动用source insight了:)。 project->new project…创建新工程,在按照提示选择并保存好工程文件后进入可以开始添加文件,可以一个个添加、添加当前目录下的所有文件、或者添加整个目录(包含子目录)。创建好的工程自动打开,后面也可以通过project->open project在列表中选择(已创建工程自动出现在工程列表中,不需要一个一个目录找)。
2、同步工程:对于刚创建的工程,最好通过project->synchronize project同步一遍,这个过程实际上时source insight对整个工程创建关键字索引的过程,对于快速的自动跳转很重要,好像有见到介绍说shource insight的跳转很慢,估计就是没有进行同步的原因。
建好了工程就可以开始使用了:),按ctrl+O打开一个文件, 就可以开始体验source insight的强大功能了,除了主菜单外,右键的弹出菜单里面还有不少好东西,记得多试用几个,找出自己喜欢的。
TaiSiPlus For Source Insight外挂使用帮助
安装、使用TabSiPlus
本软件不需要安装,将tabsiplus.zip解压缩到任意文件夹中,然后运行 TabSiHost.exe 即可 。
卸载、删除TabSiPlus
首先中止TabSiHost.exe ,可以在外挂运行期间选择“退出外挂”菜单命令结束TabSiPlus.exe,也可以使用命令行:
TabSiPlus.exe /r 结束TabSiHost.exe,然后关闭所有的Source Insight,最后删除所有相关文件即完成删除。
设置标签栏颜色
在外挂运行期间选择“选项”菜单命令,切换到“标签栏选项”标签页。
设置菜单颜色
在外挂运行期间选择“选项”菜单命令,切换到“一般选项”标签页。
C/C++文件切换功能
要使用完整的文件切换功能,需要设置文件切换的搜索路径列表,在外挂运行期间选择“选项”菜单命令,切换到“文件切换选项”标签页即可设置搜索路径,在文件切换的时候将按照这个路径列表去搜索对应的头文件(.H)和实现文件(.CPP)。
TabSiPlus 0.99b2 介绍
Download TabSiplus
“TabSiPlus”的主要功能就是给“Source Insight”添加一个文件切换标签栏,这个切换标签栏对于使用“Source Insight”编写代码的人有很大的帮助,先看一些它都给“Source Insight”带来了哪些变化:
代码窗口下面多了一个文件标签栏,菜单也变样了,还加上了几个图标,其实菜单的底色和文字颜色都是可以改变的,文件标签栏的颜色也是可以改变的,看看:
除此之外,还添加了C/C++文件翻转的功能,这个可是VA的常用功能,相信大家都不陌生,这个C/C++文件翻转功能继承了“Tabbar for Visual C++”插件的多目录、多扩展名搜索功能:
作者tag:dll orbit的开源软件 程序设计与软件工程 外挂 综合 getprocaddress loadlibrary readprocessmemory writeprocessmemory createremotethread virtualallocex virtualfreeex source insignt 代码注入
给Source Insight做个外挂系列之二--将本地代码注入到Source Insight进程
由于Source Insight实质上是一个支持多种开发语言(java,c ,c++等等)的编辑器,只不过由于其查找、定位、彩色显示等功能的强大,而被我们当成源代码阅读工具使用。所以,为了有效的阅读源程序,首先必须选择功能菜单上的 “Project”选项的子菜单“New Project”新建一个项目,项目名称可以自由选定,当然也可以选择删除(Remove)一个项目。当删除一个项目的时候,并不删除原有的源代码文件,只是将该软件生成的那些工程辅助文件删除。设定之后,将会弹出一个对话框如图2,接受默认选择,如果,硬盘空间足够,可以将第一个复选框选上,该选项将会需要与源代码大致同等的空间来建立一个本地数据库以加快查找的速度。
图2 工程设置
点击“OK”按钮,接受选择后,将会有一个新的对话框弹出,在这个对话框里,可以选择将要阅读的文件加入工程,一种方式是通过在File Name中输入要阅读源代码文件的名称,点击“Add”按钮将其加入,也可以通过其中“Add All”和“Add Tree”两个按钮可以将选中目录的所有文件加入到工程中,其中“Add All”选项会提示加入顶层文件和递归加入所有文件两种方式,而“Add Tree”相当于“Add All”选项的递归加入所有文件,可以根据需要使用,就我来说,更喜欢“Add Tree”一些。由于该程序采用了部分打开文件的方式,没有用到的文件不会打开,所以,加入数千个文件也不用担心加入的文件超出程序的所能容忍的最大值,我就是采用“Add Tree”的方式将Linux2.4内核的四千五百九十一个文件加入的。
图3 添加文件
加入文件后,点击一个文件,可以出现使用界面,如图4所示,其中,右边的那个窗口(Linux Project,即工程窗口)缺省按照字母顺序列出当前工程中所有的文件。
图4 工作窗口
点击一个文件就可以打开该文件,显示如图5所示,进入到右边的那个窗口分别可以以文件列表的方式,列出所有的文件,每个窗体下边有一排按钮,左边的窗口(21142.c)从左至右分别为:按字母顺序排列所有标记、按照文件中行数顺序排列标记、按照类型排列标记、浏览本地文件标记、标记窗口属性。右边的窗口(Linux Project)从左至右分别为:按字母顺序文件列表、显示文件夹、按照文件类型归类文件、全部文件的所有标记列表、按照标记类型归类标记、跳转到定义处、显示标记信息、浏览工程标记、查找函数调用、工程属性,其中全部文件的所有标记列表选项可能要一段时间抽取标记,同步到数据库去,如果开始选择了建立标记数据库,将会在今后节省同步时间,最有用的莫过于浏览标记信息和查找函数调用,前者可以通过“Jump”按钮在不同的地方查找同样的标志,还可以通过“Reference”按钮结合后者进行全局的标记查找。
Reference功能是Source Insight的特色之一,它可以在速度极快的在整个工程中找到所有的标记,并且在该行程序的前边加上红色箭头的小按钮链接上。图6是一个Reference搜索后的结果,它可以有两种模式,一种集中显示结果,图6显示的就是这种模式,在这种模式下,可以通过前边的红色箭头小按钮进入另外一种模式,该标记的具体的所在处,也可以通过标记的具体所在处点击红色箭头小按钮进入警种模式,还可以通过工具条上的两个红色小箭头直接在第二种模式下前后移动,察看相应信息。它的这个强大的功能使得阅读Linux源程序有如神助。但是要注意的是,当进行了第二次“Reference”时,它会提示你将结果集附加在第一个结果集的后边还是取代第一个结果集。如果选择前者,不能对结果集根据前后两次搜索结果进行分类,然后在其子类里进行移动,只能在整个结果集里移动;如果,选择后者,结果集将会被替换为第二次搜索的结果,略微有些不方便。
图6 Reference的搜索结果
当然,Source Insight 还提供了一些其他常见的便利。比如:右键菜单几乎包含了程序的所有功能,可以在编辑窗口为程序加上行号,还可以统计整个工程的程序行数,当然还有功能强大却用不上自动完成功能,
a
1130 asterisk tapi sip asttapi 3
Once installed and rebooted you need to ensure that you have a Asterisk Manager account setup, this is done on the Asterisk server, in your Asterisk configuration directory there is a file manager.conf, you need to add a line for every user who wants to log onto the server in this fashion.
An excerpt of my manager.conf
;
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[nick]
secret = mysecret
permit = 10.20.1.0/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
When you reload then the Asterisk manager will be available to the network.
Next configuring the TAPI driver, this has to be done from your TAPI application – I use Outlook so for the purpose of getting up and running will explain my steps.
In Outlook go into your contacts folder. Right click one of your contacts and select “call contact”. The window which appears now has fields filled in with which number to call and the name of the contact. Select the button for "dialling options" underneath this, and when this window appears at the bottom there should be “Connect using line” use the pull down list to select “Asterisk”, then you can select “Line Properties”, here we need to fill out a few fields.
Host – this is the host name or IP address of the server running the Asterisk manager
Port – 5038 – default
User – the user you set-up in manager.conf
Password – the users secret you set-up in manager.conf
User Channel – this is the your extension, it terms of the channel name in my case it is Sip/nick
Outgoing Chan – this is the channel which external calls are placed over, you can get this information from extensions.conf, in here you will find a section which defines external calls, in the top of my file I have “TRUNK=CAPI/870582:” AstTAPI will use this and append the number to the end of this channel to place the call. In my case I place “CAPI/870582:” into this field.
host SIP SRV
PORT 5038
USER SF
PWD SF
USER CHANNEL SIP/8560
LINE NAME [hide] [/hide]
dial by context
context from-internal
callerid 8560
attenmpt to set outgoing id
dial out bu using the dial application
outgoing channel
exten => s,1,UserEvent(TAPI&line;TAPIEVENT: LINE_NEWCALL $&leftsign;ARG2&rightsign;)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_OFFERING)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: SET CALLERID $&leftsign;CALLERID&rightsign;)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLINFO LINECALLINFOSTATE_CALLERID)
exten => s,n,Dial($&leftsign;ARG2&rightsign;,20,rtM(tapi^$&leftsign;UNIQUEID&rightsign;&line;$&leftsign;ARG2&rightsign;))
exten => s,n,Goto(s-$&leftsign;DIALSTATUS&rightsign;,1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
;exten => s,104,Goto(s-BUSY,1)
exten => s-NOANSWER,1,Voicemail(u$&leftsign;ARG1&rightsign;) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(b$&leftsign;ARG1&rightsign;) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain($&leftsign;ARG1&rightsign;) ; If they press *, send the user into VoicemailMain
exten => h,1,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_IDLE)
To initiate screen popping (which by the way Outlook on its own is not capable of) you also need to enter the line name. The line name is the identifier which we recognize the call is intended for us. The line name has to be placed into the dial plan.
The line name could be a string you define yourself to track calls, or it could be something like the channel name. Using the channel name you could use string formatting in Asterisk to handle a lot of users simply.
The dial plan is now used to signal TAPI events, there were several reasons for this:
Different applications required different events – it is a very open standard!
It is quite difficult to map manager events effectively to TAPI events
It simplifies the TSP enormously, now it doesn’t have to track the state of a call, this is now only handled in one place – in Asterisk
We use the UserEvent function of Asterisk to signal the event to our TAPI driver. The event takes on the form
UserEvent(TAPI&line;TAPIEVENT: <event data>)
The event data is recognisable to any TAPI programmer. We use the following events to signal a new inbound call to the application:
LINE_NEWCALL line_1
LINE_CALLSTATE LINECALLSTATE_OFFERING
SET CALLERID $&leftsign;CALLERID&rightsign;
LINE_CALLINFO LINECALLINFOSTATE_CALLERID
The phone rings for a while (note the line_1 is the identifier which is configured in AstTapi)
LINE_CALLSTATE LINECALLSTATE_CONNECTED
You talk for a while
LINE_CALLSTATE LINECALLSTATE_HANGUP
LINE_CALLSTATE LINECALLSTATE_IDLE
A word about LINE_NEWCALL
LINE_NEWCALL has extra meaning in AstTapi. In normal TAPI it should only ever be presented when a new call comes in that the TAPI application does not now about. The AstTapi TSP filters this, so that if it is received regarding calls the application initiated we will filter it out. This is intended to make the dial plan slightly simpler to implement.
AstTapi also uses this event, to track calls with, once it receives this event it uses Asterisk’s unique id’s to track the call.
It also uses the event LINE_CALLSTATE LINECALLSTATE_IDLE to remove this call from its list of calls to track. If you do not enter this into the dial plan, then not only is your application not going to now when the line is idle again, but also you will have a slow memory leak in the TSP as it will not know when to free memory allocated to a call initiated earlier.
A word about LINE_CALLSTATE LINECALLSTATE_CONNECTED
This event tells the TAPI application that the call is connected. But from a dial plan point of view is quite tricky to get in a place when the call is truly connected. We also have to manage calls which are one to many, that is 1 call comes in and 2 phones ring. For example we may have in our dial plan
exten => 100,1,dial(sip/bob&sip/bobbett)
First off we handle sending the LINECALLSTATE_CONNECTED event in this fashion:
exten => 100,1,dial(sip/bob&sip/bobbett&line;&line;M(tapi^$&leftsign;UNIQUEID&rightsign;))
We have to pass the unique ID across to the macro which is called when the call is connected, as the macro is run as the second leg of the call which has a new unique id.
[macro-tapi]
exten => s,1,UserEvent(TAPI&line;TAPIEVENT: [~$&leftsign;ARG1&rightsign;&sip/bob] LINE_CALLSTATE LINECALLSTATE_CONNECTED)
exten => s,1,UserEvent(TAPI&line;TAPIEVENT: [~$&leftsign;ARG1&rightsign;&!sip/bob] LINE_CALLSTATE LINECALLSTATE_HANGUP)
You will note a few things here:
Our TAPI events are sent by way of a specially formatted UserEvent
We can simply send the TAPI command, and AstTapi will track the call for you
Or we can signal AstTapi which call it is referring to
We can also describe which line we intend the call for if the call is being tracked by a number of lines.
After the TAPI&line;TAPIEVENT string we can optionally place a [] which the contents take on the format:
If the character ‘~’ is used the string following it is the Asterisk unique ID we intend the signal for (by default AstTapi traces the Asterisk unique ID generated when the NEWCALL is signalled).
Any string which is a line identifier means that this TAPI event is specifically for that line.
Any string proceeded by a ‘!’ means that this event is specifically excluded for that line (and by default intended for all others if a line is not specified – see the previous comment).
We can have multiple definitions here which are separated by the ‘&’ character.
Putting it all together
For inbound calls we will extend the standard extension macro to include our TAPI events
[macro-tapi]
exten => s,1,UserEvent(TAPI&line;TAPIEVENT [~$&leftsign;ARG1&rightsign;&sip/bob] LINE_CALLSTATE LINECALLSTATE_CONNECTED)
exten => s,1,UserEvent(TAPI&line;TAPIEVENT [~$&leftsign;ARG1&rightsign;&!sip/bob] LINE_CALLSTATE LINECALLSTATE_HANGUP)
[macro-stdexten]
;Our TAPI events
exten => s,1,UserEvent(TAPI&line;TAPIEVENT: LINE_NEWCALL $&leftsign;ARG3&rightsign;)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_OFFERING)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: SET CALLERID $&leftsign;CALLERID&rightsign;)
exten => s,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLINFO LINECALLINFOSTATE_CALLERID)
;The normal macro
exten => s,n,Dial($&leftsign;ARG1&rightsign;,20,TM(tapi^$&leftsign;UNIQUEID&rightsign;))
exten => s,2,Goto(s-$&leftsign;DIALSTATUS&rightsign;,1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,Voicemail(u$&leftsign;ARG1&rightsign;) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start
exten => s-BUSY,1,Voicemail(b$&leftsign;ARG1&rightsign;) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start
exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer
exten => a,1,VoicemailMain($&leftsign;ARG1&rightsign;) ; If they press *, send the user into VoicemailMain
We also have to remember to have the ‘h’ extension in the context the call came in on:
exten => h,1,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_IDLE)
We also have to remember that Outlook and other diallers expect to see events to know about the progress of the call they have requested. Here we have to modify the way outgoing calls are made:
[trunklocal]
;
; Local seven digit dialling accessed through the trunk interface
;
exten => _9NXXXXXX,1,UserEvent(TAPI&line;TAPIEVENT: LINE_NEWCALL line_1)
exten => _9NXXXXXX,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_DIALTONE)
exten => _9NXXXXXX,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_DIALING)
exten => _9NXXXXXX,n,UserEvent(TAPI&line;TAPIEVENT: LINE_CALLSTATE LINECALLSTATE_PROCEEDING)
exten => _9NXXXXXX,1,Dial($&leftsign;TRUNK&rightsign;/$&leftsign;EXTEN:$&leftsign;TRUNKMSD&rightsign;&rightsign;&line;&line;M(tapi^$&leftsign;UNIQUEID&rightsign;))
Notes:
Because the TSP filters the LINE_NEWCALL event, this means this can be used in the situation where either the TAPI application initiates the call, or if it is a call which is initiated by the actual phone
Remember this must also pick up on the ‘h’ extension to signal when the call is idle again
1129 asterisk tapi sip asttapi 2
Asterisk Call Manager/1.0
Action: Login
UserName: sf
Secret: sf
Response: Success
Message: Authentication accepted
Action: Originate
Channel: SIP/8560
Exten: 8558
Priority: 1
Context: from-internal
Response: Success
Message: Originate successfully queued
Event: Newchannel
Privilege: call,all
Channel: SIP/8560-9651
State: Down
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1164111462.8
Event: Newcallerid
Privilege: call,all
Channel: SIP/8560-9651
CallerID: <Unknown>
CallerIDName: <Unknown>
Uniqueid: 1164111462.8
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newchannel
Privilege: call,all
Channel: SIP/8560-9651
State: Ringing
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1164111462.8
Event: ExtensionStatus
Privilege: call,all
Exten: 8560
Context: ext-local
Status: 8
Event: Newstate
Privilege: call,all
Channel: SIP/8560-9651
State: Up
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1164111462.8
Event: ExtensionStatus
Privilege: call,all
Exten: 8560
Context: ext-local
Status: 1
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: from-internal
Extension: 8558
Priority: 1
Application: Macro
AppData: exten-vm&line;novm&line;8558
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 1
Application: Macro
AppData: user-callerid
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-user-callerid
Extension: s
Priority: 1
Application: DBget
AppData: AMPUSER=DEVICE//user
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-user-callerid
Extension: s
Priority: 2
Application: DBget
AppData: AMPUSERCIDNAME=AMPUSER//cidname
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-user-callerid
Extension: s
Priority: 3
Application: GotoIf
AppData: 1?5
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-user-callerid
Extension: s
Priority: 5
Application: NoOp
AppData: Using CallerID
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 2
Application: SetVar
AppData: FROMCONTEXT=exten-vm
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 3
Application: Macro
AppData: record-enable&line;8558&line;IN
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-record-enable
Extension: s
Priority: 1
Application: GotoIf
AppData: 0 > 0?2:4
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-record-enable
Extension: s
Priority: 4
Application: AGI
AppData: recordingcheck&line;20061121-201745&line;1164111462.8
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-record-enable
Extension: s
Priority: 5
Application: NoOp
AppData: No recording needed
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 4
Application: DBget
AppData: forwardValue=CFNA/8558
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 5
Application: NoOp
AppData:
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 6
Application: GotoIf
AppData: 1?s&line;10:s&line;7
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 10
Application: Set
AppData: TESTTIMER=45
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-exten-vm
Extension: s
Priority: 11
Application: Macro
AppData: dial&line;45&line;tr&line;8558
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-dial
Extension: s
Priority: 1
Application: GotoIf
AppData: 0?4:2
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-dial
Extension: s
Priority: 2
Application: GotoIf
AppData: 0?5:4
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-dial
Extension: s
Priority: 4
Application: AGI
AppData: dialparties.agi
Uniqueid: 1164111462.8
Event: Newexten
Privilege: call,all
Channel: SIP/8560-9651
Context: macro-dial
Extension: s
Priority: 10
Application: Dial
AppData: sip/8558&line;45&line;tr
Uniqueid: 1164111462.8
Event: Newchannel
Privilege: call,all
Channel: SIP/8558-0c38
State: Down
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1164111466.9
Event: Dial
Privilege: call,all
Source: SIP/8560-9651
Destination: SIP/8558-0c38
CallerID: <unknown>
CallerIDName: <unknown>
SrcUniqueID: 1164111462.8
DestUniqueID: 1164111466.9
Event: Newcallerid
Privilege: call,all
Channel: SIP/8558-0c38
CallerID: 8558
CallerIDName: <Unknown>
Uniqueid: 1164111466.9
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newchannel
Privilege: call,all
Channel: SIP/8558-0c38
State: Ringing
CallerID: 8558
CallerIDName: <unknown>
Uniqueid: 1164111466.9
Event: ExtensionStatus
Privilege: call,all
Exten: 8558
Context: ext-local
Status: 8
Event: Newstate
Privilege: call,all
Channel: SIP/8558-0c38
State: Up
CallerID: 8558
CallerIDName: <unknown>
Uniqueid: 1164111466.9
Event: Link
Privilege: call,all
Channel1: SIP/8560-9651
Channel2: SIP/8558-0c38
Uniqueid1: 1164111462.8
Uniqueid2: 1164111466.9
CallerID1: (null)
CallerID2: 8558
Event: ExtensionStatus
Privilege: call,all
Exten: 8558
Context: ext-local
Status: 1
Event: Unlink
Privilege: call,all
Channel1: SIP/8560-9651
Channel2: SIP/8558-0c38
Uniqueid1: 1164111462.8
Uniqueid2: 1164111466.9
CallerID1: (null)
CallerID2: 8558
Event: Hangup
Privilege: call,all
Channel: SIP/8558-0c38
Uniqueid: 1164111466.9
Cause: 16
Cause-txt: Normal Clearing
Event: ExtensionStatus
Privilege: call,all
Exten: 8558
Context: ext-local
Status: 0
Event: Hangup
Privilege: call,all
Channel: SIP/8560-9651
Uniqueid: 1164111462.8
Cause: 16
Cause-txt: Normal Clearing
Event: ExtensionStatus
Privilege: call,all
Exten: 8560
Context: ext-local
Status: 0
== Manager \’sf\’ logged off from 192.168.35.151
== Parsing \’/etc/asterisk/manager.conf\’: Found
== Parsing \’/etc/asterisk/manager_custom.conf\’: Found
== Connect attempt from \’192.168.35.151\’ unable to authenticate
== Parsing \’/etc/asterisk/manager.conf\’: Found
== Parsing \’/etc/asterisk/manager_custom.conf\’: Found
== Manager \’sf\’ logged on from 192.168.35.151
— Attempting native bridge of SIP/8560-9651 and SIP/8558-0c38
== Spawn extension (macro-dial, s, 10) exited non-zero on \’SIP/8560-9651\’ in macro \’dial\’
== Spawn extension (macro-dial, s, 10) exited non-zero on \’SIP/8560-9651\’ in macro \’exten-vm\’
== Spawn extension (macro-dial, s, 10) exited non-zero on \’SIP/8560-9651\’
[hide]== Manager \’sf\’ logged off from 192.168.35.151 [/hide]
标签:api, asterisk, asttapi, sip, tapi1128 asterisk tapi sip asttapi 1
下载:
AstTapi, an opensource Asterisk Tapi driver for windows. This allows users of TAPI compliant applications such as Outlook and Act to dial contacts directly from the application using an Asterisk PBX Server.
http://sourceforge.net/project/showfiles.php?group_id=106482&package_id=114736
运行,安装,装上TSP驱动
修改
;
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[sf] //控制者
secret=sf
deny=0.0.0.0/0.0.0.0
permit=192.168.35.0/255.255.255.0
Read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user
[admin]
secret = amp111
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
#include manager_custom.conf
概念
TAPI通过ASTTAPI TSP 通过SOCKET和服务器5038端口通讯,因此完成一次呼叫控制
本地运行两个客户端
如果直接TELNET服务器AMI端口,输入如下命令即可让双方建立呼叫
Action: Login
UserName: sf
Secret: sf
Action: Originate
Channel: SIP/8560
Exten: 8558
Priority: 1
[hide]Context: from-internal
也就是说TAPI实际上也只是一个控制者,还是需要客户端软件[/hide]
Install the TAPI driver onto your workstation.
To configure it, open your control panel, Phone and Modem Options, Advanced, Select AstTapi, then configure.
You can now enter the host, user name and password as you have just configured above.
Enter the user channel, this is the phone which will get called when you wish to initiate a call – your phone.
Make sure at this point you have the Asterisk manager window running; you can see manager’s logging on and problems which occur here easily.
This is now set up to make calls – from Outlook for example. The application now needs configuring; just choose the Asterisk line in the application.
To initiate screen popping (which by the way Outlook on its own is not capable of) you also need to enter the line name. The line name is the identifier which we recognize the call is intended for us. The line name has to be placed into the dial plan.
The line name could be a string you define yourself to track calls, or it could be something like the channel name. Using the channel name you could use string formatting in Asterisk to handle a lot of users simply.
The dial plan is now used to signal TAPI events, there were several reasons for this:
Different applications required different events – it is a very open standard!
It is quite difficult to map manager events effectively to TAPI events
It simplifies the TSP enormously, now it doesn’t have to track the state of a call, this is now only handled in one place – in Asterisk
We use the UserEvent function of Asterisk to signal the event to our TAPI driver. The event takes on the form
1124 TAPI SIP
Installation:
copy siptapi.tsp into the windows\\system32 directory
ControlPanel PhoneAndModemOptions
Advanced Add SIP TAPI Service Provider
SIP TAPI Service Provider Configure…
configure your username, password, SIP domain and
outboundproxy
debug using Sysinternals DebugView:
TAPI是一套工具的集合,这些工具使得应用程序能够充分利用多种电话和通信服务,而不需要对特定技术拥有详细的知识背景。Windows CE 的TAPI实现方式用于解决外出人员的电话问题,并提供了向外拨号和地址翻译服务。拨入电话当前并不支持。对多拨号地点的支持可由Control Panel完成。为了提供硬件选择上的灵活性,TAPI支持可安装的服务供应器。
SIP TAPI
The SIP TAPI is a TAPI driver, which enables SIP click2dial functionality from TAPI applications (like MS Outlook, Phoner …). The correct term for this application is: A service provider for the MS telephony API.
The work is based on asttapi, a TAPI driver which connects to Asterisk via the manager interface (a telnet connection into Asterisk). I removed all the asterisk/telnet related stuff and replaced it with a SIP stack (eXosip2). Thus, it should work with all SIP based applications (which understand the REFER reqeust).
How does it work?
The SIP TAPI sends an INVITE request to your own SIP phone. When you pick up the phone and the call between the SIP TAPI and your phone is established, the SIP TAPI sends a REFER request to your phone. This REFER request contains the originally called phone number in the Refer-To: header. Thus, your SIP phone will establish a new call to respective phone number. For a detailed howto please refer to the SIPTAPI-Tutorial.
The SIP TAPI is tested with Windows XP SP2 german, Outlook 2003 SP1, MS Visual Studio.NET 7.1, Phoner.de
A TAPI driver for SIP. With this TAPI driver you have a click2dial feature with any TAPI enabled application (e.g. MS Outlook) and any SIP account (e.g. freeworlddialup or iptel.org).
AstTapi, an opensource Asterisk Tapi driver for windows. This allows users of TAPI compliant applications such as Outlook and Act to dial contacts directly from the application using an Asterisk PBX Server.
我想创建一个TSP(Telephony service provider)为Tapi服务,在CreateService()
时参数怎么配置?请指点!
SC_Handle Scmhandle=OpenSCManager();
printf("OpenSCManager Success!\\n");
SC_HANDLE hServiceHandle;
LPCTSTR lpServiceName="anhb";
LPCTSTR lpDispalyName="anhaibo";
dwDesiredAccess=SERVICE_ALL_ACCESS;
DWORD dwServiceType=SERVICE_WIN32_SHARE_PROCESS;
DWORD dwStartType=SERVICE_DEMAND_START;
DWORD dwErrorControl=SERVICE_ERROR_NORMAL;
LPCTSTR lpBinaryPathName="d:\\\\test.exe";
LPCTSTR lpLoadOrderGroup=NULL;
LPCTSTR lpDependencies="TelePhony Service";
LPCTSTR lpServiceStartName=NULL;
LPCTSTR lpPassword=NULL;
hServiceHandle=CreateService(Scmhandle,lpServiceName,
lpDispalyName,dwDesiredAccess,
dwServiceType,dwStartType,
dwErrorControl,lpBinaryPathName,
lpLoadOrderGroup,NULL,
lpDependencies,lpServiceStartName,
lpPassword);
在StartService()出现1075错误
TAPI服务
TAPI服务(tapisrv.exe)将不同服务提供者的电话服务提供者接口(TSPI)提供给使用TAPI的应用程序。应用程序使用特定的服务提供者与特定类型的设备通信。这些服务提供者是在TAPI服务进程中运行的DLLs。无论是标准的还是CoNDIS 广域网微端口驱动程序,都可以使用操作系统提供的服务提供者与用户模式驱动程序通信。
"Tsp"="Unimodem.dll" 串口1 被用于与Modem设备通讯的时候要加载的TSP(TAPI Service provider)DLL
Build instructions:
1. Get the osip2 and eXosip2 sources and build them. If you use the SIP TAPI with Cisco 7960 phones, you have to build with option: -DCISCO_BUG (for details refer to: www.atosc.org/pipermail/public/osip/2005-April/005130.html) I used an very early version of exosip2. Thus, the API may have changed a little bit and you will have to update the exosip function calls in siptapi.
2. download the SIP TAPI sources (from sourceforge)
3. open the siptapi project in Visual Studio.NET: asttapi.sln
4. specify the location of the osip/exosip header fiels and libraries in the siptapi project
5. build the SIP TAPI, you will find it in the Debug/Release folder with the name siptapi.tsp
Windows电话API被称为TAPI。Microsoft公司的TAPI提供单方连接。TAPI的目的是为Window平台提供“个人电话”,它包含在Windows95系统中。
Windows电话是由 Windwos电话 DLL和两个标准组成的。第一个标准是服务提供者接口( SPI)。 SPI被发送给那些希望遵从 W indows电话的硬件生产厂。如果硬件生 产商的产品遵从 SPI,就可以与 Windows电话的 DLL对话。第二个标准被称为应用编程接 口( API),它被发送给编写应用程序的软件开发者。如果这些开发者的软件遵守 API,就 可以利用Windows电话DLL的便利去驱动任何电话设备或遵从SPI的服务。
TAPI动态链接库( TAPI.DLL)在应用和业务提供者之间扮演交通警的角色来完成上述功能。
.动态链接库( DLL)
DLL是Windows操作系统的一个特点,它是可以由多个应用软件动态调用和链接的一 组可执行代码的集合。改变DLL并不影响使用它的应用程序。
2. Windows开放服务结构( WOSA)
Windows电话是 WOSA的一个组成部分。 WOSA应用通过一个单一的系统级接口对信息和网络进行不中断接入为Windows提供了一个框架。前台的应用和后台的服务,只要他 们知道如何与WOSA接口交谈,就不必以各自对方的语言进行交流。
WOSA定义了一个系统级的动态连接库(DLL),为网络提供者,即数据库、e-mail和 PBX等销售商提供公用的进程和功能。应用调用一套公用的系统 API以获得计算资源和服 务,比如数据库接入(ODBC)、消息应用编程接口(MAPI)、市场数据(XRT)以及电话 应用编程接口( TAPI)。客户应用只需要知道如何与 WOSA对话而不必直接与服务提供者 的协议和接口对话。WOSA使用Wind。wsDLL使软件组件可以在运行时相互连接。这使应 用可以与服务动态地连接。由于这一套 API是可以扩展的,因此新的服务及其 API可以根据需要而增加。
客户-服务器 TAPI
由于TAPI独立于网络支撑和连接模型,因此它支持客户一服务器 CTI应用。在实施中, 服务提供者与网络上的电话服务器进行通信而该服务器一般通过一条 CTI链路与 PBX对话。 此应用不知道电话服务是如何完成的,只知道哪些功能是由业务提供者支持的。
标签:api, sip, tapi, 资料0424 sip 呼叫保持 Call Hold
4.3.5 呼叫保持Call Hold
通话时,按下HOLD 按钮将使当前通话保持.具体为:在Re-INVITE 消息附
带SDP 消息中,发送的参数属性为"a=sendonly" 和IP 地址为0.0.0.0 做
传播媒介就可以实现.再一次按HOLD 按钮将释放刚才保持的状态,双向的
通话将再一次重新占用.通过Re=INVITE 附带的SDP 消息里,发送另一个
带有"a=sendrecv" 和在当前的IP 地址做传播媒介,即可恢复通话.
4.2 呼叫控制业务
SIP和H.323都支持呼叫保持、呼叫转移、呼叫前转、呼叫等待、电话会议和其他补充业务。以呼叫保持为例:H.323定义了近点呼叫保持和远点呼叫保持两种保持业务的场景,两者都可带网守或不带。网守仅仅透明地传送SS-HOLD。而SIP实现同样的功能,只要向需要呼叫保持的一方发送一个更改了SDP描述的INVITE命令即可。更改的SDP描述段仅将媒体发送的目的地址变为空<0.0.0.0>,而其他的内容不变。收到该用户的UA,让呼叫保持,直到有新的IN VITE到来为止。
看看RFC:
RFC3264 – An Offer/Answer Model with Session Description Protocol (SDP)
RFC3264 Section 6.1 says:
"If a stream is offered as sendonly, the corresponding stream MUST be marked
as recvonly or inactive in the answer."
RFC3264 Section 8.4 also says:
"If the stream to be placed on hold was previously a sendrecv media stream it is placed on hold by marking it as sendonly. If the stream to be placed on hold was previously a recvonly media stream, it is placed on hold by marking it inactive.
This means that a stream is placed "on hold" separately in each direction. Each stream is placed "on hold" independently. The recipient of an offer for a stream on-hold SHOULD NOT automatically return an answer with the corresponding stream on hold. An SDP with all streams "on hold" is referred to as held SDP."
In my mind, it seems to me that RFC3264 is very clear on how to deal with
ANY offer that is marked a=sendonly. You can 1)set the port to 0 to reject the offer 2) respond with a=recvonly
3) respond with a=inactive.
You certainly can NOT respond to a sendonly stream with sendrecv!!!
However, if my software responds to a=sendonly with a=recvonly the phone I have will only continue to offer a=sendonly from that point on.
But then I read RFC4317 Section 3.2 which lists an example in which an offer a=sendonly is responded to with no direction attribute (which implies
sendrecv!). The section of interest is below:
[Second-Offer]
v=0
o=bob 2808844564 2808844565 IN IP4 host.biloxi.example.com
s=
c=IN IP4 host.biloxi.example.com
t=0 0
m=audio 49172 RTP/AVP 97
a=rtpmap:97 iLBC/8000
a=sendonly
m=audio 49174 RTP/AVP 98
a=rtpmap:98 telephone-event/8000
a=recvonly
[Second-Answer]
v=0
o=alice 2890844526 2890844527 IN IP4 host.atlanta.example.com
s=
c=IN IP4 host.atlanta.example.com
t=0 0
m=audio 49170 RTP/AVP 0 97
a=rtpmap:0 PCMU/8000
a=rtpmap:97 iLBC/8000
m=audio 49172 RTP/AVP 98
a=rtpmap:98 telephone-event/8000
a=sendonly
8.4 Putting a Unicast Media Stream on Hold
If a party in a call wants to put the other party "on hold", i.e., request that it temporarily stops sending one or more unicast media streams, a party offers the other an updated SDP.
If the stream to be placed on hold was previously a sendrecv media stream, it is placed on hold by marking it as sendonly. If the stream to be placed on hold was previously a recvonly media stream, it is placed on hold by marking it inactive.
This means that a stream is placed "on hold" separately in each direction. Each stream is placed "on hold" independently. The recipient of an offer for a stream on-hold SHOULD NOT automatically return an answer with the corresponding stream on hold. An SDP with all streams "on hold" is referred to as held SDP.
Certain third party call control scenarios do not work when an answerer responds to held SDP with held SDP.
Rosenberg & Schulzrinne Standards Track [Page 17]
RFC 3264 An Offer/Answer Model Session Description Protocol June 2002
Typically, when a user "presses" hold, the agent will generate an offer with all streams in the SDP indicating a direction of sendonly, and it will also locally mute, so that no media is sent to the far end, and no media is played out.
RFC 2543 [10] specified that placing a user on hold was accomplished by setting the connection address to 0.0.0.0. Its usage for putting a call on hold is no longer recommended, since it doesn\’t allow for RTCP to be used with held streams, doesn\’t work with IPv6, and breaks with connection oriented media. However, it can be useful in an initial offer when the offerer knows it wants to use a particular set of media streams and formats, but doesn\’t know the addresses and ports at the time of the offer. Of course, when used, the port number MUST NOT be zero, which would specify that the stream has been disabled. An agent MUST be capable of receiving SDP with a connection address of 0.0.0.0, in which case it means that neither RTP nor RTCP should be sent to the peer.
标签:call, sip0328 sip local Contact
自己架设了一个服务器,结果呼出之后对方挂断,收不到BYE,EYEBEAM却可以,看看包
差别就在 Contact: ,一个@后面跟的是本地IP,我的跟的是服务器IP,改为本地IP之后OK
13:28:21.1
SENDING TO: www.yippeesoft.com :5060
INVITE sip:1530@ www.yippeesoft.com SIP/2.0
Via: SIP/2.0/UDP www.yippeesoft.com :7017;branch=z9hG4bK-d87543-3b2a6d1dd227c161-1–d87543-;rport
Max-Forwards: 70
Contact: <sip: www.yippeesoft.com @ www.yippeesoft.com :7017>
To: <sip:1530@ www.yippeesoft.com >
From: " www.yippeesoft.com "<sip: www.yippeesoft.com @ www.yippeesoft.com >;tag=5a60f079
Call-ID: c3684f4de4569c66@c2Y.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Proxy-Authorization: Digest username=" www.yippeesoft.com ",realm="Star-Net",nonce="328d5ab2",uri="sip:1530@ www.yippeesoft.com ",response="9978328a15bc5c8ac3f4f27032079776",algorithm=MD5
Supported: eventlist
User-Agent: eyeBeam release 3010n stamp 19039
Content-Length: 240
v=0
o=- 19731968 19732105 IN IP4 www.yippeesoft.com
s=eyeBeam
c=IN IP4 www.yippeesoft.com
t=0 0
m=audio 8738 RTP/AVP 0 8 18 5 101
a=alt:1 1 : 48D1F082 000000DA www.yippeesoft.com 8738
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=sendrecv
INVITE sip:1530@ www.yippeesoft.com SIP/2.0
From: <sip: shengfang @ www.yippeesoft.com >;tag=73e7260-0-13c4-4c08-3683ecd6-4c08
To: <sip:1530@ www.yippeesoft.com >
Call-ID: 73e8e90-0-13c4-4c08-427d1caa-4c08@ www.yippeesoft.com
CSeq: 2 INVITE
Via: SIP/2.0/UDP www.yippeesoft.com :5060;branch=z9hG4bK-4c08-1290036-747ab1d4
Max-Forwards: 70
Contact: <sip: shengfang @ www.yippeesoft.com >
Proxy-Authorization: Digest username=" shengfang ",realm="Star-Net",nonce="51d04d1a",uri="sip:1530@ www.yippeesoft.com ",response="20aa0ff3cd024be187dc3c6c363038a1",algorithm=MD5
Content-Type: application/SDP
Content-Length: 185
v=0
o= shengfang 0 0 IN IP4 www.yippeesoft.com
s=session
c=IN IP4 www.yippeesoft.com
b=CT:1000
t=0 0
m=audio 5024 RTP/AVP 0 8 4
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
0316 OnDO SIP Server install
==================================================================
OnDO SIP Server 1.5 Readme
Copyright (C) 2002-2006, Brekeke Software, Inc. All rights reserved.
Date: January 4, 2006
==================================================================
This product oss1_5_X_X.zip includes the following contents :
LICENSE BREKEKE SOFTWARE END USER LICENSE AGREEMENT for this release
README.txt This document
proxy.war A package containing the OnDO SIP Server application
1. Installation
1.1 Installation from oss1_5_X_X.zip
(1)Before Installing OnDO SIP Server
You need to install the following programs before installing OnDO SIP Server:
Java J2SE JRE 1.4 or later (http://java.sun.com/j2se/)
Servlet Engine Apache Tomcat 4.1.2 or later (http://jakarta.apache.org/tomcat/)
(2)Installing and Starting
Copy proxy.war file to webapps directory in Tomcat.
Start Tomcat.
After starting Tomcat, you can access the OnDO SIP Server Admintool through a web browser.
The URL example http://localhost:8080/proxy
To use the OnDO SIP Server Admintool, you need user a ID and password. The default setting is as follows:
User ID: sa
Password: sa
1.2 Installation from oss1_5_X_X.exe
(1)Execute the file and follow the installer wizard.
(2)Start "OnDO SIP Server" service from [Start]->[Settings]->[Control]->[Administrative Tools]->[Services] if you didn\’t select to start the OnDO SIP Server in the installer.
下载 J2RE,安装
下载
OnDO SIP Server
OnDO SIP Server, a SIP Registrar and Proxy Server, registers and authenticates users, and routes calls between user agents. The product has original NAT traversal (SIP NAT) functionality as well as flexible control routing functions
Installer Program (Windows OS Only) Name Format Version Date Download
OnDO SIP Server —New! EXE 1.5.1.5 2006/1/11
Installation files (Windows, Linux, Mac OSX, Solaris OS) Name Format Version Date Download
OnDO SIP Server —New! ZIP 1.5.1.5 2006/1/11
Update files (Windows, Linux, Mac OS X, Solaris OS) Name Format Version Date Download
OnDO SIP Server —New! ZIP 1.5.1.5 2006/1/11
0305 sip ua rtc lcs
基本 一个基于RTC的SIP UA客户端,做的有点闷,查找资料的过程中 记录一下资料。
Microsoft Real-Time Communications Client API Downloads
The new Microsoft Real-Time Communications Client API is built upon industry-standard protocols, such as Session Initiation Protocol (SIP). It encapsulates functionality to expose presence information upon a set of contacts, make PC-PC, PC-phone, or phone-phone calls, or create Instant Messaging (IM), whiteboard, and application sessions.
Microsoft Windows Real-Time Communications Client API SDK v1.3
The Microsoft Windows Real-Time Communications Software Development Kit 1.3 provides information, samples, and tools regarding the additional features of the Real-Time Communications 1.3 API. Additional features include: enhanced multiple points of presence support, support for Microsoft Office Live Communications Server 2005, additional client security options, and marshalling support.
Date: November 19, 2004
Microsoft Real-time Communications Client Software Development Kit (SDK) v1.2
The Microsoft Real-time Communications Client SDK provides documentation, sample code and other tools that allow developers to build real-time communication applications, or integrate real-time communication functionality into existing applications.
Note: To execute samples or applications upon any development or test machine, install the SDK and then run RTCAPISETUP.EXE to install the Microsoft Real-time Communications Client API binaries. This executable can be found within the "Installation" sub-directory.
Date: August 20, 2003
“什么样的开发工具才是最好的?”,答案“能赚钱的开发工具就是最好的”。我想我们很多程序员都在一些架构、一些开发的技术平台、一些代码的细节上纠缠不清,而没有考虑我们开发的最终目的是什么。实际上用最少的时间、最少的成本赚取最大的利润是我们项目的最终目标。
Live Communications Server 2005 为您的企业/单位提供了一种可管理并可扩展的企业级实时通信的解决方案。从与 Live Communications Server 2003 相同的会话初始化协议 (SIP) 和 SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) 基于行业的标准平台扩展之后,通过 Live Communications Server 2005,您可以与合作伙伴、客户和供应商共享状态、即时消息 (IM) 以及实时通信功能,从而可以比使用以前的版本做出更快、更好的商业决策。
要使用 Live Communications Server 2005 企业版,需要:
组件 需求
计算机和处理器 您的个人电脑需要配备Intel Pentium 550MHZ或更快的处理器(推荐使用两个兼容 Xeon-compatible 3-GHz 或更快的处理器)
内存 256MB内存,推荐2GB RAM或更多内存
硬盘 两块Ultra2 SCSI(小型计算机系统接口)硬盘,36.4GB可用硬盘空间
操作系统 Microsoft Windows Server™ 2003 标准版; Windows Server 2003 企业版;或 Windows Server 2003 数据中心版 (supports 32-bit versions of Windows Server 2003)。
其他
Windows Server 2003 或 Windows 2000(Service Pack 3)的 Active Directory 目录服务是必需的。
数据库要求:安装 Live Communications Server 2005 企业版需要一台单独的运行 SQL Server 2000 标准版或 SQL Server 2000 企业版(service pack 3a) 的服务器;存档服务需要 SQL Server 2000 标准版或 SQL Server 2000 企业版支持。
Microsoft Real-Time Communications: Protocols and Technologies
This paper is written for IT professionals and developers interested in understanding the concepts, protocols, and technologies of real-time communications. It describes protocols such as the Internet Engineering Task Force (IETF) Session Initiation Protocol (SIP), SIP Instant Messaging and Presence Language Extensions (SIMPLE), and Real-time Transport Protocol (RTP). Microsoft uses these protocols and related technologies to provide a real-time communications (RTC) platform for corporate multi-modal communication, which includes voice and video communication, instant messaging, application sharing, and collaboration. Throughout this paper, voice communication and the way the Microsoft® Windows® XP operating system supports it are used to illustrate how the underlying technologies work.
RTC Call Processing
Session Initiation Protocol
Session Description Protocol
Audio and Video Digitization and Compression
RTP and RTCP
Voice Quality Technologies
SIP Instant Messaging and Presence Language Extensions
问: Live Communications Server 的系统要求是什么?
答: 请参阅 Live Communications Server 2005 系统要求。此外,您还可以查看 Live Communications Server 2005 规划和快速入门文档,该文档位于 Live Communications Server 部署中心。
问: Live Communications Server 支持哪些标准和协议?
答: Live Communications Server 是在会话初始化协议 (SIP) 标准和 SIP for Instant Messaging and Presence Leveraging Extensions (SIMPLE) 标准上构建的,这些标准的提供者是 Internet 工程任务组 (IETF)。Live Communications Server 还使用简单对象访问协议 (SOAP)。单击这里了解更多有关以下内容的信息:Live Communications Server 协议。
问: 非 Microsoft 公司开发的客户端是否可以与 Live Communications Server 交互?
答: 使用 Windows 实时通信 (RTC) 客户端应用程序编程接口 (API),可以开发应用程序,以利用 RTC 客户端 API。客户和合作伙伴可以使用 SIP 和 SIMPLE 的开放标准编写自己的客户端应用程序,以利用 Live Communications Server 功能和状态引擎。
问: 从哪里可以获得软件开发包 (SDK),以便生成可与 Live Communications Server 配合使用的应用程序?
答: 可以从 Microsoft Developer Network (MSDN) 获取资源,帮助生成可与 Live Communications Server 配合使用的程序,例如:
• RTC 客户端 API
• Live Communications Server API
Microsoft Office Live Communications Server 2005
Purpose
The Microsoft® Office Live Communications Server 2005 API suite enables developers to create custom Session Initiation Protocol (SIP) applications and manage the Microsoft Office Live Communications Server 2005 product.
Where Applicable
Live Communications Server is a SIP-compliant platform that supports routing messages across a network. The Live Communications Server API suite supports the creation, deployment, and management of third-party server applications that customize and extend the functionality of Live Communications Server.
Developer Audience
The Live Communications Server Application API targets experienced SIP developers who create managed applications to run on Live Communications Server.
The Live Communications Server Management API targets:
System administrators who manage the Live Communications server, and
Developers who create Windows® Management Instrumentation (WMI) applications for Live Communications Server.
Run-Time Requirements
Microsoft Office Live Communications Server 2005
Microsoft Windows Server™ 2003 family
Microsoft Windows® 2000 Active Directory or Microsoft Windows Server 2003 Active Directory
许可证 价格 注释
带有 5 个 CAL 的 Live Communications Server 2005 Standard Edition 服务器许可证
1,199 美元
订购
这一完全打包的产品包括一个 Live Communications Server 2005 Standard Edition 服务器许可证和 5 个 CAL(每个用户或每台设备)。
带有 25 个 CAL 的 Live Communications Server 2005 Enterprise Edition 服务器许可证
4,969 美元
订购
这一完全打包的产品包括一个 Live Communications Server 2005 Enterprise Edition 服务器许可证和 25 个 CAL(每个用户或每台设备)。
还要 Microsoft SQL Server 2000 Microsoft Windows Server 2003
0303 sip rtp sound noise 抓包
0222 sip rtp osip sound noise (2006-6-10)
http://www.yippeesoft.com/blog/p/0222siprtposipsoundnoise.php
0303 sip rtp sound noise 协议
http://www.yippeesoft.com/blog/p/0303siprtpsoundnoiseprotocol.php
看上去时间戳、序号增长不错的样子
No. Time Source Destination Protocol Info
1186 33.094566 www.yippeesoft.com www.yippeesoft.com RTP Payload type=ITU-T G.711 PCMA, SSRC=271620609, Seq=152, Time=7310341
Frame 1186 (282 bytes on wire, 282 bytes captured)
Ethernet II, Src: www.yippeesoft.com (00:d0:f8:00:55:f9), Dst: www.yippeesoft.com (00:d0:c9:98:75:3a)
Internet Protocol, Src: www.yippeesoft.com ( www.yippeesoft.com ), Dst: www.yippeesoft.com ( www.yippeesoft.com )
User Datagram Protocol, Src Port: 5024 (5024), Dst Port: 12580 (12580)
Real-Time Transport Protocol
Stream setup by SDP (frame 11)
10.. …. = Version: RFC 1889 Version (2)
..0. …. = Padding: False
…0 …. = Extension: False
…. 0000 = Contributing source identifiers count: 0
0… …. = Marker: False
Payload type: ITU-T G.711 PCMA (8)
Sequence number: 152
Timestamp: 7310341
Synchronization Source identifier: 271620609
Payload: 18170F222A361E3229366027BC33B3A5A3BCD39DBEA2B59E…
No. Time Source Destination Protocol Info
1194 33.255379 www.yippeesoft.com www.yippeesoft.com RTP Payload type=ITU-T G.711 PCMA, SSRC=271620609, Seq=153, Time=7310501
Frame 1194 (282 bytes on wire, 282 bytes captured)
Ethernet II, Src: www.yippeesoft.com (00:d0:f8:00:55:f9), Dst: www.yippeesoft.com (00:d0:c9:98:75:3a)
Internet Protocol, Src: www.yippeesoft.com ( www.yippeesoft.com ), Dst: www.yippeesoft.com ( www.yippeesoft.com )
User Datagram Protocol, Src Port: 5024 (5024), Dst Port: 12580 (12580)
Real-Time Transport Protocol
Stream setup by SDP (frame 11)
10.. …. = Version: RFC 1889 Version (2)
..0. …. = Padding: False
…0 …. = Extension: False
…. 0000 = Contributing source identifiers count: 0
0… …. = Marker: False
Payload type: ITU-T G.711 PCMA (8)
Sequence number: 153
Timestamp: 7310501
Synchronization Source identifier: 271620609
Payload: CDB1AFA4A6ABB6AEB6CD482F2421262C35263C38231A1A13…
0303 sip rtp sound noise 协议
0222 sip rtp osip sound noise (2006-6-10)
http://www.yippeesoft.com/blog/p/0222siprtposipsoundnoise.php
基于人家的SDK开发,提供了SIP和RTP协议栈,可是都是噪声。
根据协议,RTP应该比较简单 By xxj & faxiao
RTP 协议(Real Time Protocol)提供具有实时特征的、端到端的数据传送服务,可用来传送声音和运动图像数据。在这项数据传送服务中包含了装载数据的标识符、序列计数、时戳和传送监视。通常RTP 的协议元是用UDP 协议元来装载的,并利用UDP 的复用和校验和来实现RTP 的复用。
必须注意的是,RTP 没有提供任何确保按时传送数据的机制,也没有提供任何质量保证的机制,因而要实现服务质量必须由下层网络来提供保证。同样必须
注意的是,RTP 不保证数据包按序号传送,即使在下层网络能使保证可靠传送的条件下,也不保证数据包按序号传送。包含在RTP 中的序号可供接收方用于重构数据包序列,也可用于包的定位。
在RTP 会话中,复用是由目的传送地址(网络地址和端口号)来提供的,一个传送地址定义了一个RTP 会话。例如,在一个会议中,音频码流和视频码
流是分别用不同的RTP 会话(一般是同一个目的网络地址和不同的端口号)来传送,而不是用PT(载荷类别)或SSRC 作区分来实现单个RTP 会话中的复用
传送。
固定报头的RTP 报文结构如图3-1 所示:
RTP 报头中各字段的含义如下:
版本(V):2 个比特,表示RTP 的版本号。
填充(P):1 个比特,置“1”表示用户数据最后加有填充位,用户数据中
最后一个字节是填充位计数,它表示一共加了多少个填充位。在两种情况下可能
需要填充,一是某些加密算法要求数据块大小固定;二是在一个低层协议数据包
中装载多个RTP 分组。
扩展(X):1 个比特,置“1”表示RTP 报头后紧随一个扩展报头。
CSRC 计数(CC):4 个比特,表示在定长的RTP 报头后的CSRC 标识符的
数量。
标记(M):1 个比特,其具体解释由应用文档来定义。例如,对于视频流,
它表示一帧的结束,而对于音频,则表示一次谈话的开始。
载荷类别(PT):7 个比特,它指示在用户数据字段中承载数据的载荷类别。
序号(SN):2 个字节,每发送一个RTP 数据包该序号增加1。该序号在接
收方可用来发现丢失的数据包和对到来的数据包进行排序。
时间戳(TS):4 个字节,它用来表示RTP 包中用户数据段的第一个字节的采样时刻。时间戳的时间表示应为线性单调递增的,以便完成同步实现和抖动的
计算。
同步源标识符(SSRC):4 个字节,用来标识一个同步源。此标识符是随机选择的,但要保证同一RTP 会话中的任意两个SSRC 各不相同,RTP 必须检测
并解决冲突。
提供源标识符(CSRC):它可有0~15 项标识符,每一项长度为32 比特,其项数由CC 字段来确定。如果提供源多于15 个,则只有15 个被标识。
为了能满足各种应用的需要,RTP 报头可进一步扩充,其时X 比特将置“1”,扩充的RTP 报头部分则紧随在SCRC 清单之内。
如果扩展位被置为1,意味着RTP 固定头后紧跟着一个头扩展,其格式如图
3-2 所示。前16 位的内容由轮廓文件决定,主要用来标识不同的头扩展类型。这
种扩展方式主要用来传递独立于具体格式的载荷(payload-format-independent)
的应用信息。
0222 sip rtp osip sound noise
赶鸭子上架,该死的项目变来变去,弄得我开始人格分裂了,不管了,还是基于开源的自己试一试~~~
看示例程序:
else if (je->type==EXOSIP_CALL_ANSWERED)
&leftsign;
printf( "<- (%i %i) [%i %s ANSWERED] %s",
je->cid, je->did,
je->status_code,
je->reason_phrase,
je->remote_uri);
josua_printf(buf);
call.build(je);
&rightsign;
if (ca->remote_sdp_audio_ip[0]==\’\\0\’)
&leftsign;
osip_strncpy(ca->remote_sdp_audio_ip, je->remote_sdp_audio_ip, 49);
ca->remote_sdp_audio_port = je->remote_sdp_audio_port;
ca->payload = je->payload;
osip_strncpy(ca->payload_name, je->payload_name, 49);
&rightsign;
根据我浅薄的理解,SIP协商语音能力之后,然后用RTP进行传输,那么现在就已经看到了 远程IP和远程端口
那么我就简单的用RTP进行传输一个强行转发为PCMU/PCMA的WAVE文件应该可以正常吧,结果全部是噪音。
FILE *source=fopen("c://12pcmu.wav","rb");
if ( source == NULL )
&leftsign;
cout<<"can\’t access the file"<<endl;
&rightsign;
//#ifdef win32
//#endif
size_t bufRead = 0;
bool Mark=true;
#define bufsize 1024
BYTE buffer[bufsize];
int t;
RTPSession sess;
t=sess.Create(5800);
if(t!=0)cout<<"can\’t create"<<endl;
bool sen;
if(t==0)&leftsign;sen=true;&rightsign;
int nPT ;
int nTSTAMP;
sess.SetMulticastTTL(1); //砞﹚multicastTTL
sess.AddDestination(ntohl(inet_addr("111.168.13.190")),portt); //﹚肚癳ヘ狠
//sess.AddDestination(ntohl(inet_addr("192.168.25.79")),6900);
if(t!=0) cout<<"can\’t add destination"<<endl;
for (int jj=0;j<1000;j++)
&leftsign;
(void) fseek( source, 0, SEEK_SET );
while(!feof(source))
&leftsign;
bufRead = fread(buffer, sizeof(BYTE), bufsize, source );
nPT=rand()%64+1;
nTSTAMP=rand()%1000+1;
t=sess.SendPacket(buffer,bufsize,nPT,Mark,nTSTAMP);
if(t!=0)cout<<"can\’t sending"<<endl;
Sleep(10);
Mark=false;
&rightsign;
&rightsign;
(void) fflush( source );
(void) fclose( source );
cout<<("send success")<<endl;
WSACleanup();
0210 SIP RTP CODEC jrtp G729
试图整合RTP和G.729编码部分
目前RTP数据传输OK
G.729通话OK,但是整合到一起就不行了
压缩后传输过去的数据是一致,但是接收方解压后的数据就不对了
原始数据
0012F06C 46464952 02F2E030 45564157 20746D66 00000010 00020001
0012F084 0000AC44 0002B110 00100004 74636166 00000004 2074755B
0012F09C 61746164 02F2E000 00000000 00000000 00000000 00000000
压缩数据
00610C28 A0C05EDC 64CDFA00 1D30AC45 A5309888 864720BC 40F2A060
00610C40 58D50A40 12F9D467 1AF0923B D445408F 9A378EF9 96C13A80
00610C58 63F05602 4A40C07B D60712C1 42FB4270 10CDAA01 0000D643
接收数据
0012F20C A0C05EDC 64CDFA00 1D30AC45 A5309888 864720BC 40F2A060
0012F224 58D50A40 12F9D467 1AF0923B D445408F 9A378EF9 96C13A80
0012F23C 63F05602 4A40C07B D60712C1 42FB4270 10CDAA01 FDFDD643
解压数据
0042FC20 00020002 00020002 00000000 00000000 FFFFFFFF FFFFFFFF
0042FC38 FFFFFFFF 00000000 00000000 00000000 00000000 00000000
0042FC50 00000000 00000000 00000000 00000000 00000000 00000000
0042FC68 00000000 00000000 00080026 0000FFFC 0003FFFA 00020026
CCodec::CCodec(void)
&leftsign;
va_g729a_init_encoder();
va_g729a_init_decoder();
&rightsign;
压缩
bool CCodec::EncodeAudioData(char * pin, int len , char* pout , int* lenr)
&leftsign;
if(!pin&line;&line;len!=AUDIO_BUFFER_SIZE&line;&line;!pout)
retrun false;
va_g729a_encoder((short*)pin,(BYTE*)pout);
va_g729a_encoder((short*)(pin+160),(BYTE*)pout+10);
va_g729a_encoder((short*)(pin+320),(BYTE*)pout+20);
va_g729a_encoder((short*)(pin+480),(BYTE*)pout+30);
va_g729a_encoder((short*)(pin+640),(BYTE*)pout+40);
va_g729a_encoder((short*)(pin+800),(BYTE*)pout+50);
if(lenr)
*lenr=CODEC_DATA_SIZE;
retrun true;
&rightsign;
解压
bool CCodec::DecodeAudioData(char * pin, int len , char* pout )
&leftsign;
if(!pin&line;&line;len!=CODEC_DATA_SIZE&line;&line;!pout)
return false;
va_g729a_decoder((BYTE*)pin,(short*)(pout),0);
va_g729a_decoder((BYTE*)pin+10,(short*)(pout+160),0);
va_g729a_decoder((BYTE*)pin+20,(short*)(pout+320),0);
va_g729a_decoder((BYTE*)pin+30,(short*)(pout+480),0);
va_g729a_decoder((BYTE*)pin+40,(short*)(pout+640),0);
va_g729a_decoder((BYTE*)pin+50,(short*)(pout+800),0);
return true;
&rightsign;
压缩前包为960 压缩后为60
0209 sip exosip error vc6 C1189 LDR
一、fatal error C1189: #error eh.h is only for C++!"
c:\\program files\\microsoft visual studio\\vc98\\include\\eh.h(32) : fatal error C1189: #error :"eh.h is only for C++!"
Error executing cl.exe.
定义:
#include <IOSTREAM>
using namespace std;
using namespace sth的意思就是取一个命名空间.那是因为你的文件没有定义名称,
在c++的标准库的名字都是在一个std的名字空间申名的
当然如果不申明也可以这样输出
std::cout<<i;
#include <iostream>
using namespace std;
void main()
&leftsign; int val1=10;val2=20;
cout<<val1<<val2<<endl;
&rightsign;
文件的扩展名必须为CPP
改错:
#include <iostream>
using namespace std;
或者:
#include <iostream.h>
新建一个DOS窗口程序WORKSPACE解决
二、LDR: LdrpWalkImportDescriptor() failed to probe M:\\sips\\exsip\\test\\Debug\\eXosip.dll for its manifest, ntstatus 0xc0150002
First-chance exception in test.exe (NTDLL.DLL): 0xC0150002: (no name).
The thread 0xF18 has exited with code -1072365566 (0xC0150002).
The program \’M:\\sips\\exsip\\test\\Debug\\test.exe\’ has exited with code -1072365566 (0xC0150002).
VC++ Native Code
I have a solution with 4 DLL\’s and an EXE test driver program. This all worked fine in Beta 1. I installed Beta 2 and now the EXE won\’t start. I\’ve deleted everything from all Debug directories and rebuilt the solution. Nada. I get the following error when attempting to run the EXE:
There are numerous changes between Beta 1 and Beta 2 so have you tried recompiling the code?
Definitely recompile. Most of my Beta 1 and CTP code would not run at all until I recompiled it.
FWIW, I found the problem. I was using a Boost library that was built with beta 1, causing a version mismatch problem. I rebuilt Boost with beta 2 and the problem went away.
I you\’re right. I forgot an external dependence that was compiled with
Beta-1. I rebuilt all my DLLs with Beta-2 and the \’manifest\’ problem
desapeared.
Now here is the problem, I guess. The DLL is requesting both DebugCRT and
the CRT. Since the installed framework in the target computer doesn\’t
include the debug CRT, things fail. Am I right?
Now, how do I tell this DLL not to use the debug CRT?? I\’m linking with /MD,
not /MDd. Why would it be putting the Debug CRT dependency there?
好像都是说把相关的DLL重新编译~~~~~~~~~ 晕倒~~~~~~~~~~~~~
最后搞来搞去终于VC6下面PASS。~~~~~~~~~~~~~~~~~~~
标签:err, error, exosip, ror, sip, vc, vc60208 sip rtcsample EnableProfileEx
//
// MessageId: RTC_E_UDP_NOT_SUPPORTED
//
// MessageText:
//
// This feature is not supported when one of the server in profile has UDP transport
//
#define RTC_E_UDP_NOT_SUPPORTED ((HRESULT)0×80EE007EL)
IRTCClientProvisioning2::EnableProfileEx
The EnableProfileEx method enables a profile for use in server registration, roaming, and automatic profile selection.
HRESULT EnableProfileEx(
IRTCProfile* pProfile,
long lRegisterFlags,
long lRoamingFlags
);
Parameters
pProfile
[in] Pointer to a profile to enable on the SIP server.
lRegisterFlags
[in] Integer value containing a set of bit flags that describes registration behaviors. If this value is zero, deregistration will occur. Otherwise, it will be any combination of the RTCRF_* flags.
lRoamingFlags
[in] Integer value containing a set of bit flags that specifies the type of profile to be enabled on the SIP server (such as a buddy or watcher profile). If this value is zero, the profile will be disabled. Otherwise, it will be one of the RTCRMF_* flags.
Roaming contacts (specified in the RTCRMF_* flags) are not supported when the Registrar server in the profile specifies the UDP transport; the lRoamingFlags parameter must be set to zero. If UDP is the transport, local contacts and group are supported and can be added to the local presence store. For more information on the local presence store, see the IRTCClientPresence2::EnablePresenceEx and IRTCClientPresence::EnablePresence methods.
The IRTCClientPresence2::EnablePresenceEx method should be called before registering with the server using the EnableProfileEx method. This method should not be used with the RTC version 1.0 ITRCClientPresence::EnablePresence or ITRCClientProvisioning::EnableProfile method. The RTC Client API version 1.2 restricts the number of enabled profiles to one.
This method extends the functionality of IRTCClientProvisioning::EnableProfile.The profile enabled with this method can be selected for use with IRTCClient::CreateSession and IRTCClientPresence::AddBuddy.
If flag values are specified in lRegisterFlags and the profile contains information about a SIP registrar server, registration will subsequently occur. To deregister a profile, the profile may be disabled with IRTCClientProvisioning::DisableProfile, or reenabled with lRegisterFlags set to zero. The status of registration/deregistration will be communicated as RTCE_REGISTRATION_STATE_CHANGE events.
If flag values are specified in lRoamingFlags, roaming will be started for the profile. To stop roaming, IRTCClientProvisioning::DisableProfile should be called. Roaming status updates will occur as RTCE_ROAMING events. Roaming can only be activated on a method enabled by calling this method.
If a profile is enabled with the same key value as another profile (see the RTC XML schema for information on key values), the existing profile will be disabled and replaced by the newly created profile.
Note Incoming sessions will not be secure unless the application sets the listen mode to disallow both static and dynamic ports (RTCLM_NONE), and the TLS transport is specified in the profile.
Return Values
RTC methods may return an RTC_E_ constant.
Value Meaning
RTC_E_CLIENT_NOT_INITIALIZED The client object is not initialized.
RTC_E_UDP_NOT_SUPPORTED The lRoamingFlags parameter is not zero when the registrar specifies UDP as the transport in the profile. Roaming is not supported when the transport is UDP and the lRoamingFlags parameter must be set to zero.
E_INVALIDARG Invalid register flags.
E_POINTER The pProfile parameter is not a valid pointer.
RTCRMF_ALL_ROAMING
0×0000000F
All types of roaming will be enabled for the profile.
低级错误,终于发现了,修改原代码中的
hr = m_pProfile->put_AllowedAuth(RTCAU_NTLM &line; RTCAU_KERBEROS &line; RTCAU_USE_LOGON_CRED);
为
hr = m_pProfile->put_AllowedAuth(RTCAU_DIGEST&line;RTCAU_NTLM &line; RTCAU_KERBEROS &line; RTCAU_USE_LOGON_CRED);
就行了.