From 43b15cd14a257e0c221e6f9b1f4291a482143c65 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Tue, 15 Nov 2005 14:10:51 +0000 Subject: [PATCH] - adapted to latest asterisk bridge function prototype. --- chan_capi.c | 14 ++++++++++---- create_config.sh | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/chan_capi.c b/chan_capi.c index 655caa7..0102d82 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -1340,7 +1340,11 @@ static int line_interconnect(struct ast_capi_pvt *i0, struct ast_capi_pvt *i1, i */ static CC_BRIDGE_RETURN capi_bridge(struct ast_channel *c0, struct ast_channel *c1, - int flags, struct ast_frame **fo, struct ast_channel **rc) + int flags, struct ast_frame **fo, struct ast_channel **rc +#ifdef CC_AST_BRIDGE_WITH_TIMEOUTMS + , int timeoutms +#endif + ) { struct ast_capi_pvt *i0 = CC_AST_CHANNEL_PVT(c0); struct ast_capi_pvt *i1 = CC_AST_CHANNEL_PVT(c1); @@ -1378,12 +1382,14 @@ static CC_BRIDGE_RETURN capi_bridge(struct ast_channel *c0, struct ast_channel *c0_priority[2] = {c0, c1}; struct ast_channel *c1_priority[2] = {c1, c0}; int priority = 0; - int to; struct ast_frame *f; struct ast_channel *who; +#ifndef CC_AST_BRIDGE_WITH_TIMEOUTMS + int timeoutms; - to = -1; - who = ast_waitfor_n(priority ? c0_priority : c1_priority, 2, &to); + timeoutms = -1; +#endif + who = ast_waitfor_n(priority ? c0_priority : c1_priority, 2, &timeoutms); if (!who) { ast_log(LOG_DEBUG, "Ooh, empty read...\n"); continue; diff --git a/create_config.sh b/create_config.sh index 818e7a0..5fd1d33 100755 --- a/create_config.sh +++ b/create_config.sh @@ -58,6 +58,14 @@ else echo " * no 'ast_bridge_result'" fi +if grep -q "struct ast_channel \*\*rc, int timeoutms" $INCLUDEDIR/channel.h; then + echo "#define CC_AST_BRIDGE_WITH_TIMEOUTMS" >>$CONFIGFILE + echo " * found bridge with timeoutms" +else + echo "#undef CC_AST_BRIDGE_WITH_TIMEOUTMS" >>$CONFIGFILE + echo " * no timeoutms in bridge" +fi + if grep -q "ast_dsp_process*needlock" $INCLUDEDIR/dsp.h; then echo "#define CC_AST_DSP_PROCESS_NEEDLOCK" >>$CONFIGFILE echo " * ast_dsp_process() needs 'needlock'"