/* send release */
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = 16;
/* send release */
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = 16;
p_vbox_audio_transferred += tosend;
/* if announcement is currently played, send audio data */
p_vbox_audio_transferred += tosend;
/* if announcement is currently played, send audio data */
tosend = read_tone(p_vbox_announce_fh, buffer, p_vbox_announce_codec, tosend, p_vbox_announce_size, &p_vbox_announce_left, 1);
tosend = read_tone(p_vbox_announce_fh, buffer, p_vbox_announce_codec, tosend, p_vbox_announce_size, &p_vbox_announce_left, 1);
/* send connect message */
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_CONNECT);
memcpy(&message->param.connectinfo, &p_connectinfo, sizeof(struct connect_info));
/* send connect message */
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_CONNECT);
memcpy(&message->param.connectinfo, &p_connectinfo, sizeof(struct connect_info));
/* recording start */
open_record(p_vbox_ext.vbox_codec, 2, 0, p_vbox_ext.number, p_vbox_ext.anon_ignore, p_vbox_ext.vbox_email, p_vbox_ext.vbox_email_file);
vbox_trace_header(this, "RECORDING (announcement is over)", DIRECTION_IN);
end_trace();
} else // else!!
/* recording start */
open_record(p_vbox_ext.vbox_codec, 2, 0, p_vbox_ext.number, p_vbox_ext.anon_ignore, p_vbox_ext.vbox_email, p_vbox_ext.vbox_email_file);
vbox_trace_header(this, "RECORDING (announcement is over)", DIRECTION_IN);
end_trace();
} else // else!!
/* send release */
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = 16;
/* send release */
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = 16;
if (p_record)
record(buffer, tosend, 0); // from down
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_DATA);
if (p_record)
record(buffer, tosend, 0); // from down
message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_DATA);
PDEBUG(DEBUG_EPOINT|DEBUG_VBOX, "PORT(%s) no endpoint object found where the message is from.\n", p_name);
return(0);
}
PDEBUG(DEBUG_EPOINT|DEBUG_VBOX, "PORT(%s) no endpoint object found where the message is from.\n", p_name);
return(0);
}
add_trace("cause", "location", "%d", param->disconnectinfo.location);
end_trace();
add_trace("cause", "location", "%d", param->disconnectinfo.location);
end_trace();
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL;
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
message = message_create(p_serial, p_epointlist->epoint_id, PORT_TO_EPOINT, MESSAGE_RELEASE);
message->param.disconnectinfo.cause = CAUSE_NORMAL;
message->param.disconnectinfo.location = LOCATION_PRIVATE_LOCAL;
/* get apppbx */
memcpy(&p_vbox_ext, &((class EndpointAppPBX *)(epoint->ep_app))->e_ext, sizeof(p_vbox_ext));
/* extract optional announcement file */
/* get apppbx */
memcpy(&p_vbox_ext, &((class EndpointAppPBX *)(epoint->ep_app))->e_ext, sizeof(p_vbox_ext));
/* extract optional announcement file */
if (c[1] == '/')
SPRINT(filename, c+1);
else
SPRINT(filename, "%s/%s/vbox/%s", EXTENSION_DATA, p_vbox_ext.number);
*c = '\0';
if (c[1] == '/')
SPRINT(filename, c+1);
else
SPRINT(filename, "%s/%s/vbox/%s", EXTENSION_DATA, p_vbox_ext.number);
*c = '\0';
SPRINT(filename, "%s/%s/vbox/announcement", EXTENSION_DATA, p_vbox_ext.number);
}
vbox_trace_header(this, "SETUP to VBox", DIRECTION_OUT);
SPRINT(filename, "%s/%s/vbox/announcement", EXTENSION_DATA, p_vbox_ext.number);
}
vbox_trace_header(this, "SETUP to VBox", DIRECTION_OUT);
p_connectinfo.screen = INFO_SCREEN_NETWORK;
/* connect unless we can send announcement while ringing */
p_connectinfo.screen = INFO_SCREEN_NETWORK;
/* connect unless we can send announcement while ringing */
/* send connect message */
message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_CONNECT);
memcpy(&message->param.connectinfo, &p_connectinfo, sizeof(struct connect_info));
/* send connect message */
message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_CONNECT);
memcpy(&message->param.connectinfo, &p_connectinfo, sizeof(struct connect_info));
vbox_trace_header(this, "CONNECT from VBox (after setup)", DIRECTION_IN);
end_trace();
new_state(PORT_STATE_CONNECT);
vbox_trace_header(this, "CONNECT from VBox (after setup)", DIRECTION_IN);
end_trace();
new_state(PORT_STATE_CONNECT);
/* send alerting message */
message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_ALERTING);
message_put(message);
/* send alerting message */
message = message_create(p_serial, epoint_id, PORT_TO_EPOINT, MESSAGE_ALERTING);
message_put(message);
- if ((p_vbox_announce_fh = open_tone(filename, &p_vbox_announce_codec, &p_vbox_announce_size, &p_vbox_announce_left)) >= 0)
- {
+ if ((p_vbox_announce_fh = open_tone(filename, &p_vbox_announce_codec, &p_vbox_announce_size, &p_vbox_announce_left)) >= 0) {
/* start recording if desired */
p_vbox_mode = p_vbox_ext.vbox_mode;
p_vbox_record_limit = p_vbox_ext.vbox_time;
/* start recording if desired */
p_vbox_mode = p_vbox_ext.vbox_mode;
p_vbox_record_limit = p_vbox_ext.vbox_time;
/* recording start */
open_record(p_vbox_ext.vbox_codec, 2, 0, p_vbox_ext.number, p_vbox_ext.anon_ignore, p_vbox_ext.vbox_email, p_vbox_ext.vbox_email_file);
vbox_trace_header(this, "RECORDING", DIRECTION_IN);
/* recording start */
open_record(p_vbox_ext.vbox_codec, 2, 0, p_vbox_ext.number, p_vbox_ext.anon_ignore, p_vbox_ext.vbox_email, p_vbox_ext.vbox_email_file);
vbox_trace_header(this, "RECORDING", DIRECTION_IN);