README
上传用户:sy_wanhua
上传日期:2013-07-25
资源大小:3048k
文件大小:2k
- VFilter readme
- For information about licensing, please see the LICENSE file in this
- directory, or http://www.vovida.org/license.html .
- simple filtering class.
- VFilter is a simple filtering class.
- To use VFilter, do the following:
- 1. run unix. there is no vxworks support in it right now.
- 2. define the environment variable SIP_FILTER ! This is important!
- use
- setenv SIP_FILTER 1
- # to undefine, use: unsetenv SIP_FILTER
- in tcsh, or
- SIP_FILTER=1 ; export SIP_FILTER
- in bash to enable.
- VFilter prints out information as it starts running about this.
- 3. run the appropriate infilter.pl and outfilter.pl code to filter
- the incoming and outgoing sides of the connections. this code is in
- the vfilter directory under tools .
- You must run the infilter.pl and outfilter.pl in the correct
- directory. this is the same directory that you ran your sip
- application in. If you have started the sip program with SIP_FILTER
- set, you should now see the following files in your directory:
-
- sip-inpipe.in
- sip-inpipe.in.ctl
- sip-inpipe.out
- sip-inpipe.out.ctl
- sip-outpipe.in
- sip-outpipe.in.ctl
- sip-outpipe.out
- sip-outpipe.out.ctl
- these are named pipes (unix fifos) which are used by the perl side.
- Now, if you run the infilter.pl and outfilter.pl, you should see
- something like:
- # ./infilter.pl
- waiting for message
- # ./outfilter.pl
- waiting for message
- now, all code going sent to/from the SIP code goes through this filter.
- about the perl scripts
- the perl scripts are essentially identical apart from the name of the
- fifos which it sits on.
- the actual loop where messages are modified is at the bottom of the
- perl code. It looks like this:
- while (1) {
- print "waiting for messagen";
- $buf = recMsg();
- print "got msg... parsing and retransmittingn";
- $buf = &filter($buf);
- sendMsg($buf);
- }
- this code receives a message, prints out the "got msg..." notice, then
- calls a function &filter. the result of &filter() is sent back to the
- SIP stack.