...
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4948 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b3cc03d692
commit
7e76249742
|
@ -134,7 +134,6 @@ struct wanpipe_pri_span {
|
||||||
struct wpsock {
|
struct wpsock {
|
||||||
sng_fd_t fd;
|
sng_fd_t fd;
|
||||||
char *name;
|
char *name;
|
||||||
struct private_object *tech_pvt;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct wpsock wpsock_t;
|
typedef struct wpsock wpsock_t;
|
||||||
|
@ -307,20 +306,6 @@ static void *SWITCH_THREAD_FUNC fxs_thread_run(switch_thread_t *thread, void *ob
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int wp_close(private_object_t *tech_pvt)
|
|
||||||
{
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
switch_mutex_lock(globals.hash_mutex);
|
|
||||||
if (tech_pvt->wpsock && tech_pvt->wpsock->tech_pvt == tech_pvt) {
|
|
||||||
tech_pvt->wpsock->tech_pvt = NULL;
|
|
||||||
ret = 1;
|
|
||||||
}
|
|
||||||
switch_mutex_unlock(globals.hash_mutex);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static wpsock_t *wp_open(private_object_t *tech_pvt, int span, int chan)
|
static wpsock_t *wp_open(private_object_t *tech_pvt, int span, int chan)
|
||||||
{
|
{
|
||||||
sng_fd_t fd;
|
sng_fd_t fd;
|
||||||
|
@ -343,17 +328,6 @@ static wpsock_t *wp_open(private_object_t *tech_pvt, int span, int chan)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sock && tech_pvt) {
|
|
||||||
if (sock->tech_pvt) {
|
|
||||||
if (tech_pvt->session) {
|
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
|
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sock->tech_pvt = tech_pvt;
|
|
||||||
tech_pvt->wpsock = sock;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch_mutex_unlock(globals.hash_mutex);
|
switch_mutex_unlock(globals.hash_mutex);
|
||||||
|
|
||||||
return sock;
|
return sock;
|
||||||
|
@ -640,10 +614,6 @@ static switch_status_t wanpipe_on_hangup(switch_core_session_t *session)
|
||||||
tech_pvt = switch_core_session_get_private(session);
|
tech_pvt = switch_core_session_get_private(session);
|
||||||
assert(tech_pvt != NULL);
|
assert(tech_pvt != NULL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wp_close(tech_pvt);
|
|
||||||
|
|
||||||
switch_core_codec_destroy(&tech_pvt->read_codec);
|
switch_core_codec_destroy(&tech_pvt->read_codec);
|
||||||
switch_core_codec_destroy(&tech_pvt->write_codec);
|
switch_core_codec_destroy(&tech_pvt->write_codec);
|
||||||
|
|
||||||
|
@ -962,8 +932,6 @@ static switch_status_t wanpipe_kill_channel(switch_core_session_t *session, int
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//sangoma_socket_close(&tech_pvt->wpsock->fd);
|
|
||||||
//wp_close(tech_pvt);
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -1366,6 +1334,7 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
|
|
||||||
|
if (switch_channel_get_state(channel) < CS_HANGUP) {
|
||||||
tech_pvt = switch_core_session_get_private(session);
|
tech_pvt = switch_core_session_get_private(session);
|
||||||
assert(tech_pvt != NULL);
|
assert(tech_pvt != NULL);
|
||||||
|
|
||||||
|
@ -1374,13 +1343,8 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
|
||||||
}
|
}
|
||||||
|
|
||||||
tech_pvt->cause = pevent->hangup.cause;
|
tech_pvt->cause = pevent->hangup.cause;
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_BYE);
|
|
||||||
switch_channel_hangup(channel, tech_pvt->cause);
|
switch_channel_hangup(channel, tech_pvt->cause);
|
||||||
|
}
|
||||||
switch_mutex_lock(globals.channel_mutex);
|
|
||||||
*chanmap->map[pevent->hangup.channel] = '\0';
|
|
||||||
switch_mutex_unlock(globals.channel_mutex);
|
|
||||||
|
|
||||||
switch_core_session_rwunlock(session);
|
switch_core_session_rwunlock(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue