From: Olle Johansson Date: Wed, 21 Jun 2006 07:13:20 +0000 (+0000) Subject: Finally fix parking and go back to metermaids X-Git-Tag: 1.4.0-beta1~830 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a85fec94fd7ee406b969a84a62079fbdbbf6fd5e;p=thirdparty%2Fasterisk.git Finally fix parking and go back to metermaids git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35209 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 92a3717059..be54099912 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -11967,6 +11967,10 @@ static void *sip_park_thread(void *stuff) copy_request(&req, &d->req); free(d); + if (!transferee || !transferer) { + ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "" : "", transferee ? "" : "" ); + return; + } if (option_debug > 3) ast_log(LOG_DEBUG, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name); @@ -12088,7 +12092,8 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct d->chan1 = transferee; /* Transferee */ d->chan2 = transferer; /* Transferer */ d->seqno = seqno; - if (!ast_pthread_create(&th, NULL, sip_park_thread, d)) { + if (ast_pthread_create(&th, NULL, sip_park_thread, d) < 0) { + /* Could not start thread */ free(d); /* We don't need it anymore. If thread is created, d will be free'd by sip_park_thread() */ return 0;