[svn-commits] trunk r18940 - /trunk/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Mon Apr 10 13:18:16 MST 2006
Author: oej
Date: Mon Apr 10 15:18:14 2006
New Revision: 18940
URL: http://svn.digium.com/view/asterisk?rev=18940&view=rev
Log:
Fixup fixup - add some debugging and error handling
Modified:
trunk/channels/chan_sip.c
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=18940&r1=18939&r2=18940&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Apr 10 15:18:14 2006
@@ -2674,13 +2674,20 @@
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);
More information about the svn-commits
mailing list