switch_set_flag(tech_pvt, TFLAG_RTP);
} else {
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
- switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Oh oh? [%s]\n", err);
+ switch_console_printf(SWITCH_CHANNEL_CONSOLE, "RTP REPORTS ERROR: [%s]\n", err);
switch_channel_hangup(channel);
switch_set_flag(tech_pvt, TFLAG_BYE);
switch_clear_flag(tech_pvt, TFLAG_IO);
size_t bytes = 0, samples = 0, frames = 0, ms = 0;
switch_channel *channel = NULL;
int payload = 0;
+ switch_time_t started = switch_time_now();
+ unsigned int elapsed;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
&& tech_pvt->read_frame.datalen == 0) {
tech_pvt->read_frame.datalen =
jrtp4c_read(tech_pvt->rtp_session, tech_pvt->read_frame.data, sizeof(tech_pvt->read_buf), &payload);
+
+ if (timeout > -1) {
+ elapsed = (unsigned int)((switch_time_now() - started) / 1000);
+ if (elapsed >= timeout) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
+
/* RFC2833 ... TBD try harder to honor the duration etc.*/
if (payload == 101) {
unsigned char *packet = tech_pvt->read_frame.data;
}
if (globals.supress_telephony_events && payload != tech_pvt->payload_num) {
+ tech_pvt->read_frame.datalen = 0;
switch_yield(1000);
continue;
}
{
switch_channel *channel = NULL;
struct private_object *tech_pvt = NULL;
+ switch_time_t started = switch_time_now();
+ unsigned int elapsed;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
*frame = &tech_pvt->read_frame;
return SWITCH_STATUS_SUCCESS;
}
+
+ if (timeout > -1) {
+ elapsed = (unsigned int)((switch_time_now() - started) / 1000);
+ if (elapsed >= timeout) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
+
+
switch_yield(1000);
}
static void s_pri_error(struct pri *pri, char *s)
{
- switch_console_printf(SWITCH_CHANNEL_CONSOLE, s);
+ switch_console_printf(SWITCH_CHANNEL_CONSOLE_CLEAN, s);
}
static void s_pri_message(struct pri *pri, char *s)
switch_core_session *session;
struct channel_map *chanmap;
+
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Restarting channel %d\n", event->restart.channel);
+ if (event->restart.channel < 1) {
+ return 0;
+ }
+
+
chanmap = spri->private_info;
if ((session = chanmap->map[event->restart.channel])) {
char *uuid = switch_core_session_get_uuid(channel->session);
switch_status status;
- assert(channel != NULL);
+ assert(channel != NULL);
+
+ if (channel->state >= CS_HANGUP) {
+ return SWITCH_STATUS_FALSE;
+ }
+
msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
msg.from = channel->name;
status = switch_core_session_message_send(uuid, &msg);
{
assert(channel != NULL);
+ if (channel->state >= CS_HANGUP) {
+ return SWITCH_STATUS_FALSE;
+ }
if (switch_core_session_answer_channel(channel->session) == SWITCH_STATUS_SUCCESS) {
switch_event *event;