Skip to content

Commit

Permalink
Add new command line option `-a', which requests to record all sessions
Browse files Browse the repository at this point in the history
going through the RTPproxy unconditionally. By default the RTPproxy
requires call control software (i.e. SER, OpenSER or B2BUA) to enable
recording explicitly on per-session basis by sending appropriate
command.
  • Loading branch information
sobomax committed Jul 17, 2008
1 parent 25ce274 commit f73b8a1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
10 changes: 7 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: main.c,v 1.79 2008/07/16 20:42:20 sobomax Exp $
* $Id: main.c,v 1.80 2008/07/17 20:50:36 sobomax Exp $
*
*/

Expand Down Expand Up @@ -95,7 +95,7 @@ static void
usage(void)
{

fprintf(stderr, "usage: rtpproxy [-2fvFiP] [-l addr1[/addr2]] "
fprintf(stderr, "usage: rtpproxy [-2fvFiPa] [-l addr1[/addr2]] "
"[-6 addr1[/addr2]] [-s path]\n\t[-t tos] [-r rdir [-S sdir]] [-T ttl] "
"[-L nfiles] [-m port_min]\n\t[-M port_max] [-u uname[:gname]] "
"[-n timeout_socket]\n");
Expand Down Expand Up @@ -145,7 +145,7 @@ init_config(struct cfg *cf, int argc, char **argv)
if (getrlimit(RLIMIT_NOFILE, &(cf->nofile_limit)) != 0)
err(1, "getrlimit");

while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:P")) != -1)
while ((ch = getopt(argc, argv, "vf2Rl:6:s:S:t:r:p:T:L:m:M:u:Fin:Pa")) != -1)
switch (ch) {
case 'f':
cf->nodaemon = 1;
Expand Down Expand Up @@ -297,6 +297,10 @@ init_config(struct cfg *cf, int argc, char **argv)
cf->record_pcap = 1;
break;

case 'a':
cf->record_all = 1;
break;

case '?':
default:
usage();
Expand Down
12 changes: 12 additions & 0 deletions manpage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<arg choice="opt"><option>-i</option></arg>
<arg choice="opt"><option>-n</option> <replaceable>timeout_socket</replaceable></arg>
<arg choice="opt"><option>-P</option></arg>
<arg choice="opt"><option>-a</option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
Expand Down Expand Up @@ -367,6 +368,17 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-a</option></term>
<listitem>
<para>
Record all sessions going through the RTPproxy unconditionally.
By default the RTPproxy requires call control software (i.e.
SER, OpenSER or B2BUA) to enable recording explicitly on
per-session basis by sending appropriate record command.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
6 changes: 5 additions & 1 deletion rtpp_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: rtpp_command.c,v 1.13 2008/07/15 23:08:41 sobomax Exp $
* $Id: rtpp_command.c,v 1.14 2008/07/17 20:50:36 sobomax Exp $
*
*/

Expand Down Expand Up @@ -827,6 +827,10 @@ handle_command(struct cfg *cf, int controlfd)

rtpp_log_write(RTPP_LOG_INFO, spa->log, "new session on a port %d created, "
"tag %s", lport, from_tag);
if (cf->record_all != 0) {
handle_record(cf, spa, 0, NULL);
handle_record(cf, spa, 1, NULL);
}
}

if (op == UPDATE) {
Expand Down
3 changes: 2 additions & 1 deletion rtpp_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: rtpp_defines.h,v 1.15 2008/07/16 20:42:21 sobomax Exp $
* $Id: rtpp_defines.h,v 1.16 2008/07/17 20:50:36 sobomax Exp $
*
*/

Expand Down Expand Up @@ -109,6 +109,7 @@ struct cfg {
const char *rdir;
const char *sdir;
int record_pcap; /* Record in the PCAP format? */
int record_all; /* Record everything */

int rrtcp; /* Whether or not to relay RTCP? */
rtpp_log_t glog;
Expand Down

0 comments on commit f73b8a1

Please sign in to comment.