Browse Source

Merge branch 'stop-recording' of https://github.com/1and1/rtpengine

changes/83/15683/1
Richard Fuchs 8 years ago
parent
commit
523228b981
5 changed files with 34 additions and 1 deletions
  1. +9
    -0
      README.md
  2. +18
    -0
      daemon/call_interfaces.c
  3. +2
    -1
      daemon/cli.c
  4. +4
    -0
      daemon/control_ng.c
  5. +1
    -0
      daemon/control_ng.h

+ 9
- 0
README.md View File

@ -777,6 +777,7 @@ a string and determines the type of message. Currently the following commands ar
* delete * delete
* query * query
* start recording * start recording
* stop recording
The response dictionary must contain at least one key called `result`. The value can be either `ok` or `error`. The response dictionary must contain at least one key called `result`. The value can be either `ok` or `error`.
For the `ping` command, the additional value `pong` is allowed. If the result is `error`, then another key For the `ping` command, the additional value `pong` is allowed. If the result is `error`, then another key
@ -1451,3 +1452,11 @@ call legs, therefore all keys other than `call-id` are currently ignored.
If the chosen recording method doesn't support in-kernel packet forwarding, enabling call recording If the chosen recording method doesn't support in-kernel packet forwarding, enabling call recording
via this messages will force packet forwarding to happen in userspace only. via this messages will force packet forwarding to happen in userspace only.
`stop recording` Message
-------------------------
The `stop recording` message must contain the key `call-id` as defined above. The reply dictionary contains
no additional keys.
Disables call recording for the call. This can be sent during a call to imediatley stop recording it.

+ 18
- 0
daemon/call_interfaces.c View File

@ -1204,3 +1204,21 @@ const char *call_start_recording_ng(bencode_item_t *input, struct callmaster *m,
return NULL; return NULL;
} }
const char *call_stop_recording_ng(bencode_item_t *input, struct callmaster *m, bencode_item_t *output) {
str callid;
struct call *call;
if (!bencode_dictionary_get_str(input, "call-id", &callid))
return "No call-id in message";
call = call_get_opmode(&callid, m, OP_OTHER);
if (!call)
return "Unknown call-id";
recording_stop(call);
rwlock_unlock_w(&call->master_lock);
obj_put(call);
return NULL;
}

+ 2
- 1
daemon/cli.c View File

@ -185,7 +185,7 @@ static void cli_incoming_list_totals(char* buffer, int len, struct callmaster* m
} }
for (GList *l = list; l; l = l->next) { for (GList *l = list; l; l = l->next) {
struct control_ng_stats* cur = l->data; struct control_ng_stats* cur = l->data;
printlen = snprintf(replybuffer,(outbufend-replybuffer), " %20s | %10u | %10u | %10u | %10u | %10u | %10u | %10u | %10u \n",
printlen = snprintf(replybuffer,(outbufend-replybuffer), " %20s | %10u | %10u | %10u | %10u | %10u | %10u | %10u | %10u | %10u \n",
sockaddr_print_buf(&cur->proxy), sockaddr_print_buf(&cur->proxy),
cur->offer, cur->offer,
cur->answer, cur->answer,
@ -194,6 +194,7 @@ static void cli_incoming_list_totals(char* buffer, int len, struct callmaster* m
cur->list, cur->list,
cur->query, cur->query,
cur->start_recording, cur->start_recording,
cur->stop_recording,
cur->errors); cur->errors);
ADJUSTLEN(printlen,outbufend,replybuffer); ADJUSTLEN(printlen,outbufend,replybuffer);
} }


+ 4
- 0
daemon/control_ng.c View File

@ -229,6 +229,10 @@ static void control_ng_incoming(struct obj *obj, str *buf, const endpoint_t *sin
errstr = call_start_recording_ng(dict, c->callmaster, resp); errstr = call_start_recording_ng(dict, c->callmaster, resp);
g_atomic_int_inc(&cur->start_recording); g_atomic_int_inc(&cur->start_recording);
} }
else if (!str_cmp(&cmd, "stop recording")) {
errstr = call_stop_recording_ng(dict, c->callmaster, resp);
g_atomic_int_inc(&cur->stop_recording);
}
else else
errstr = "Unrecognized command"; errstr = "Unrecognized command";


+ 1
- 0
daemon/control_ng.h View File

@ -19,6 +19,7 @@ struct control_ng_stats {
int query; int query;
int list; int list;
int start_recording; int start_recording;
int stop_recording;
int errors; int errors;
}; };


Loading…
Cancel
Save