Copyright © 2006 voice-system.ro
db_url
(str)table
(str)trace_flag
(integer)trace_on
(integer)traced_user_avp
(str)trace_table_avp
(str)duplicate_uri
(str)trace_local_ip
(str)sip_trace()
sip_trace
db_url
parametersip_trace
parametertrace_flag
parametertrace_on
parametertrace_on
parametertrace_on
parameterduplicate_uri
parametertrace_local_ip
parametersip_trace()
usageOffer a possibility to store incoming/outgoing SIP messages in database.
There are two ways of storing information.
by calling explicitely the sip_trace() method in OpenSER configuration file. In this case the original message is processed.
by setting the flag equal with the value of 'trace_flag' (e.g., setflag(__trace_flag__)) parameter of the module. In this case, the\ message sent forward is processed. The logging mechanism is based on TM/SL callbacks, so only messages processed with TM/SL are logged.
The tracing can be turned on/off using fifo commad.
openserctl fifo sip_trace on
openserctl fifo sip_trace off
The following modules must be loaded before this module:
database module - mysql, postrgress, dbtext, unixodbc...
tm and sl modules - optional, only if you want to trace messages forwarded by these modules.
The following libraries or applications must be installed before running OpenSER with this module loaded:
None.
traced_user_avp
(str)The name of the AVP storing the SIP URI of the traced user. If the AVP is set, messages are stored in database table and 'traced_user' column is filled with AVP's value. You can store the message many times for many users by having multiple values for this AVP.
Default value is "NULL" (feature disabled).
trace_table_avp
(str)The name of the AVP storing the name of the table where to store the SIP messages. If it is not set, the value of 'table' parameter is used. In this way one can select dynamically where to store the traced messages. The table must exists, and must have the same structure as 'sip_trace' table.
Default value is "NULL" (feature disabled).
duplicate_uri
(str)The address in form of SIP uri where to send a duplicate of traced message. It uses UDP all the time.
Default value is "NULL".
trace_local_ip
(str)The address to be used in fromip field for local generated messages. If not set, the module sets it to the address of the socket that will be used to send the message.
Default value is "NULL".
sip_trace()
Store current processed SIP message in database. It is stored in the form prior applying chages made to it.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE.
sip_trace
Name: sip_trace
Parameters:
trace_mode : turns on/off SIP message tracing. Possible values are:
on
off
MI FIFO Command Format:
:sip_trace:_reply_fifo_file_ trace_mode _empty_line_
Next is presented the definition of sip_trace table
Example 1-10. sip_trace sql
CREATE TABLE `sip_trace` ( `id` int(10) NOT NULL auto_increment, `date` datetime NOT NULL default '0000-00-00 00:00:00', `callid` varchar(254) NOT NULL default '', `traced_user` varchar(128) NOT NULL default '', `msg` text NOT NULL, `method` varchar(50) NOT NULL default '', `status` varchar(254) NOT NULL default '', `fromip` varchar(50) NOT NULL default '', `toip` varchar(50) NOT NULL default '', `fromtag` varchar(64) NOT NULL default '', `direction` varchar(4) NOT NULL default '', INDEX user_idx (traced_user), INDEX date_id (date), INDEX ip_idx (fromip), KEY `call_id` (`callid`), PRIMARY KEY (`id`) );
Stateless forwarded messages (forward()) are not logged if you set the flag, use sip_trace().
Take a look at http://www.openser-project.org/.
First at all check if your question was already answered on one of our mailing lists:
User Mailing List - http://lists.openser-project.org/cgi-bin/mailman/listinfo/users
Developer Mailing List - http://lists.openser-project.org/cgi-bin/mailman/listinfo/devel
E-mails regarding any stable OpenSER release should be sent to
<users@lists.openser-project.org>
and e-mails regarding development versions
should be sent to <devel@lists.openser-project.org>
.
If you want to keep the mail private, send it to
<team@lists.openser-project.org>
.
Please follow the guidelines provided at: http://sourceforge.net/tracker/?group_id=139143.