From: Sean Bright Date: Wed, 15 Feb 2012 18:22:56 +0000 (+0000) Subject: Only use maxtrunkcall and maxnontrunkcall in chan_iax2 if IAX_OLD_FIND is specified. X-Git-Tag: 10.3.0-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1e1d5e48d876c82a87657d81082b8d055f43e36;p=thirdparty%2Fasterisk.git Only use maxtrunkcall and maxnontrunkcall in chan_iax2 if IAX_OLD_FIND is specified. These variables are only accessed from the IAX_OLD_FIND path, so there is no reason to keep them updated otherwise. ........ Merged revisions 355458 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@355467 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index e29449fdc7..b997efd5a4 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1161,9 +1161,6 @@ static void __attribute__((format(printf, 1, 2))) jb_debug_output(const char *fm ast_verbose("%s", buf); } -static int maxtrunkcall = TRUNK_CALL_START; -static int maxnontrunkcall = 1; - static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms); static int expire_registry(const void *data); static int iax2_answer(struct ast_channel *c); @@ -2081,7 +2078,15 @@ static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short return 0; } -static void update_max_trunk(void) +#ifdef IAX_OLD_FIND + +static int maxtrunkcall = TRUNK_CALL_START; +static int maxnontrunkcall = 1; + +#define update_max_trunk() __update_max_trunk() +#define update_max_nontrunk() __update_max_nontrunk() + +static void __update_max_trunk(void) { int max = TRUNK_CALL_START; int x; @@ -2098,7 +2103,7 @@ static void update_max_trunk(void) ast_debug(1, "New max trunk callno is %d\n", max); } -static void update_max_nontrunk(void) +static void __update_max_nontrunk(void) { int max = 1; int x; @@ -2112,6 +2117,13 @@ static void update_max_nontrunk(void) ast_debug(1, "New max nontrunk callno is %d\n", max); } +#else + +#define update_max_trunk() do { } while (0) +#define update_max_nontrunk() do { } while (0) + +#endif + static int make_trunk(unsigned short callno, int locked) { int x;