diff options
Diffstat (limited to 'addons/chan_ooh323.c')
-rw-r--r-- | addons/chan_ooh323.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index ffdbf6721..4ab90be3a 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -355,6 +355,7 @@ static int gDTMFCodec = 101; static int gFAXdetect = FAXDETECT_CNG; static int gT38Support = T38_FAXGW; static char gGatekeeper[100]; +static char gRASIP[2+8*4+7]; /* Max for IPv6 addr */ static enum RasGatekeeperMode gRasGkMode = RasNoGatekeeper; static int gIsGateway = 0; @@ -1281,7 +1282,7 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d struct ooh323_pvt *p = (struct ooh323_pvt *) ast_channel_tech_pvt(ast); char *callToken = (char *)NULL; - int res = -1; + int res = -1, rres; if (!p) return -1; @@ -1328,11 +1329,9 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d case AST_CONTROL_PROGRESS: if (ast_channel_state(ast) != AST_STATE_UP) { if (!p->progsent) { + rres = ooManualProgress(callToken); if (gH323Debug) { - ast_debug(1, "Sending manual progress for %s, res = %u\n", callToken, - ooManualProgress(callToken)); - } else { - ooManualProgress(callToken); + ast_debug(1, "Sending manual progress for %s, res = %u\n", callToken, rres); } p->progsent = 1; } @@ -1341,12 +1340,9 @@ static int ooh323_indicate(struct ast_channel *ast, int condition, const void *d case AST_CONTROL_RINGING: if (ast_channel_state(ast) == AST_STATE_RING || ast_channel_state(ast) == AST_STATE_RINGING) { if (!p->alertsent) { + rres = ooManualRingback(callToken); if (gH323Debug) { - ast_debug(1, "Sending manual ringback for %s, res = %u\n", - callToken, - ooManualRingback(callToken)); - } else { - ooManualRingback(callToken); + ast_debug(1, "Sending manual ringback for %s, res = %u\n", callToken, rres); } p->alertsent = 1; } @@ -2726,7 +2722,7 @@ static int ooh323_do_reload(void) if (gRasGkMode == RasUseSpecificGatekeeper || gRasGkMode == RasDiscoverGatekeeper) { ooGkClientInit(gRasGkMode, (gRasGkMode == RasUseSpecificGatekeeper) ? - gGatekeeper : 0, 0); + gGatekeeper : 0, gRASIP, 0); ooGkClientStart(gH323ep.gkClient); } @@ -2869,6 +2865,7 @@ int reload_config(int reload) gTRCLVL = OOTRCLVLERR; gRasGkMode = RasNoGatekeeper; gGatekeeper[0] = '\0'; + gRASIP[0] = '\0'; gRTPTimeout = 60; gNat = FALSE; gRTDRInterval = 0; @@ -3029,6 +3026,9 @@ int reload_config(int reload) gRasGkMode = RasUseSpecificGatekeeper; ast_copy_string(gGatekeeper, v->value, sizeof(gGatekeeper)); } + } else if (!strcasecmp(v->name, "localras")) { + ast_copy_string(gRASIP, v->value, sizeof(gRASIP)); + ast_verb(3, " == Setting RAS IP to %s\n", gRASIP); } else if (!strcasecmp(v->name, "logfile")) { ast_copy_string(gLogFile, v->value, sizeof(gLogFile)); } else if (!strcasecmp(v->name, "context")) { @@ -3924,9 +3924,9 @@ static int load_module(void) /* Gatekeeper */ if (gRasGkMode == RasUseSpecificGatekeeper) - ooGkClientInit(gRasGkMode, gGatekeeper, 0); + ooGkClientInit(gRasGkMode, gGatekeeper, gRASIP, 0); else if (gRasGkMode == RasDiscoverGatekeeper) - ooGkClientInit(gRasGkMode, 0, 0); + ooGkClientInit(gRasGkMode, 0, gRASIP, 0); /* Register callbacks */ ooH323EpSetH323Callbacks(h323Callbacks); @@ -4013,7 +4013,7 @@ static void *do_monitor(void *data) ooGkClientDestroy(); ast_verb(0, "Restart stopped gatekeeper client\n"); ooGkClientInit(gRasGkMode, (gRasGkMode == RasUseSpecificGatekeeper) ? - gGatekeeper : 0, 0); + gGatekeeper : 0, gRASIP, 0); ooGkClientStart(gH323ep.gkClient); } @@ -5053,9 +5053,7 @@ struct ast_frame *ooh323_rtp_read(struct ast_channel *ast, struct ooh323_pvt *p) ast_log(LOG_NOTICE, "Failed to async goto '%s' into fax of '%s'\n", ast_channel_name(p->owner),target_context); } p->faxdetected = 1; - if (dfr) { - ast_frfree(dfr); - } + ast_frfree(dfr); return &ast_null_frame; } } |