|
|||||||||||||||||||||||||||||||||||||||||
RecorderServletOverviewThe SIP servlet that records a voice mail. RecorderServlet is an SIP servlet that uses JMF (Java Media Framework) to record voice information from an SIP terminal to a hard disk on the server. RecorderServlet does not provide the function that replays its recorded voice data, but it saves the data in the AVI format. Therefore, you can replay the data easily using your media player (such as Windows Media Player) on your PC. RecorderServlet provides the following two methods for recording. RecorderServlet works as UAS in the first method, and it works as UAC in the second method.
In both methods, RecorderServlet replays the sound source data specified in the initialization parameters after a real-time session is established, and then starts to record. The recording process will continue until a BYE is received from the terminal or the maximum recording time is reached. Initialization ParametersThe following table lists the initialization parameters you can set in RecorderServlet.
You can create sound source files that can be set in welcome-file and beep-file using the sound recorder shipped with Windows, etc. The format of these sound source files should be CCITT u-Law 8.000 kHz, 8 bit, monaural. A sound source file whose format is not that can not be replayed successfully. External InterfacesRecorderServlet uses the following SPI:
RecorderServlet stores information about the received voice mail as application-specific information in a database. For information about the database schema, see this page. RecorderServlet determines the directory that stores the recorded file and sound source files for guidance by looking up in the following order:
If the store-directory context parameter is not specified in WebLogic Server, the default is 3. in the above directories. When RecorderServlet starts to record by sending a request, invoke an SipRequestDispatcher with the makeCall method. You can set the following parameters in SipRequestParams.
Here is a code example. SipRequestParams params = new SipRequestParams(); params.setParam("voiceMail.sender", sender); params.setParama("voiceMail.receiver", receiver); SipRequestDispatcher.getInstance(this, context, "recorder").invoke("makeCall", params); Related FilesThe RecorderServlet setting should be defined in the sip.xml. The database used by RecorderServlet should be created in advance. The data source used by RecorderServlet should be set on your application server in advance. ExampleHere is an example of the sip.xml. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sip-app PUBLIC "-//Java Community Process//DTD SIP Application 1.0//EN" "http://www.jcp.org/dtd/sip-app_1_0.dtd"> <sip-app> <display-name>Voice Recorder Servlet</display-name> <context-param> <param-name>store-directory</param-name> <param-value>/tmp/sip-demo</param-value> </context-param> <servlet> <servlet-name>recorder</servlet-name> <servlet-class>com.oki.sip.apps.recorder.RecorderServlet</servlet-class> <init-param> <param-name>use-contact</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>max-duration</param-name> <param-value>20</param-value> </init-param> <init-param> <param-name>recorder-uri</param-name> <param-value>sip:recorder@oki.com</param-value> </init-param> <init-param> <param-name>welcome-file</param-name> <param-value>/WEB-INF/welcome.wav</param-value> </init-param> <init-param> <param-name>beep-file</param-name> <param-value>/WEB-INF/beep.wav</param-value> </init-param> <init-param> <param-name>dataSource</param-name> <param-value>applicationServer.dataSource</param-value> </init-param> <init-param> <param-name>db.server</param-name> <param-value>Oracle</param-value> </init-param> <init-param> <param-name>db.version</param-name> <param-value>Release 9.2.0</param-value> </init-param> <load-on-startup/> </servlet> <servlet-mapping> <servlet-name>recorder</servlet-name> <pattern> <and> <equal> <var>request.method</var> <value>INVITE</value> </equal> <equal> <var>request.uri.user</var> <value>recorder</value> </equal> </and> </pattern> </servlet-mapping> <session-config> <session-timeout>15</session-timeout> </session-config> </sip-app> ReferenceLast Modified:Modified:Tue Dec 28 14:13:49 JST 2004 |
|||||||||||||||||||||||||||||||||||||||||
|