summaryrefslogtreecommitdiff
path: root/channels/sig_pri.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2010-06-07 20:04:42 +0000
committerRichard Mudgett <rmudgett@digium.com>2010-06-07 20:04:42 +0000
commit0122ccd29ca5c3c5840143b55e58e6bb1d98793e (patch)
tree9bba1c89c97de2eb935ef6c15c3b3d65e764e9bb /channels/sig_pri.c
parent17bd11b8aada4827580aec9d41abc5b8d0a836cc (diff)
Extract sig_ss7 out of chan_dahdi.
Extract the SS7 specific code out of chan_dahdi like what was done to ISDN/PRI and analog signaling. The new SS7 structures were modeled on sig_pri. The changes to sig_pri are an enhancement and a bug fix made possible because SS7 was extracted. 1) The sig_pri TRANSFERCAPABILITY channel variable should have been set unconditionally in sig_pri_new_ast_channel(). 2) SS7/PRI transfer capability interaction in dahdi_new() fixed because of SS7 extraction. 3) Module ref count error in dahdi_new() if startpbx failed to start the PBX for some reason. Review: https://reviewboard.asterisk.org/r/661/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/sig_pri.c')
-rw-r--r--channels/sig_pri.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/channels/sig_pri.c b/channels/sig_pri.c
index 09bd0773d..5af0974eb 100644
--- a/channels/sig_pri.c
+++ b/channels/sig_pri.c
@@ -786,12 +786,12 @@ static int sig_pri_play_tone(struct sig_pri_chan *p, enum sig_pri_tone tone)
return -1;
}
-static struct ast_channel *sig_pri_new_ast_channel(struct sig_pri_chan *p, int state, int startpbx, int ulaw, int transfercapability, char *exten, const struct ast_channel *requestor)
+static struct ast_channel *sig_pri_new_ast_channel(struct sig_pri_chan *p, int state, int ulaw, int transfercapability, char *exten, const struct ast_channel *requestor)
{
struct ast_channel *c;
if (p->calls->new_ast_channel)
- c = p->calls->new_ast_channel(p->chan_pvt, state, startpbx, ulaw, transfercapability, exten, requestor);
+ c = p->calls->new_ast_channel(p->chan_pvt, state, ulaw, exten, requestor);
else
return NULL;
@@ -799,9 +799,10 @@ static struct ast_channel *sig_pri_new_ast_channel(struct sig_pri_chan *p, int s
p->owner = c;
p->isidlecall = 0;
p->alreadyhungup = 0;
+ c->transfercapability = transfercapability;
+ pbx_builtin_setvar_helper(c, "TRANSFERCAPABILITY",
+ ast_transfercapability2str(transfercapability));
if (transfercapability & AST_TRANS_CAP_DIGITAL) {
- c->transfercapability = transfercapability;
- pbx_builtin_setvar_helper(c, "TRANSFERCAPABILITY", ast_transfercapability2str(transfercapability));
sig_pri_set_digital(p, 1);
}
if (p->pri && !pri_grab(p, p->pri)) {
@@ -841,7 +842,7 @@ struct ast_channel *sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law
ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
p->outgoing = 1;
- ast = sig_pri_new_ast_channel(p, AST_STATE_RESERVED, 0, law, transfercapability, p->exten, requestor);
+ ast = sig_pri_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
if (!ast) {
p->outgoing = 0;
}
@@ -4504,7 +4505,7 @@ static void *pri_dchannel(void *vpri)
*/
ast_mutex_unlock(&pri->lock);
c = sig_pri_new_ast_channel(pri->pvts[chanpos],
- AST_STATE_RESERVED, 0,
+ AST_STATE_RESERVED,
(e->ring.layer1 == PRI_LAYER_1_ALAW)
? SIG_PRI_ALAW : SIG_PRI_ULAW,
e->ring.ctype, pri->pvts[chanpos]->exten, NULL);
@@ -4597,7 +4598,7 @@ static void *pri_dchannel(void *vpri)
*/
ast_mutex_unlock(&pri->lock);
c = sig_pri_new_ast_channel(pri->pvts[chanpos],
- AST_STATE_RING, 0,
+ AST_STATE_RING,
(e->ring.layer1 == PRI_LAYER_1_ALAW)
? SIG_PRI_ALAW : SIG_PRI_ULAW, e->ring.ctype,
pri->pvts[chanpos]->exten, NULL);