summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-04-10 20:18:14 +0000
committerOlle Johansson <oej@edvina.net>2006-04-10 20:18:14 +0000
commit26198e88265f5c6bbf12a28ceb73981ee0cbf7bc (patch)
tree56b153515a378dc71c7560eee3ff3e871ddb194e /channels/chan_sip.c
parent8b1543974f2f568a5462afcf838d7ad382b95284 (diff)
Fixup fixup - add some debugging and error handling
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@18940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 8539dd61b..ab47ac4cf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2674,13 +2674,20 @@ static int sip_write(struct ast_channel *ast, struct ast_frame *frame)
static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
{
int ret = -1;
- struct sip_pvt *p = newchan->tech_pvt;
+ struct sip_pvt *p;
+
+ if (!newchan || !newchan->tech_pvt) {
+ ast_log(LOG_WARNING, "No SIP tech_pvt! Fixup of %s failed.\n", oldchan->name);
+ return -1;
+ }
+ p = newchan->tech_pvt;
ast_mutex_lock(&p->lock);
if (p->owner != oldchan)
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
else {
p->owner = newchan;
+ append_history(p, "Masq", "Old channel: %s\n", oldchan->name);
ret = 0;
}
ast_mutex_unlock(&p->lock);