Fix chan_modem_i4l (bug #3410)
[asterisk/asterisk.git] / channels / chan_modem_i4l.c
index 2e97ee4..d236ce7 100755 (executable)
@@ -420,7 +420,7 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
                                                if (!f)
                                                        return NULL;
                                        } else {
-                                               *(b++) = AST_A2LIN(result[x]);
+                                               *(b++) = AST_ALAW(result[x]);
                                                p->obuflen += 2;
                                        }
                                }
@@ -480,7 +480,7 @@ static int i4l_write(struct ast_modem_pvt *p, struct ast_frame *f)
                return -1;
        }
        for (x=0;x<f->datalen/2;x++) {
-               b = AST_ALAW(((short *)f->data)[x]);
+               b = AST_LIN2A(((short *)f->data)[x]);
                result[bpos++] = b;
                if (b == CHAR_DLE)
                        result[bpos++]=b;