Made companding law for SS7 calls only determined by SS7 signaling type.
[asterisk/asterisk.git] / channels / sig_ss7.c
index 0c9b8f5..7958871 100644 (file)
@@ -570,6 +570,7 @@ static void ss7_start_call(struct sig_ss7_chan *p, struct sig_ss7_linkset *links
                p->call_level = SIG_SS7_CALL_LEVEL_SETUP;
        }
 
+       /* Companding law is determined by SS7 signaling type. */
        if (linkset->type == SS7_ITU) {
                law = SIG_SS7_ALAW;
        } else {
@@ -1872,6 +1873,13 @@ struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law
 {
        struct ast_channel *ast;
 
+       /* Companding law is determined by SS7 signaling type. */
+       if (p->ss7->type == SS7_ITU) {
+               law = SIG_SS7_ALAW;
+       } else {
+               law = SIG_SS7_ULAW;
+       }
+
        sig_ss7_set_outgoing(p, 1);
        ast = sig_ss7_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
        if (!ast) {