Fix ring cadance setup for outgoing calls on FXS ports.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 6 Mar 2012 17:47:40 +0000 (17:47 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 6 Mar 2012 17:47:40 +0000 (17:47 +0000)
* Fix referencing the wrong variable in chan_dahdi.c:my_set_cadence().

Thanks to Sean Bright for compiling with -Wshadow and finding this bug.
........

Merged revisions 358377 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 358378 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358379 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c

index d65bb12..6751d0d 100644 (file)
@@ -2254,7 +2254,7 @@ static int my_get_sub_fd(void *pvt, enum analog_sub sub)
        return p->subs[dahdi_sub].dfd;
 }
 
-static void my_set_cadence(void *pvt, int *cidrings, struct ast_channel *ast)
+static void my_set_cadence(void *pvt, int *cid_rings, struct ast_channel *ast)
 {
        struct dahdi_pvt *p = pvt;
 
@@ -2262,11 +2262,11 @@ static void my_set_cadence(void *pvt, int *cidrings, struct ast_channel *ast)
        if ((p->distinctivering > 0) && (p->distinctivering <= num_cadence)) {
                if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, &cadences[p->distinctivering - 1]))
                        ast_log(LOG_WARNING, "Unable to set distinctive ring cadence %d on '%s': %s\n", p->distinctivering, ast_channel_name(ast), strerror(errno));
-               *cidrings = cidrings[p->distinctivering - 1];
+               *cid_rings = cidrings[p->distinctivering - 1];
        } else {
                if (ioctl(p->subs[SUB_REAL].dfd, DAHDI_SETCADENCE, NULL))
                        ast_log(LOG_WARNING, "Unable to reset default ring on '%s': %s\n", ast_channel_name(ast), strerror(errno));
-               *cidrings = p->sendcalleridafter;
+               *cid_rings = p->sendcalleridafter;
        }
 }