diff --git a/daemon/bencode.h b/daemon/bencode.h index 871a805a7..943d37361 100644 --- a/daemon/bencode.h +++ b/daemon/bencode.h @@ -234,6 +234,11 @@ static inline char *bencode_dictionary_get_string(bencode_item_t *dict, const ch * may be NULL. */ static inline char *bencode_dictionary_get_str(bencode_item_t *dict, const char *key, str *str); +/* Looks up the given key in the dictionary and compares the corresponding value to the given + * null-terminated string. Returns 2 if the key isn't found or if the value isn't a string, otherwise + * returns according to strcmp(). */ +static inline int bencode_dictionary_get_strcmp(bencode_item_t *dict, const char *key, const char *str); + /* Identical to bencode_dictionary_get() but returns the string in a newly allocated buffer (using the * BENCODE_MALLOC function), which remains valid even after bencode_buffer_t is destroyed. */ static inline char *bencode_dictionary_get_string_dup(bencode_item_t *dict, const char *key, int *len); @@ -375,5 +380,12 @@ static inline int bencode_strcmp(bencode_item_t *a, const char *b) { return 1; return memcmp(a->iov[1].iov_base, b, len); } +static inline int bencode_dictionary_get_strcmp(bencode_item_t *dict, const char *key, const char *str) { + bencode_item_t *i; + i = bencode_dictionary_get(dict, key); + if (!i) + return 2; + return bencode_strcmp(i, str); +} #endif diff --git a/debian/ngcp-mediaproxy-ng-daemon.default b/debian/ngcp-mediaproxy-ng-daemon.default index f93e5c1a6..e79cf7098 100644 --- a/debian/ngcp-mediaproxy-ng-daemon.default +++ b/debian/ngcp-mediaproxy-ng-daemon.default @@ -1,6 +1,7 @@ RUN_MEDIAPROXY=no LISTEN_TCP=25060 LISTEN_UDP=12222 +LISTEN_UDP=22222 # ADDRESS=... # ADV_ADDRESS=... # ADDRESS_IPV6=... diff --git a/debian/ngcp-mediaproxy-ng-daemon.init b/debian/ngcp-mediaproxy-ng-daemon.init index e886aa4d6..9b0af6a29 100755 --- a/debian/ngcp-mediaproxy-ng-daemon.init +++ b/debian/ngcp-mediaproxy-ng-daemon.init @@ -46,6 +46,7 @@ OPTIONS="" [ -z "$ADDRESS" ] || OPTIONS="$OPTIONS --ip=$ADDRESS" [ -z "$LISTEN_TCP" ] || OPTIONS="$OPTIONS --listen-tcp=$LISTEN_TCP" [ -z "$LISTEN_UDP" ] || OPTIONS="$OPTIONS --listen-udp=$LISTEN_UDP" +[ -z "$LISTEN_NG" ] || OPTIONS="$OPTIONS --listen-ng=$LISTEN_NG" [ -z "$TIMEOUT" ] || OPTIONS="$OPTIONS --timeout=$TIMEOUT" [ -z "$SILENT_TIMEOUT" ] || OPTIONS="$OPTIONS --silent-timeout=$SILENT_TIMEOUT" [ -z "$PIDFILE" ] || OPTIONS="$OPTIONS --pidfile=$PIDFILE"