From e26c9ed12ad4b6d791d0690f388fc68a9c79cab1 Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Sat, 25 Sep 2010 10:26:24 +0000 Subject: [PATCH] Don't use codecs which are not defined in older asterisk versions. --- chan_capi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/chan_capi.c b/chan_capi.c index 23bdf9d..5ddafd8 100644 --- a/chan_capi.c +++ b/chan_capi.c @@ -4414,17 +4414,20 @@ static void capidev_handle_facility_indication(_cmsg *CMSG, unsigned int PLCI, u static int pbx_capi_get_samples (struct capi_pvt *i, int length) { switch (i->codec) { case AST_FORMAT_SLINEAR: +#if defined(AST_FORMAT_SLINEAR16) case AST_FORMAT_SLINEAR16: +#endif return (length/2); - case AST_FORMAT_G722: return (length*2); - +#if defined(AST_FORMAT_SIREN7) case AST_FORMAT_SIREN7: return (length * (320 / 80)); - +#endif +#if defined(AST_FORMAT_SIREN14) case AST_FORMAT_SIREN14: return ((typeof(length)) length * ((float) 640 / 120)); +#endif } return (length);