mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-02 19:29:31 +00:00
working towards stability with new functions
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2368 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b2392afa2f
commit
31892070a6
@ -1963,6 +1963,7 @@ static switch_status_t audio_bridge_on_ring(switch_core_session_t *session)
|
|||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM RING\n");
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CUSTOM RING\n");
|
||||||
|
|
||||||
/* put the channel in a passive state so we can loop audio to it */
|
/* put the channel in a passive state so we can loop audio to it */
|
||||||
|
switch_channel_set_state(channel, CS_TRANSMIT);
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1999,7 +2000,6 @@ static switch_status_t conference_outcall(conference_obj_t *conference,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
switch_core_session_rwunlock(peer_session);
|
|
||||||
peer_channel = switch_core_session_get_channel(peer_session);
|
peer_channel = switch_core_session_get_channel(peer_session);
|
||||||
assert(peer_channel != NULL);
|
assert(peer_channel != NULL);
|
||||||
|
|
||||||
|
@ -1717,7 +1717,6 @@ static void handle_answer(eXosip_event_t *event)
|
|||||||
uint8_t pre_answer = 0;
|
uint8_t pre_answer = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
|
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "cannot answer nonexistant call [%d]!\n", event->cid);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "cannot answer nonexistant call [%d]!\n", event->cid);
|
||||||
return;
|
return;
|
||||||
@ -1729,7 +1728,6 @@ static void handle_answer(eXosip_event_t *event)
|
|||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "one pre-answer is enough for call [%d]!\n", event->cid);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "one pre-answer is enough for call [%d]!\n", event->cid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch_set_flag_locked(tech_pvt, TFLAG_PRE_ANSWER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||||
@ -1743,8 +1741,14 @@ static void handle_answer(eXosip_event_t *event)
|
|||||||
|
|
||||||
/* Get all of the remote SDP elements... stuff */
|
/* Get all of the remote SDP elements... stuff */
|
||||||
if ((remote_sdp = eXosip_get_sdp_info(event->response)) == 0) {
|
if ((remote_sdp = eXosip_get_sdp_info(event->response)) == 0) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant Find SDP?\n");
|
/* Exosip is daft, they send the same event for both 180 and 183 WTF!!*/
|
||||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
if (!pre_answer) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant Find SDP?\n");
|
||||||
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
|
} else {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "I am daft, don't mind me.\n");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1767,13 +1771,8 @@ static void handle_answer(eXosip_event_t *event)
|
|||||||
tech_pvt->did = event->did;
|
tech_pvt->did = event->did;
|
||||||
tech_pvt->tid = event->tid;
|
tech_pvt->tid = event->tid;
|
||||||
|
|
||||||
if (switch_test_flag(tech_pvt, TFLAG_USING_CODEC)) {
|
if (!switch_test_flag(tech_pvt, TFLAG_USING_CODEC)) {
|
||||||
switch_core_codec_destroy(&tech_pvt->read_codec);
|
|
||||||
switch_core_codec_destroy(&tech_pvt->write_codec);
|
|
||||||
switch_clear_flag_locked(tech_pvt, TFLAG_USING_CODEC);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
int rate = atoi(drate);
|
int rate = atoi(drate);
|
||||||
int ms = globals.codec_ms;
|
int ms = globals.codec_ms;
|
||||||
|
|
||||||
@ -1842,6 +1841,7 @@ static void handle_answer(eXosip_event_t *event)
|
|||||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
if (pre_answer) {
|
if (pre_answer) {
|
||||||
|
switch_set_flag_locked(tech_pvt, TFLAG_PRE_ANSWER);
|
||||||
switch_channel_pre_answer(channel);
|
switch_channel_pre_answer(channel);
|
||||||
} else {
|
} else {
|
||||||
switch_channel_answer(channel);
|
switch_channel_answer(channel);
|
||||||
|
@ -1470,8 +1470,6 @@ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
|
|||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_core_session_rwunlock(peer_session);
|
|
||||||
|
|
||||||
jss = switch_core_session_alloc(peer_session, sizeof(*jss));
|
jss = switch_core_session_alloc(peer_session, sizeof(*jss));
|
||||||
jss->session = peer_session;
|
jss->session = peer_session;
|
||||||
jss->flags = 0;
|
jss->flags = 0;
|
||||||
|
@ -1189,10 +1189,16 @@ static void *SWITCH_THREAD_FUNC collect_thread_run(switch_thread_t *thread, void
|
|||||||
goto wbreak;
|
goto wbreak;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!switch_channel_ready(channel)) {
|
||||||
|
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||||
|
goto wbreak;
|
||||||
|
}
|
||||||
|
|
||||||
while(switch_channel_ready(channel)) {
|
while(switch_channel_ready(channel)) {
|
||||||
memset(buf, 0, sizeof(buf));
|
memset(buf, 0, sizeof(buf));
|
||||||
|
|
||||||
if (collect->file) {
|
if (collect->file) {
|
||||||
|
|
||||||
switch_ivr_play_file(collect->session, NULL, collect->file, NULL, NULL, buf, sizeof(buf));
|
switch_ivr_play_file(collect->session, NULL, collect->file, NULL, NULL, buf, sizeof(buf));
|
||||||
} else {
|
} else {
|
||||||
switch_ivr_collect_digits_count(collect->session, buf, sizeof(buf), 1, "", &term, 0);
|
switch_ivr_collect_digits_count(collect->session, buf, sizeof(buf), 1, "", &term, 0);
|
||||||
@ -1251,6 +1257,7 @@ static uint8_t check_channel_status(switch_channel_t **peer_channels,
|
|||||||
if (file) {
|
if (file) {
|
||||||
collect->file = switch_core_session_strdup(peer_sessions[i], file);
|
collect->file = switch_core_session_strdup(peer_sessions[i], file);
|
||||||
}
|
}
|
||||||
|
|
||||||
collect->session = peer_sessions[i];
|
collect->session = peer_sessions[i];
|
||||||
launch_collect_thread(collect);
|
launch_collect_thread(collect);
|
||||||
}
|
}
|
||||||
@ -1461,13 +1468,14 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
time(&start);
|
time(&start);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
uint32_t valid_channels = 0;
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
int state;
|
int state;
|
||||||
|
|
||||||
if (!peer_channels[i]) {
|
if (!peer_channels[i]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
valid_channels++;
|
||||||
state = switch_channel_get_state(peer_channels[i]);
|
state = switch_channel_get_state(peer_channels[i]);
|
||||||
|
|
||||||
if (state >= CS_RING) {
|
if (state >= CS_RING) {
|
||||||
@ -1483,6 +1491,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
|
|||||||
}
|
}
|
||||||
switch_yield(1000);
|
switch_yield(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (valid_channels == 0) {
|
||||||
|
status = SWITCH_STATUS_GENERR;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
endfor1:
|
endfor1:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user