Skip to content

Commit

Permalink
rtpengine: allow flags to be sent to rtpengine_stop/start_recording
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Jun 7, 2019
1 parent 1aa3e9b commit 12385b4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
14 changes: 12 additions & 2 deletions modules/rtpengine/doc/rtpengine_admin.xml
Expand Up @@ -801,7 +801,7 @@ rtpengine_manage();

<section id="func_rtpengine_start_recording" xreflabel="rtpengine_start_recording()">
<title>
<function moreinfo="none">rtpengine_start_recording([sock_var])</function>
<function moreinfo="none">rtpengine_start_recording([flags [, sock_var]])</function>
</title>
<para>
This function will send a signal to the &rtp; proxy to record
Expand All @@ -810,6 +810,11 @@ rtpengine_manage();
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem><para>
<emphasis>flags(string, optional)</emphasis> - flags used to change the behavior
of the recorder. An importat value to set is the <emphasis>call-id</emphasis>
value, which can be used to start recording a different call than the requested one.
</para></listitem>
<listitem><para>
<emphasis>sock_var(var, optional)</emphasis> - variable used to store the rtpengine
socket chosen for this call.
</para></listitem>
Expand All @@ -829,7 +834,7 @@ rtpengine_start_recording();

<section id="func_rtpengine_stop_recording" xreflabel="rtpengine_stop_recording()">
<title>
<function moreinfo="none">rtpengine_stop_recording([sock_var])</function>
<function moreinfo="none">rtpengine_stop_recording([flags [, sock_var]])</function>
</title>
<para>
This function will send a signal to the &rtp; proxy to stop
Expand All @@ -838,6 +843,11 @@ rtpengine_start_recording();
<para>Meaning of the parameters is as follows:</para>
<itemizedlist>
<listitem><para>
<emphasis>flags(string, optional)</emphasis> - flags used to change the behavior
of the recorder. An importat value to set is the <emphasis>call-id</emphasis>
value, which can be used to start recording a different call than the requested one.
</para></listitem>
<listitem><para>
<emphasis>sock_var(var, optional)</emphasis> - variable used to store the rtpengine
socket chosen for this call.
</para></listitem>
Expand Down
18 changes: 10 additions & 8 deletions modules/rtpengine/rtpengine.c
Expand Up @@ -242,8 +242,8 @@ static const str stat_maps[] = {

static char *gencookie();
static int rtpe_test(struct rtpe_node*, int, int);
static int start_recording_f(struct sip_msg* msg, pv_spec_t *spvar);
static int stop_recording_f(struct sip_msg* msg, pv_spec_t *spvar);
static int start_recording_f(struct sip_msg* msg, str *flags, pv_spec_t *spvar);
static int stop_recording_f(struct sip_msg* msg, str *flags, pv_spec_t *spvar);
static int rtpengine_offer_f(struct sip_msg *msg, str *flags, pv_spec_t *spvar,
pv_spec_t *bpvar, str *body);
static int rtpengine_answer_f(struct sip_msg *msg, str *flags, pv_spec_t *spvar,
Expand Down Expand Up @@ -343,10 +343,12 @@ static cmd_export_t cmds[] = {
{CMD_PARAM_INT, fixup_set_id, fixup_free_set_id}, {0,0,0}},
ANY_ROUTE},
{"rtpengine_start_recording", (cmd_function)start_recording_f, {
{CMD_PARAM_VAR | CMD_PARAM_OPT, fixup_set_id, fixup_free_set_id}, {0,0,0}},
{CMD_PARAM_STR | CMD_PARAM_OPT, 0, 0},
{CMD_PARAM_VAR | CMD_PARAM_OPT, 0, 0}, {0,0,0}},
ANY_ROUTE},
{"rtpengine_stop_recording", (cmd_function)stop_recording_f, {
{CMD_PARAM_VAR | CMD_PARAM_OPT, fixup_set_id, fixup_free_set_id}, {0,0,0}},
{CMD_PARAM_STR | CMD_PARAM_OPT, 0, 0},
{CMD_PARAM_VAR | CMD_PARAM_OPT, 0, 0}, {0,0,0}},
ANY_ROUTE},
{"rtpengine_offer", (cmd_function)rtpengine_offer_f, {
{CMD_PARAM_STR | CMD_PARAM_OPT, 0, 0},
Expand Down Expand Up @@ -2611,15 +2613,15 @@ rtpengine_offer_answer(struct sip_msg *msg, str *flags,


static int
start_recording_f(struct sip_msg* msg, pv_spec_t *spvar)
start_recording_f(struct sip_msg* msg, str *flags, pv_spec_t *spvar)
{
return rtpe_function_call_simple(msg, OP_START_RECORDING, NULL, spvar);
return rtpe_function_call_simple(msg, OP_START_RECORDING, flags, spvar);
}

static int
stop_recording_f(struct sip_msg* msg, pv_spec_t *spvar)
stop_recording_f(struct sip_msg* msg, str *flags, pv_spec_t *spvar)
{
return rtpe_function_call_simple(msg, OP_STOP_RECORDING, NULL, spvar);
return rtpe_function_call_simple(msg, OP_STOP_RECORDING, flags, spvar);
}

/**
Expand Down

0 comments on commit 12385b4

Please sign in to comment.