Skip to content
Snippets Groups Projects
Commit ce70b28f authored by Doug Bailey's avatar Doug Bailey
Browse files

Insure ring cadence is set for fxs ports

Moved SETCADENCE ioctl call to before call into new analog signal module
to insure that it gets set. 

(closes issue #15381)
Reported by: alecdavis
Patches:
      fix15381.diff uploaded by dbailey (license 819)
Tested by: dbailey



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203126 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent c6a98622
No related branches found
No related tags found
No related merge requests found
...@@ -4154,7 +4154,29 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout) ...@@ -4154,7 +4154,29 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
p->outgoing = 1; p->outgoing = 1;
   
set_actual_gain(p->subs[SUB_REAL].dfd, 0, p->rxgain, p->txgain, p->law); set_actual_gain(p->subs[SUB_REAL].dfd, 0, p->rxgain, p->txgain, p->law);
/* Set the ring cadence */
mysig = p->sig;
if (p->outsigmod > -1)
mysig = p->outsigmod;
switch (mysig) {
case SIG_FXOLS:
case SIG_FXOGS:
case SIG_FXOKS:
if (p->owner == ast) {
/* Choose proper cadence */
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->name, strerror(errno));
p->cidrings = 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->name, strerror(errno));
p->cidrings = p->sendcalleridafter;
}
}
break;
}
/* If this is analog signalling we can exit here */ /* If this is analog signalling we can exit here */
if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
p->callwaitrings = 0; p->callwaitrings = 0;
...@@ -4163,10 +4185,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout) ...@@ -4163,10 +4185,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
return res; return res;
} }
   
mysig = p->sig;
if (p->outsigmod > -1)
mysig = p->outsigmod;
switch (mysig) { switch (mysig) {
case SIG_FXOLS: case SIG_FXOLS:
case SIG_FXOGS: case SIG_FXOGS:
...@@ -4189,17 +4207,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout) ...@@ -4189,17 +4207,6 @@ static int dahdi_call(struct ast_channel *ast, char *rdest, int timeout)
send_callerid(p); send_callerid(p);
} }
} }
/* Choose proper cadence */
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->name, strerror(errno));
p->cidrings = 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->name, strerror(errno));
p->cidrings = p->sendcalleridafter;
}
/* nick@dccinc.com 4/3/03 mods to allow for deferred dialing */ /* nick@dccinc.com 4/3/03 mods to allow for deferred dialing */
c = strchr(dest, '/'); c = strchr(dest, '/');
if (c) if (c)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment