diff options
author | mattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-12 16:22:00 +0000 |
---|---|---|
committer | mattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-12 16:22:00 +0000 |
commit | f245073f7b7545a0504cb0be13d1123b84d7c3ce (patch) | |
tree | 9c7ee4276db3ff8ae8172a906292d8ce81ead830 /channels | |
parent | ffe3d448f05eaa980ff8e9e4c72d72f96e3ab1e5 (diff) |
Make sure we start incoming calls on SS7 with echo cancellation enabled. Also make sure when completing a COT we call ss7_start_call with the proper locks held. Lastly, make sure if we fail to get a channel from zt_new that we don't assume it's there.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@114094 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_zap.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 697f3fe3b..5668b4ad2 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -9115,6 +9115,7 @@ static void zt_loopback(struct zt_pvt *p, int enable) } } +/* XXX: This function is assumed to be called with the private channel lock and linkset lock held */ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset) { struct ss7 *ss7 = linkset->ss7; @@ -9140,11 +9141,16 @@ static void ss7_start_call(struct zt_pvt *p, struct zt_ss7 *linkset) ast_mutex_unlock(&linkset->lock); c = zt_new(p, AST_STATE_RING, 1, SUB_REAL, law, 0); - ast_mutex_lock(&linkset->lock); - if (c) - ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic); - else + + if (!c) { ast_log(LOG_WARNING, "Unable to start PBX on CIC %d\n", p->cic); + return; + } else + ast_verb(3, "Accepting call to '%s' on CIC %d\n", p->exten, p->cic); + + ast_mutex_lock(&linkset->lock); + + zt_enable_ec(p); if (!ast_strlen_zero(p->charge_number)) { pbx_builtin_setvar_helper(c, "SS7_CHARGE_NUMBER", p->charge_number); @@ -9507,11 +9513,15 @@ static void *ss7_linkset(void *data) } p = linkset->pvts[chanpos]; + ast_mutex_lock(&p->lock); + if (p->loopedback) { zt_loopback(p, 0); ss7_start_call(p, linkset); } + ast_mutex_unlock(&p->lock); + break; case ISUP_EVENT_CCR: ast_debug(1, "Got CCR request on CIC %d\n", e->ccr.cic); |