From: Alexandr Anikin Date: Fri, 31 May 2013 09:00:01 +0000 (+0000) Subject: reject call attempts when gatekeeper is configured but not registered X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e1fedf1ef43573f64e763e9abfc1d52c8ca0e10;p=thirdparty%2Fasterisk.git reject call attempts when gatekeeper is configured but not registered (closes issue ASTERISK-21800) Reported by: Dmitry Melekhov Patches: ASTERISK-21800-1.patch Tested by: Dmitry Melekhov ........ Merged revisions 390181 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@390223 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index e68e4b49de..4e471df8f2 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -295,6 +295,8 @@ int onCallEstablished(ooCallData *call); int onCallCleared(ooCallData *call); void onModeChanged(ooCallData *call, int t38mode); +extern OOH323EndPoint gH323ep; + static char gLogFile[256] = DEFAULT_LOGFILE; static int gPort = 1720; static char gIP[2+8*4+7]; /* Max for IPv6 addr */ @@ -623,6 +625,7 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca ooh323_destroy(p); ast_mutex_unlock(&iflock); ast_log(LOG_ERROR, "Destination format is not supported\n"); + *cause = AST_CAUSE_INVALID_NUMBER_FORMAT; return NULL; } @@ -667,6 +670,10 @@ static struct ast_channel *ooh323_request(const char *type, struct ast_format_ca ooh323_destroy(p); ast_mutex_unlock(&iflock); return NULL; + } else if (gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered) { + ast_log(LOG_ERROR, "Gatekeeper client is configured but not registered\n"); + *cause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE; + return NULL; } p->g729onlyA = g729onlyA; p->dtmfmode = gDTMFMode;