Skip to content
Snippets Groups Projects
Commit 71757089 authored by Richard Mudgett's avatar Richard Mudgett
Browse files

Add missing API function to sig_ss7: sig_ss7_fixup().

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 6c6260d4
Branches
Tags
No related merge requests found
...@@ -7074,27 +7074,34 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan) ...@@ -7074,27 +7074,34 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
{ {
struct dahdi_pvt *p = newchan->tech_pvt; struct dahdi_pvt *p = newchan->tech_pvt;
int x; int x;
ast_mutex_lock(&p->lock); ast_mutex_lock(&p->lock);
ast_debug(1, "New owner for channel %d is %s\n", p->channel, newchan->name); ast_debug(1, "New owner for channel %d is %s\n", p->channel, newchan->name);
if (p->owner == oldchan) { if (p->owner == oldchan) {
p->owner = newchan; p->owner = newchan;
} }
for (x = 0; x < 3; x++) for (x = 0; x < 3; x++) {
if (p->subs[x].owner == oldchan) { if (p->subs[x].owner == oldchan) {
if (!x) if (!x) {
dahdi_unlink(NULL, p, 0); dahdi_unlink(NULL, p, 0);
}
p->subs[x].owner = newchan; p->subs[x].owner = newchan;
} }
}
if (analog_lib_handles(p->sig, p->radio, p->oprmode)) { if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
analog_fixup(oldchan, newchan, p->sig_pvt); analog_fixup(oldchan, newchan, p->sig_pvt);
} #if defined(HAVE_PRI)
#ifdef HAVE_PRI } else if (dahdi_sig_pri_lib_handles(p->sig)) {
else if (dahdi_sig_pri_lib_handles(p->sig)) {
sig_pri_fixup(oldchan, newchan, p->sig_pvt); sig_pri_fixup(oldchan, newchan, p->sig_pvt);
#endif /* defined(HAVE_PRI) */
#if defined(HAVE_SS7)
} else if (p->sig == SIG_SS7) {
sig_ss7_fixup(oldchan, newchan, p->sig_pvt);
#endif /* defined(HAVE_SS7) */
} }
#endif
update_conf(p); update_conf(p);
ast_mutex_unlock(&p->lock); ast_mutex_unlock(&p->lock);
   
if (newchan->_state == AST_STATE_RINGING) { if (newchan->_state == AST_STATE_RINGING) {
......
...@@ -1434,6 +1434,23 @@ int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast) ...@@ -1434,6 +1434,23 @@ int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast)
return res; return res;
} }
/*!
* \brief Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links.
* \since 1.8
*
* \param oldchan Old channel pointer to replace.
* \param newchan New channel pointer to set.
* \param pchan Signaling private structure pointer.
*
* \return Nothing
*/
void sig_ss7_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_ss7_chan *pchan)
{
if (pchan->owner == oldchan) {
pchan->owner = newchan;
}
}
/*! /*!
* \brief SS7 answer channel. * \brief SS7 answer channel.
* \since 1.8 * \since 1.8
......
...@@ -248,6 +248,7 @@ int sig_ss7_available(struct sig_ss7_chan *p); ...@@ -248,6 +248,7 @@ int sig_ss7_available(struct sig_ss7_chan *p);
int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, char *rdest); int sig_ss7_call(struct sig_ss7_chan *p, struct ast_channel *ast, char *rdest);
int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast); int sig_ss7_hangup(struct sig_ss7_chan *p, struct ast_channel *ast);
int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast); int sig_ss7_answer(struct sig_ss7_chan *p, struct ast_channel *ast);
void sig_ss7_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_ss7_chan *pchan);
int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen); int sig_ss7_indicate(struct sig_ss7_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen);
struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law, const struct ast_channel *requestor, int transfercapability); struct ast_channel *sig_ss7_request(struct sig_ss7_chan *p, enum sig_ss7_law law, const struct ast_channel *requestor, int transfercapability);
void sig_ss7_chan_delete(struct sig_ss7_chan *doomed); void sig_ss7_chan_delete(struct sig_ss7_chan *doomed);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment