** **
\*****************************************************************************/
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
#include "main.h"
VBOX_STATE_DELETE_DONE, /* tell that message is delete */
};
-char *months_english[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
-char *months_german[] = {"Jan","Feb","Maer","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"};
+const char *months_english[] = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
+const char *months_german[] = {"Jan","Feb","Maer","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"};
struct vbox_menu {
- char digit;
- char *english;
- char *german;
- } vbox_menu[] = {
+ const char digit;
+ const char *english;
+ const char *german;
+} vbox_menu[] = {
{'1', "<< previous", "<< zurueck"},
{'2', "-> play", "-> anhoeren"},
{'3', ">> next", ">> vor"},
{'9', "X delete", "X loeschen"},
{'0', "* call", "* anrufen"},
{'\0', NULL, NULL}
- };
+};
/*
* initialize the vbox. this is called at process_dialing(), when the VBOX_PLAY
{
int language = e_ext.vbox_language;
struct route_param *rparam;
- struct message *message;
+ struct lcr_msg *message;
struct port_list *portlist = ea_endpoint->ep_portlist;
/* get extension */
e_dtmf = 1;
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_CONNECT);
message_put(message);
- logmessage(message);
+ logmessage(message->type, &message->param, portlist->port_id, DIRECTION_OUT);
/* initialize the vbox */
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) initializing answering vbox state\n", ea_endpoint->ep_serial);
if (e_vbox_state == VBOX_STATE_RECORD_RECORD)
{
- if (e_extdialing[0] == '1')
+ if (e_extdialing[0] == '1' || e_extdialing[0] == '0')
{
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) stopping recording of announcement.\n", ea_endpoint->ep_serial);
port = find_port_id(portlist->port_id);
if (port)
- port->close_record(6000); /* append beep */
+ port->close_record((e_extdialing[0]=='1')?6000:0, 2000); /* append beep */
goto record_ask;
}
goto done;
port = find_port_id(portlist->port_id);
if (port)
{
- port->close_record(6000); /* append beep */
- port->open_record(CODEC_MONO, 1, 5000, e_ext.number, 0, "", 0); /* record announcement, skip the first 5000 samples */
+ port->close_record(0,0);
+ port->open_record(CODEC_MONO, 1, 4000, e_ext.number, 0, "", 0); /* record announcement, skip the first 4000 samples */
}
e_vbox_state = VBOX_STATE_RECORD_RECORD;
if (e_ext.vbox_language)
if (e_vbox_display_refresh && e_ext.vbox_display!=VBOX_DISPLAY_OFF)
{
char counter[32];
- struct message *message;
+ struct lcr_msg *message;
SPRINT(counter, "%02d:%02d", e_vbox_counter/60, e_vbox_counter%60);
if (e_vbox_counter_max)
SPRINT(message->param.notifyinfo.display, e_vbox_display, counter);
PDEBUG(DEBUG_EPOINT, "EPOINT(%d) terminal %s pending display:%s\n", ea_endpoint->ep_serial, e_ext.number, message->param.notifyinfo.display);
message_put(message);
- logmessage(message);
+ logmessage(message->type, &message->param, ea_endpoint->ep_portlist->port_id, DIRECTION_OUT);
}
}
* set the given vbox-tone with full path (without appending)
* the tone is played and after eof, a message is received
*/
-void EndpointAppPBX::set_tone_vbox(char *tone)
+void EndpointAppPBX::set_tone_vbox(const char *tone)
{
- struct message *message;
+ struct lcr_msg *message;
if (tone == NULL)
tone = "";
PERROR("EPOINT(%d) no portlist\n", ea_endpoint->ep_serial);
}
message = message_create(ea_endpoint->ep_serial, ea_endpoint->ep_portlist->port_id, EPOINT_TO_PORT, MESSAGE_VBOX_TONE);
- SCPY(message->param.tone.dir, (char *)((e_ext.vbox_language)?"vbox_german":"vbox_english"));
+ SCPY(message->param.tone.dir, ((e_ext.vbox_language) ? "vbox_german" : "vbox_english"));
SCPY(message->param.tone.name, tone);
message_put(message);
* the current counter value is also received by a message
* set the offset in seconds of the current recording
*/
-void EndpointAppPBX::set_play_vbox(char *file, int offset)
+void EndpointAppPBX::set_play_vbox(const char *file, int offset)
{
char filename[256];
- struct message *message;
+ struct lcr_msg *message;
SPRINT(filename, "%s/%s/%s/vbox/%s", INSTALL_DATA, options.extensions_dir, e_vbox, file);
*/
void EndpointAppPBX::set_play_speed(int speed)
{
- struct message *message;
+ struct lcr_msg *message;
if (!ea_endpoint->ep_portlist)
{