diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-28 18:13:35 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-28 18:13:35 (GMT) |
commit | aa5a690bdfe957653f9b44e59e0390cd56e3bb09 (patch) | |
tree | 6f7ad757f5ecfbdb7eb67d84ab10bd706742525b /examples/list-tokens.sh | |
parent | 4213deee2a1a312435c008c506f464a994bcc00e (diff) | |
download | soup-transcoding-proxy-aa5a690bdfe957653f9b44e59e0390cd56e3bb09.zip soup-transcoding-proxy-aa5a690bdfe957653f9b44e59e0390cd56e3bb09.tar.gz |
Add some examples for using the transcoding proxy
Diffstat (limited to 'examples/list-tokens.sh')
-rwxr-xr-x | examples/list-tokens.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/list-tokens.sh b/examples/list-tokens.sh new file mode 100755 index 0000000..1dfc051 --- /dev/null +++ b/examples/list-tokens.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# vim: set sts=2 sw=2 et tw=0 : +# + +HOST="http://localhost:8000" + +caps="application/x-rtp, media=(string)video" +start_port=5004 +end_port=5018 +udp_clients="localhost:$start_port" + +set -e + +add_tokens() { + local id + for port in $(seq $((start_port)) $end_port); do + id=$(date +%H%M%S)-$RANDOM + curl -s -X POST "$HOST/add-token?sessionid=$id&type=http,rtp-udp&udp-clients=localhost:$port" + done +} + +list_tokens() { + curl -s -X GET "$HOST/list-tokens" + echo +} + +revoke_tokens() { + local id + list_sessionids | while read id; do + curl -s -X DELETE "$HOST/revoke-token?sessionid=$id" + done +} + +list_tokens |