summaryrefslogtreecommitdiff
path: root/channels/sig_ss7.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2011-01-25 17:58:00 +0000
committerRichard Mudgett <rmudgett@digium.com>2011-01-25 17:58:00 +0000
commit7889af7cab950b993917d1d727780c1eb95c829d (patch)
tree499850d8134de75af8b2dfeae4ded166f73f19cb /channels/sig_ss7.c
parentd3c7a689824848475c49f57e0f53a0c0ee51908f (diff)
Merged revisions 303771 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r303771 | rmudgett | 2011-01-25 11:49:20 -0600 (Tue, 25 Jan 2011) | 54 lines Merged revisions 303769 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ................ r303769 | rmudgett | 2011-01-25 11:42:42 -0600 (Tue, 25 Jan 2011) | 47 lines Merged revisions 303765 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r303765 | rmudgett | 2011-01-25 11:36:50 -0600 (Tue, 25 Jan 2011) | 40 lines Sending out unnecessary PROCEEDING messages breaks overlap dialing. Issue #16789 was a good idea. Unfortunately, it breaks overlap dialing through Asterisk. There is not enough information available at this point to know if dialing is complete. The ast_exists_extension(), ast_matchmore_extension(), and ast_canmatch_extension() calls are not adequate to detect a dial through extension pattern of "_9!". Workaround is to use the dialplan Proceeding() application early in non-dial through extensions. * Effectively revert issue #16789. * Allow outgoing overlap dialing to hear dialtone and other early media. A PROGRESS "inband-information is now available" message is now sent after the SETUP_ACKNOWLEDGE message for non-digital calls. An AST_CONTROL_PROGRESS is now generated for incoming SETUP_ACKNOWLEDGE messages for non-digital calls. * Handling of the AST_CONTROL_CONGESTION in chan_dahdi/sig_pri was inconsistent with the cause codes. * Added better protection from sending out of sequence messages by combining several flags into a single enum value representing call progress level. * Added diagnostic messages for deferred overlap digits handling corner cases. (closes issue #17085) Reported by: shawkris (closes issue #18509) Reported by: wimpy Patches: issue18509_early_media_v1.8_v3.patch uploaded by rmudgett (license 664) Expanded upon issue18509_early_media_v1.8_v3.patch to include analog and SS7 because of backporting requirements. Tested by: wimpy, rmudgett ........ ................ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_ss7.c')
-rw-r--r--channels/sig_ss7.c48
1 files changed, 30 insertions, 18 deletions
diff --git a/channels/sig_ss7.c b/channels/sig_ss7.c
index 7e1f76aa4..68ebc5a10 100644
--- a/channels/sig_ss7.c
+++ b/channels/sig_ss7.c
@@ -431,8 +431,10 @@ static void ss7_start_call(struct sig_ss7_chan *p, struct sig_ss7_linkset *links
char tmp[256];
if (!(linkset->flags & LINKSET_FLAG_EXPLICITACM)) {
- p->proceeding = 1;
+ p->call_level = SIG_SS7_CALL_LEVEL_PROCEEDING;
isup_acm(ss7, p->ss7call);
+ } else {
+ p->call_level = SIG_SS7_CALL_LEVEL_SETUP;
}
if (linkset->type == SS7_ITU) {
@@ -451,7 +453,7 @@ static void ss7_start_call(struct sig_ss7_chan *p, struct sig_ss7_linkset *links
ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic);
ast_mutex_lock(&linkset->lock);
isup_rel(linkset->ss7, p->ss7call, -1);
- p->proceeding = 0;
+ p->call_level = SIG_SS7_CALL_LEVEL_IDLE;
p->alreadyhungup = 1;
return;
}
@@ -682,7 +684,9 @@ void *ss7_linkset(void *data)
sig_ss7_lock_private(p);
switch (e->cpg.event) {
case CPG_EVENT_ALERTING:
- p->alerting = 1;
+ if (p->call_level < SIG_SS7_CALL_LEVEL_ALERTING) {
+ p->call_level = SIG_SS7_CALL_LEVEL_ALERTING;
+ }
sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_RINGING);
break;
case CPG_EVENT_PROGRESS:
@@ -925,11 +929,15 @@ void *ss7_linkset(void *data)
sig_ss7_lock_private(p);
sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_PROCEEDING);
- p->proceeding = 1;
+ if (p->call_level < SIG_SS7_CALL_LEVEL_PROCEEDING) {
+ p->call_level = SIG_SS7_CALL_LEVEL_PROCEEDING;
+ }
sig_ss7_set_dialing(p, 0);
/* Send alerting if subscriber is free */
if (e->acm.called_party_status_ind == 1) {
- p->alerting = 1;
+ if (p->call_level < SIG_SS7_CALL_LEVEL_ALERTING) {
+ p->call_level = SIG_SS7_CALL_LEVEL_ALERTING;
+ }
sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_RINGING);
}
sig_ss7_unlock_private(p);
@@ -1033,6 +1041,9 @@ void *ss7_linkset(void *data)
} else {
p = linkset->pvts[chanpos];
sig_ss7_lock_private(p);
+ if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
+ p->call_level = SIG_SS7_CALL_LEVEL_CONNECT;
+ }
sig_ss7_queue_control(linkset, chanpos, AST_CONTROL_ANSWER);
#if 0 /* This code no longer seems to be necessary so I did not convert it. */
if (p->dsp && p->dsp_features) {
@@ -1361,6 +1372,7 @@ int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, char *rdest)
if ((send_far) && ((strncmp("NO", send_far, strlen(send_far))) != 0 ))
(isup_far(p->ss7->ss7, p->ss7call));
+ p->call_level = SIG_SS7_CALL_LEVEL_SETUP;
isup_iam(p->ss7->ss7, p->ss7call);
sig_ss7_set_dialing(p, 1);
ast_setstate(ast, AST_STATE_DIALING);
@@ -1389,10 +1401,9 @@ int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast)
p->owner = NULL;
sig_ss7_set_dialing(p, 0);
+ p->call_level = SIG_SS7_CALL_LEVEL_IDLE;
p->outgoing = 0;
- p->proceeding = 0;
p->progress = 0;
- p->alerting = 0;
p->rlt = 0;
p->exten[0] = '\0';
/* Perform low level hangup if no owner left */
@@ -1435,7 +1446,9 @@ int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast)
int res;
if (!ss7_grab(p, p->ss7)) {
- p->proceeding = 1;
+ if (p->call_level < SIG_SS7_CALL_LEVEL_CONNECT) {
+ p->call_level = SIG_SS7_CALL_LEVEL_CONNECT;
+ }
res = isup_anm(p->ss7->ss7, p->ss7call);
ss7_rel(p->ss7);
} else {
@@ -1484,15 +1497,14 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
res = sig_ss7_play_tone(p, SIG_SS7_TONE_BUSY);
break;
case AST_CONTROL_RINGING:
- if ((!p->alerting) && p->ss7 && !p->outgoing && (chan->_state != AST_STATE_UP)) {
- if (p->ss7->ss7) {
+ if (p->call_level < SIG_SS7_CALL_LEVEL_ALERTING && !p->outgoing) {
+ p->call_level = SIG_SS7_CALL_LEVEL_ALERTING;
+ if (p->ss7 && p->ss7->ss7) {
ss7_grab(p, p->ss7);
-
if ((isup_far(p->ss7->ss7, p->ss7call)) != -1)
p->rlt = 1;
if (p->rlt != 1) /* No need to send CPG if call will be RELEASE */
isup_cpg(p->ss7->ss7, p->ss7call, CPG_EVENT_ALERTING);
- p->alerting = 1;
ss7_rel(p->ss7);
}
}
@@ -1511,11 +1523,11 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
p->rlt = 1;
}
- if (!p->proceeding && p->ss7 && !p->outgoing) {
- if (p->ss7->ss7) {
+ if (p->call_level < SIG_SS7_CALL_LEVEL_PROCEEDING && !p->outgoing) {
+ p->call_level = SIG_SS7_CALL_LEVEL_PROCEEDING;
+ if (p->ss7 && p->ss7->ss7) {
ss7_grab(p, p->ss7);
isup_acm(p->ss7->ss7, p->ss7call);
- p->proceeding = 1;
ss7_rel(p->ss7);
}
}
@@ -1524,11 +1536,11 @@ int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condi
break;
case AST_CONTROL_PROGRESS:
ast_debug(1,"Received AST_CONTROL_PROGRESS on %s\n",chan->name);
- if (!p->progress && p->ss7 && !p->outgoing) {
- if (p->ss7->ss7) {
+ if (!p->progress && p->call_level < SIG_SS7_CALL_LEVEL_ALERTING && !p->outgoing) {
+ p->progress = 1;/* No need to send inband-information progress again. */
+ if (p->ss7 && p->ss7->ss7) {
ss7_grab(p, p->ss7);
isup_cpg(p->ss7->ss7, p->ss7call, CPG_EVENT_INBANDINFO);
- p->progress = 1;
ss7_rel(p->ss7);
/* enable echo canceler here on SS7 calls */
sig_ss7_set_echocanceller(p, 1);