[asterisk-commits] oej: branch 1.2 r47743 - /branches/1.2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 16 09:44:57 MST 2006


Author: oej
Date: Thu Nov 16 10:44:56 2006
New Revision: 47743

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47743
Log:
Don't fixup if we haven't got PVT. Suggestion from Martin Vit on -dev mailing list inspired
by file's commit to chan_local.

"This shouldn't happen" ;-)

Modified:
    branches/1.2/channels/chan_sip.c

Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?view=diff&rev=47743&r1=47742&r2=47743
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Thu Nov 16 10:44:56 2006
@@ -2619,6 +2619,11 @@
 static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct sip_pvt *p = newchan->tech_pvt;
+	if (!p) {
+		ast_log(LOG_WARNING, "No pvt after masquerade. Strange things may happen\n");
+		return -1;
+	}
+
 	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);



More information about the asterisk-commits mailing list