chan_ooh323: Limit outgoinglimit to positive values as intended.
authorAlexander Traud <pabstraud@compuserve.com>
Fri, 5 Jan 2018 12:42:07 +0000 (13:42 +0100)
committerAlexander Traud <pabstraud@compuserve.com>
Fri, 5 Jan 2018 14:02:21 +0000 (08:02 -0600)
ASTERISK-27552

Change-Id: Ifbf9d51e7374ca2e8b27ec568f6770050fc1a854

addons/chan_ooh323.c

index c25c130..1fa721c 100644 (file)
@@ -2604,9 +2604,12 @@ static struct ooh323_peer *build_peer(const char *name, struct ast_variable *v,
                                }
 
                        } else if (!strcasecmp(v->name, "outgoinglimit")) {
-                               peer->outgoinglimit = atoi(v->value);
-                               if (peer->outgoinglimit < 0)
+                               int val = atoi(v->value);
+                               if (val < 0) {
                                        peer->outgoinglimit = 0;
+                               } else {
+                                       peer->outgoinglimit = val;
+                               }
                        } else if (!strcasecmp(v->name, "accountcode")) {
                                ast_copy_string(peer->accountcode, v->value, sizeof(peer->accountcode));
                        } else if (!strcasecmp(v->name, "faststart")) {