From: Anthony Minessale Date: Tue, 17 Apr 2007 01:26:13 +0000 (+0000) Subject: ... X-Git-Tag: v1.0-beta1~507 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c833f0337736693c1791fae0ae60ad90463d3cc1;p=thirdparty%2Ffreeswitch.git ... git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4954 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c b/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c index 8d7b958597..3d51d7b815 100644 --- a/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c +++ b/src/mod/endpoints/mod_wanpipe/mod_wanpipe.c @@ -1352,9 +1352,11 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p assert(channel != NULL); if (switch_channel_get_state(channel) < CS_HANGUP) { + + tech_pvt = switch_core_session_get_private(session); assert(tech_pvt != NULL); - + chanmap = tech_pvt->spri->private_info; if (!tech_pvt->call) { tech_pvt->call = pevent->hangup.call; } @@ -1362,6 +1364,9 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p tech_pvt->cause = pevent->hangup.cause; switch_set_flag_locked(tech_pvt, TFLAG_HANGUP); switch_channel_hangup(channel, tech_pvt->cause); + switch_mutex_lock(chanmap->mutex); + pri_destroycall(tech_pvt->spri->pri, tech_pvt->call); + switch_mutex_unlock(chanmap->mutex); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Hanging up channel s%dc%d\n", spri->span, pevent->hangup.channel); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Duplicate Hang up on channel s%dc%d\n", spri->span, pevent->hangup.channel);