[asterisk-commits] russell: branch group/chan_unistim r88323 - /team/group/chan_unistim/channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Nov 2 14:38:09 CDT 2007
Author: russell
Date: Fri Nov 2 14:38:09 2007
New Revision: 88323
URL: http://svn.digium.com/view/asterisk?view=rev&rev=88323
Log:
a bunch of coding guidelines related changes
Modified:
team/group/chan_unistim/channels/chan_unistim.c
Modified: team/group/chan_unistim/channels/chan_unistim.c
URL: http://svn.digium.com/view/asterisk/team/group/chan_unistim/channels/chan_unistim.c?view=diff&rev=88323&r1=88322&r2=88323
==============================================================================
--- team/group/chan_unistim/channels/chan_unistim.c (original)
+++ team/group/chan_unistim/channels/chan_unistim.c Fri Nov 2 14:38:09 2007
@@ -488,7 +488,7 @@
} *sessions = NULL;
/*!
- * \page Unitstim datagram formats
+ * \page Unistim datagram formats
*
* Format of datagrams :
* bytes 0 & 1 : ffff for discovery packet, 0000 for everything else
@@ -507,7 +507,7 @@
{ 0x00, 0x00, 0x00, 0x13, 0x9a, 0x0a, 0x02 };
const static unsigned char packet_recv_pressed_key[] =
{ 0x00, 0x00, 0x00, 0x13, 0x99, 0x04, 0x00 };
-const static unsigned char PacketRecvPickUp[] =
+const static unsigned char packet_recv_pick_up[] =
{ 0x00, 0x00, 0x00, 0x13, 0x99, 0x03, 0x04 };
const static unsigned char packet_recv_hangup[] =
{ 0x00, 0x00, 0x00, 0x13, 0x99, 0x03, 0x03 };
@@ -523,23 +523,23 @@
{ 0x11, 0x09, 0x02, 0x02, /*Month */ 0x05, /*Day */ 0x06, /*Hour */ 0x07,
/*Minutes */ 0x08, 0x32
};
-const static unsigned char PacketSendDateTime[] =
+const static unsigned char packet_send_date_time[] =
{ 0x11, 0x09, 0x02, 0x0a, /*Month */ 0x05, /*Day */ 0x06, /*Hour */ 0x07, /*Minutes */
0x08, 0x32, 0x17, 0x04, 0x24, 0x07, 0x19,
0x04, 0x07, 0x00, 0x19, 0x05, 0x09, 0x3e, 0x0f, 0x16, 0x05, 0x00, 0x80, 0x00, 0x1e,
0x05, 0x12, 0x00, 0x78
};
-const static unsigned char Packetsend_no_ring[] =
+const static unsigned char packet_send_no_ring[] =
{ 0x16, 0x04, 0x1a, 0x00, 0x16, 0x04, 0x11, 0x00 };
-const static unsigned char PacketSendS4[] =
+const static unsigned char packet_send_s4[] =
{ 0x16, 0x04, 0x1a, 0x00, 0x16, 0x04, 0x11, 0x00, 0x16, 0x06, 0x32, 0xdf, 0x00, 0xff,
0x16, 0x05, 0x1c, 0x00, 0x00, 0x17, 0x05,
0x0b, 0x00, 0x00, 0x19, 0x04, 0x00, 0x00, 0x19, 0x04, 0x00, 0x08, 0x19, 0x04, 0x00,
0x10, 0x19, 0x04, 0x00, 0x18, 0x16, 0x05,
0x31, 0x00, 0x00, 0x16, 0x05, 0x04, 0x00, 0x00
};
-const static unsigned char PacketSendCall[] =
+const static unsigned char packet_send_call[] =
{ 0x16, 0x04, 0x1a, 0x00, 0x16, 0x04, 0x11, 0x00, 0x16, 0x06, 0x32, 0xdf,
0x00, 0xff, 0x16, 0x05, 0x1c, 0x00, 0x00, 0x16, 0x0a, 0x38, 0x00, 0x12, 0xca, 0x03,
0xc0, 0xc3, 0xc5, 0x16, 0x16, 0x30, 0x00,
@@ -548,123 +548,122 @@
/*port RTP */ 0x0f, 0xa0, /* port RTCP */ 0x9c, 0x41, /* IP Address */ 0x0a, 0x01,
0x16, 0x66
};
-const static unsigned char PacketSendStreamBasedToneOff[] =
+const static unsigned char packet_send_stream_based_tone_off[] =
{ 0x16, 0x05, 0x1c, 0x00, 0x00 };
-/* const static unsigned char PacketSendMute[] = { 0x16, 0x05, 0x04, 0x00, 0x00 };
-const static unsigned char PacketSendCloseAudioStreamRX[] = { 0x16, 0x05, 0x31, 0x00, 0xff };
-const static unsigned char PacketSendCloseAudioStreamTX[] = { 0x16, 0x05, 0x31, 0xff, 0x00 };*/
-const static unsigned char PacketSendStreamBasedToneOn[] =
+/* const static unsigned char packet_send_Mute[] = { 0x16, 0x05, 0x04, 0x00, 0x00 };
+const static unsigned char packet_send_CloseAudioStreamRX[] = { 0x16, 0x05, 0x31, 0x00, 0xff };
+const static unsigned char packet_send_CloseAudioStreamTX[] = { 0x16, 0x05, 0x31, 0xff, 0x00 };*/
+const static unsigned char packet_send_stream_based_tone_on[] =
{ 0x16, 0x06, 0x1b, 0x00, 0x00, 0x05 };
-const static unsigned char PacketSendStreamBasedToneSingleFreq[] =
+const static unsigned char packet_send_stream_based_tone_single_freq[] =
{ 0x16, 0x06, 0x1d, 0x00, 0x01, 0xb8 };
-const static unsigned char PacketSendStreamBasedToneDualFreq[] =
+const static unsigned char packet_send_stream_based_tone_dial_freq[] =
{ 0x16, 0x08, 0x1d, 0x00, 0x01, 0xb8, 0x01, 0x5e };
-const static unsigned char PacketSendSelectOutput[] =
+const static unsigned char packet_send_select_output[] =
{ 0x16, 0x06, 0x32, 0xc0, 0x01, 0x00 };
-const static unsigned char PacketSendRing[] =
+const static unsigned char packet_send_ring[] =
{ 0x16, 0x06, 0x32, 0xdf, 0x00, 0xff, 0x16, 0x05, 0x1c, 0x00, 0x00, 0x16,
0x04, 0x1a, 0x01, 0x16, 0x05, 0x12, 0x13 /* Ring type 10 to 17 */ , 0x18, 0x16, 0x04, 0x18, /* volume 00, 10, 20... */
0x20, 0x16, 0x04, 0x10, 0x00
};
-const static unsigned char Packetsend_end_call[] =
+const static unsigned char packet_send_end_call[] =
{ 0x16, 0x06, 0x32, 0xdf, 0x00, 0xff, 0x16, 0x05, 0x31, 0x00, 0x00, 0x19, 0x04, 0x00,
0x10, 0x19, 0x04, 0x00, 0x18, 0x16, 0x05,
0x04, 0x00, 0x00, 0x16, 0x04, 0x37, 0x10
};
-const static unsigned char PacketSendS9[] =
+const static unsigned char packet_send_s9[] =
{ 0x16, 0x06, 0x32, 0xdf, 0x00, 0xff, 0x19, 0x04, 0x00, 0x10, 0x16, 0x05, 0x1c, 0x00,
0x00 };
-const static unsigned char PacketSendRTPpacketSize[] =
+const static unsigned char packet_send_rtp_packet_size[] =
{ 0x16, 0x08, 0x38, 0x00, 0x00, 0xe0, 0x00, 0xa0 };
-const static unsigned char PacketSendJitterBufferConf[] =
+const static unsigned char packet_send_jitter_buffer_conf[] =
{ 0x16, 0x0e, 0x3a, 0x00, /* jitter */ 0x02, /* high water mark */ 0x04, 0x00, 0x00,
/* early packet resync 2 bytes */ 0x3e, 0x80,
0x00, 0x00, /* late packet resync 2 bytes */ 0x3e, 0x80
};
/* Duration in ms div 2 (0x20 = 64ms, 0x08 = 16ms)
-static unsigned char PacketSendStreamBasedToneCad[] =
+static unsigned char packet_send_StreamBasedToneCad[] =
{ 0x16, 0x0a, 0x1e, 0x00, duration on 0x0a, duration off 0x0d, duration on 0x0a, duration off 0x0d, duration on 0x0a, duration off 0x2b }; */
-const static unsigned char PacketSendOpenAudioStreamRX[] =
+const static unsigned char packet_send_open_audio_stream_rx[] =
{ 0x16, 0x1a, 0x30, 0x00, 0xff, /* Codec */ 0x00, 0x00, 0x01, 0x00, 0xb8, 0xb8, 0x0e,
0x0e, 0x01, /* Port */ 0x14, 0x50, 0x00,
0x00, /* Port */ 0x14, 0x50, 0x00, 0x00, /* Dest IP */ 0x0a, 0x93, 0x69, 0x05
};
-const static unsigned char PacketSendOpenAudioStreamTX[] =
+const static unsigned char packet_send_open_audio_stream_tx[] =
{ 0x16, 0x1a, 0x30, 0xff, 0x00, 0x00, /* Codec */ 0x00, 0x01, 0x00, 0xb8, 0xb8, 0x0e,
0x0e, 0x01, /* Local port */ 0x14, 0x50,
0x00, 0x00, /* Rmt Port */ 0x14, 0x50, 0x00, 0x00, /* Dest IP */ 0x0a, 0x93, 0x69, 0x05
};
-const static unsigned char PacketSendOpenAudioStreamRX3[] =
+const static unsigned char packet_send_open_audio_stream_rx3[] =
{ 0x16, 0x1a, 0x30, 0x00, 0xff, /* Codec */ 0x00, 0x00, 0x02, 0x01, 0xb8, 0xb8, 0x06,
0x06, 0x81, /* RTP Port */ 0x14, 0x50,
/* RTCP Port */ 0x14,
0x51, /* RTP Port */ 0x14, 0x50, /* RTCP Port */ 0x00, 0x00, /* Dest IP */ 0x0a, 0x93,
0x69, 0x05
};
-const static unsigned char PacketSendOpenAudioStreamTX3[] =
+const static unsigned char packet_send_open_audio_stream_tx3[] =
{ 0x16, 0x1a, 0x30, 0xff, 0x00, 0x00, /* Codec */ 0x00, 0x02, 0x01, 0xb8, 0xb8, 0x06,
0x06, 0x81, /* RTP Local port */ 0x14, 0x50,
/* RTCP Port */ 0x00, 0x00, /* RTP Rmt Port */ 0x14, 0x50, /* RTCP Port */ 0x00, 0x00,
/* Dest IP */ 0x0a, 0x93, 0x69, 0x05
};
-const static unsigned char PacketSendArrow[] = { 0x17, 0x04, 0x04, 0x00 };
-const static unsigned char PacketSendBlinkCursor[] = { 0x17, 0x04, 0x10, 0x86 };
-const static unsigned char Packetsend_date_time2[] = { 0x17, 0x04, 0x17, 0x3d, 0x11, 0x09, 0x02, 0x0a, /*Month */ 0x05, /*Day */
+const static unsigned char packet_send_arrow[] = { 0x17, 0x04, 0x04, 0x00 };
+const static unsigned char packet_send_blink_cursor[] = { 0x17, 0x04, 0x10, 0x86 };
+const static unsigned char packet_send_date_time2[] = { 0x17, 0x04, 0x17, 0x3d, 0x11, 0x09, 0x02, 0x0a, /*Month */ 0x05, /*Day */
0x06, /*Hour */ 0x07, /*Minutes */ 0x08, 0x32
};
-const static unsigned char PacketSendContrast[] =
+const static unsigned char packet_send_Contrast[] =
{ 0x17, 0x04, 0x24, /*Contrast */ 0x08 };
-const static unsigned char PacketSendStartTimer[] =
+const static unsigned char packet_send_StartTimer[] =
{ 0x17, 0x05, 0x0b, 0x05, 0x00, 0x17, 0x08, 0x16, /* Text */ 0x44, 0x75, 0x72, 0xe9,
0x65 };
-const static unsigned char PacketSendStopTimer[] = { 0x17, 0x05, 0x0b, 0x02, 0x00 };
-const static unsigned char PacketSendIcon[] = { 0x17, 0x05, 0x14, /*pos */ 0x00, /*icon */ 0x25 }; /* display an icon in front of the text zone */
-const static unsigned char PacketSendS7[] = { 0x17, 0x06, 0x0f, 0x30, 0x07, 0x07 };
-const static unsigned char PacketSendSetPosCursor[] =
+const static unsigned char packet_send_stop_timer[] = { 0x17, 0x05, 0x0b, 0x02, 0x00 };
+const static unsigned char packet_send_icon[] = { 0x17, 0x05, 0x14, /*pos */ 0x00, /*icon */ 0x25 }; /* display an icon in front of the text zone */
+const static unsigned char packet_send_S7[] = { 0x17, 0x06, 0x0f, 0x30, 0x07, 0x07 };
+const static unsigned char packet_send_set_pos_cursor[] =
{ 0x17, 0x06, 0x10, 0x81, 0x04, /*pos */ 0x20 };
-/*static unsigned char PacketSendMonthLabelsDownload[] =
+/*static unsigned char packet_send_MonthLabelsDownload[] =
{ 0x17, 0x0a, 0x15, Month (3 char) 0x46, 0x65, 0x62, 0x4d, 0xe4, 0x72, 0x20 }; */
-const static unsigned char PacketSendFavorite[] =
+const static unsigned char packet_send_favorite[] =
{ 0x17, 0x0f, 0x19, 0x10, /*pos */ 0x01, /*name */ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, /*end_name */ 0x19,
0x05, 0x0f, /*pos */ 0x01, /*icone */ 0x00
};
-const static unsigned char PacketSendTitle[] =
+const static unsigned char packet_send_title[] =
{ 0x17, 0x10, 0x19, 0x02, /*text */ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20 /*end_text */ };
-const static unsigned char Packetsend_text[] =
+const static unsigned char packet_send_text[] =
{ 0x17, 0x1e, 0x1b, 0x04, /*pos */ 0x00, /*inverse */ 0x25, /*text */ 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
/*end_text */ 0x17, 0x04, 0x10, 0x87
};
-const static unsigned char PacketSendStatus[] =
+const static unsigned char packet_send_status[] =
{ 0x17, 0x20, 0x19, 0x08, /*text */ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 /*end_text */
};
-const static unsigned char PacketSendStatus2[] =
+const static unsigned char packet_send_status2[] =
{ 0x17, 0x0b, 0x19, /* pos [08|28|48|68] */ 0x00, /* text */ 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20 /* end_text */ };
-const static unsigned char PacketSendLedUpdate[] = { 0x19, 0x04, 0x00, 0x00 };
-
-const static unsigned char PacketSendQueryBasicManager04[] = { 0x1a, 0x04, 0x01, 0x04 };
-const static unsigned char PacketSendQueryMacAddress[] = { 0x1a, 0x04, 0x01, 0x08 };
-const static unsigned char PacketSendQueryBasicManager10[] = { 0x1a, 0x04, 0x01, 0x10 };
-const static unsigned char PacketSendS1[] = { 0x1a, 0x07, 0x07, 0x00, 0x00, 0x00, 0x13 };
-
-static unsigned char Packetsend_ping[] =
+const static unsigned char packet_send_led_update[] = { 0x19, 0x04, 0x00, 0x00 };
+
+const static unsigned char packet_send_query_basic_manager_04[] = { 0x1a, 0x04, 0x01, 0x04 };
+const static unsigned char packet_send_query_mac_address[] = { 0x1a, 0x04, 0x01, 0x08 };
+const static unsigned char packet_send_query_basic_manager_10[] = { 0x1a, 0x04, 0x01, 0x10 };
+const static unsigned char packet_send_S1[] = { 0x1a, 0x07, 0x07, 0x00, 0x00, 0x00, 0x13 };
+
+static unsigned char packet_send_ping[] =
{ 0x1e, 0x05, 0x12, 0x00, /*Watchdog timer */ 0x78 };
#define BUFFSEND unsigned char buffsend[64] = { 0x00, 0x00, 0xaa, 0xbb, 0x02, 0x01 }
-const static char desc[] = "UNISTIM for Asterisk";
const static char tdesc[] = "UNISTIM Channel Driver";
const static char type[] = "USTM";
@@ -713,23 +712,18 @@
/* .bridge = ast_rtp_bridge, */
};
-static void display_last_error(const char *szMessage)
-{
- int dwLastError;
- char *lpMsgBuf;
+static void display_last_error(const char *sz_msg)
+{
time_t cur_time;
time(&cur_time);
- dwLastError = errno;
- lpMsgBuf = strerror(dwLastError);
-
/* Display the error message */
- ast_log(LOG_WARNING, "%s %s : (%u) %s\n", ctime(&cur_time), szMessage, dwLastError,
- lpMsgBuf);
-}
-
-static void GetLocalTime(struct systemtime * systime)
+ ast_log(LOG_WARNING, "%s %s : (%u) %s\n", ctime(&cur_time), sz_msg, errno,
+ strerror(errno));
+}
+
+static void get_localtime(struct systemtime * systime)
{
struct tm *stm;
time_t cur_time;
@@ -751,20 +745,16 @@
systime->w_milliseconds = 0;
}
-static unsigned int GetTickCount(void)
-{
- struct timeval tv;
-
- if (gettimeofday(&tv, NULL) == -1)
- display_last_error("Error in gettimeofday");
+static unsigned int get_tick_count(void)
+{
+ struct timeval tv = ast_tvnow();;
return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
/* Send data to a phone without retransmit nor buffering */
-static void
-send_raw_client(int size, unsigned char *data, struct sockaddr_in *addr_to,
- const struct sockaddr_in *addr_ourip)
+static void send_raw_client(int size, unsigned char *data, struct sockaddr_in *addr_to,
+ const struct sockaddr_in *addr_ourip)
{
#ifdef HAVE_PKTINFO
struct iovec msg_iov;
@@ -833,7 +823,7 @@
pte->wsabufsend[buf_pos].len = size;
memcpy(pte->wsabufsend[buf_pos].buf, data, size);
- tick = GetTickCount();
+ tick = get_tick_count();
pte->timeout = tick + RETRANSMIT_TIMER;
/*#ifdef DUMP_PACKET */
@@ -853,12 +843,12 @@
BUFFSEND;
if ((unistimdebug) && (option_verbose > 5))
ast_verbose("Sending ping\n");
- pte->tick_next_ping = GetTickCount() + unistim_keepalive;
- memcpy(buffsend + SIZE_HEADER, Packetsend_ping, sizeof(Packetsend_ping));
- send_client(SIZE_HEADER + sizeof(Packetsend_ping), buffsend, pte);
-}
-
-static int getToAddress(int fd, struct sockaddr_in *toAddr)
+ pte->tick_next_ping = get_tick_count() + unistim_keepalive;
+ memcpy(buffsend + SIZE_HEADER, packet_send_ping, sizeof(packet_send_ping));
+ send_client(SIZE_HEADER + sizeof(packet_send_ping), buffsend, pte);
+}
+
+static int get_to_address(int fd, struct sockaddr_in *toAddr)
{
#ifdef HAVE_PKTINFO
int err;
@@ -900,10 +890,8 @@
return NULL;
memcpy(&s->sin, addr_from, sizeof(struct sockaddr_in));
- getToAddress(unistimsock, &s->sout);
+ get_to_address(unistimsock, &s->sout);
if (unistimdebug) {
-
-
ast_verbose
("Creating a new entry for the phone from %s received via server ip %s\n",
ast_inet_ntoa(addr_from->sin_addr), ast_inet_ntoa(s->sout.sin_addr));
@@ -913,14 +901,14 @@
s->next = sessions;
sessions = s;
- s->timeout = GetTickCount() + RETRANSMIT_TIMER;
+ s->timeout = get_tick_count() + RETRANSMIT_TIMER;
s->seq_phone = (short) 0x0000;
s->seq_server = (short) 0x0000;
s->last_seq_ack = (short) 0x000;
s->last_buf_available = 0;
s->nb_retransmit = 0;
s->state = STATE_INIT;
- s->tick_next_ping = GetTickCount() + unistim_keepalive;
+ s->tick_next_ping = get_tick_count() + unistim_keepalive;
/* Initialize struct wsabuf */
for (tmp = 0; tmp < MAX_BUF_NUMBER; tmp++) {
s->wsabufsend[tmp].buf = s->buf[tmp];
@@ -934,11 +922,11 @@
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending end call\n");
- memcpy(buffsend + SIZE_HEADER, Packetsend_end_call, sizeof(Packetsend_end_call));
- send_client(SIZE_HEADER + sizeof(Packetsend_end_call), buffsend, pte);
-}
-
-static void SetPingTimer(struct unistimsession *pte)
+ memcpy(buffsend + SIZE_HEADER, packet_send_end_call, sizeof(packet_send_end_call));
+ send_client(SIZE_HEADER + sizeof(packet_send_end_call), buffsend, pte);
+}
+
+static void set_ping_timer(struct unistimsession *pte)
{
unsigned int tick;
@@ -949,14 +937,14 @@
/* Checking if our send queue is empty,
* if true, setting up a timer for keepalive */
-static void CheckSendQueue(struct unistimsession *pte)
+static void check_send_queue(struct unistimsession *pte)
{
/* Check if our send queue contained only one element */
if (pte->last_buf_available == 1) {
if ((unistimdebug) && (option_verbose > 5))
ast_verbose("Our single packet was ACKed.\n");
pte->last_buf_available--;
- SetPingTimer(pte);
+ set_ping_timer(pte);
return;
}
/* Check if this ACK catch up our latest packet */
@@ -964,40 +952,41 @@
if ((unistimdebug) && (option_verbose > 5))
ast_verbose("Our send queue is completely ACKed.\n");
pte->last_buf_available = 0; /* Purge the send queue */
- SetPingTimer(pte);
+ set_ping_timer(pte);
return;
}
if ((unistimdebug) && (option_verbose > 5))
ast_verbose("We still have packets in our send queue\n");
return;
}
-static void SendStartTimer(struct unistimsession *pte)
+
+static void send_start_timer(struct unistimsession *pte)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending start timer\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendStartTimer, sizeof(PacketSendStartTimer));
- send_client(SIZE_HEADER + sizeof(PacketSendStartTimer), buffsend, pte);
-}
-
-static void SendStopTimer(struct unistimsession *pte)
+ memcpy(buffsend + SIZE_HEADER, packet_send_StartTimer, sizeof(packet_send_StartTimer));
+ send_client(SIZE_HEADER + sizeof(packet_send_StartTimer), buffsend, pte);
+}
+
+static void send_stop_timer(struct unistimsession *pte)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending stop timer\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendStopTimer, sizeof(PacketSendStopTimer));
- send_client(SIZE_HEADER + sizeof(PacketSendStopTimer), buffsend, pte);
-}
-
-static void SendIcon(unsigned char pos, unsigned char status, struct unistimsession *pte)
+ memcpy(buffsend + SIZE_HEADER, packet_send_stop_timer, sizeof(packet_send_stop_timer));
+ send_client(SIZE_HEADER + sizeof(packet_send_stop_timer), buffsend, pte);
+}
+
+static void Sendicon(unsigned char pos, unsigned char status, struct unistimsession *pte)
{
BUFFSEND;
if (unistimdebug)
- ast_verbose("Sending Icon pos %d with status 0x%.2x\n", pos, status);
- memcpy(buffsend + SIZE_HEADER, PacketSendIcon, sizeof(PacketSendIcon));
+ ast_verbose("Sending icon pos %d with status 0x%.2x\n", pos, status);
+ memcpy(buffsend + SIZE_HEADER, packet_send_icon, sizeof(packet_send_icon));
buffsend[9] = pos;
buffsend[10] = status;
- send_client(SIZE_HEADER + sizeof(PacketSendIcon), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_icon), buffsend, pte);
}
static void send_tone(struct unistimsession *pte, uint16_t tone1, uint16_t tone2)
@@ -1006,44 +995,44 @@
if (!tone1) {
if (unistimdebug)
ast_verbose("Sending Stream Based Tone Off\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendStreamBasedToneOff,
- sizeof(PacketSendStreamBasedToneOff));
- send_client(SIZE_HEADER + sizeof(PacketSendStreamBasedToneOff), buffsend, pte);
+ memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_off,
+ sizeof(packet_send_stream_based_tone_off));
+ send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_off), buffsend, pte);
return;
}
/* Since most of the world use a continuous tone, it's useless
if (unistimdebug)
ast_verbose ("Sending Stream Based Tone Cadence Download\n");
- memcpy (buffsend + SIZE_HEADER, PacketSendStreamBasedToneCad, sizeof (PacketSendStreamBasedToneCad));
- send_client (SIZE_HEADER + sizeof (PacketSendStreamBasedToneCad), buffsend, pte); */
+ memcpy (buffsend + SIZE_HEADER, packet_send_StreamBasedToneCad, sizeof (packet_send_StreamBasedToneCad));
+ send_client (SIZE_HEADER + sizeof (packet_send_StreamBasedToneCad), buffsend, pte); */
if (unistimdebug)
ast_verbose("Sending Stream Based Tone Frequency Component List Download %d %d\n",
tone1, tone2);
tone1 *= 8;
if (!tone2) {
- memcpy(buffsend + SIZE_HEADER, PacketSendStreamBasedToneSingleFreq,
- sizeof(PacketSendStreamBasedToneSingleFreq));
+ memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_single_freq,
+ sizeof(packet_send_stream_based_tone_single_freq));
buffsend[10] = (tone1 & 0xff00) >> 8;
buffsend[11] = (tone1 & 0x00ff);
- send_client(SIZE_HEADER + sizeof(PacketSendStreamBasedToneSingleFreq), buffsend,
+ send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_single_freq), buffsend,
pte);
} else {
tone2 *= 8;
- memcpy(buffsend + SIZE_HEADER, PacketSendStreamBasedToneDualFreq,
- sizeof(PacketSendStreamBasedToneDualFreq));
+ memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_dial_freq,
+ sizeof(packet_send_stream_based_tone_dial_freq));
buffsend[10] = (tone1 & 0xff00) >> 8;
buffsend[11] = (tone1 & 0x00ff);
buffsend[12] = (tone2 & 0xff00) >> 8;
buffsend[13] = (tone2 & 0x00ff);
- send_client(SIZE_HEADER + sizeof(PacketSendStreamBasedToneDualFreq), buffsend,
+ send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_dial_freq), buffsend,
pte);
}
if (unistimdebug)
ast_verbose("Sending Stream Based Tone On\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendStreamBasedToneOn,
- sizeof(PacketSendStreamBasedToneOn));
- send_client(SIZE_HEADER + sizeof(PacketSendStreamBasedToneOn), buffsend, pte);
+ memcpy(buffsend + SIZE_HEADER, packet_send_stream_based_tone_on,
+ sizeof(packet_send_stream_based_tone_on));
+ send_client(SIZE_HEADER + sizeof(packet_send_stream_based_tone_on), buffsend, pte);
}
/* Positions for favorites
@@ -1055,15 +1044,15 @@
/* status (icons) : 00 = nothing, 2x/3x = see parser.h, 4x/5x = blink fast, 6x/7x = blink slow */
static void
-SendFavorite(unsigned char pos, unsigned char status, struct unistimsession *pte,
+Sendfavorite(unsigned char pos, unsigned char status, struct unistimsession *pte,
const char *text)
{
BUFFSEND;
int i;
if (unistimdebug)
- ast_verbose("Sending Favorite pos %d with status 0x%.2x\n", pos, status);
- memcpy(buffsend + SIZE_HEADER, PacketSendFavorite, sizeof(PacketSendFavorite));
+ ast_verbose("Sending favorite pos %d with status 0x%.2x\n", pos, status);
+ memcpy(buffsend + SIZE_HEADER, packet_send_favorite, sizeof(packet_send_favorite));
buffsend[10] = pos;
buffsend[24] = pos;
buffsend[25] = status;
@@ -1071,10 +1060,10 @@
if (i > FAV_MAX_LENGTH)
i = FAV_MAX_LENGTH;
memcpy(buffsend + FAV_MAX_LENGTH + 1, text, i);
- send_client(SIZE_HEADER + sizeof(PacketSendFavorite), buffsend, pte);
-}
-
-static void RefreshAllFavorite(struct unistimsession *pte)
+ send_client(SIZE_HEADER + sizeof(packet_send_favorite), buffsend, pte);
+}
+
+static void refresh_all_favorite(struct unistimsession *pte)
{
int i = 0;
@@ -1083,10 +1072,10 @@
for (i = 0; i < 6; i++) {
if ((pte->device->softkeyicon[i] <= FAV_ICON_HEADPHONES_ONHOLD) &&
(pte->device->softkeylinepos != i))
- SendFavorite((unsigned char) i, pte->device->softkeyicon[i] + 1, pte,
+ Sendfavorite((unsigned char) i, pte->device->softkeyicon[i] + 1, pte,
pte->device->softkeylabel[i]);
else
- SendFavorite((unsigned char) i, pte->device->softkeyicon[i], pte,
+ Sendfavorite((unsigned char) i, pte->device->softkeyicon[i], pte,
pte->device->softkeylabel[i]);
}
@@ -1094,13 +1083,13 @@
/* Change the status for this phone (pte) and update for each phones where pte is bookmarked
* use FAV_ICON_*_BLACK constant in status parameters */
-static void ChangeFavoriteIcon(struct unistimsession *pte, unsigned char status)
+static void change_favorite_icon(struct unistimsession *pte, unsigned char status)
{
struct unistim_device *d = devices;
int i;
/* Update the current phone */
if (pte->state != STATE_CLEANING)
- SendFavorite(pte->device->softkeylinepos, status, pte,
+ Sendfavorite(pte->device->softkeylinepos, status, pte,
pte->device->softkeylabel[pte->device->softkeylinepos]);
/* Notify other phones if we're in their bookmark */
while (d) {
@@ -1109,7 +1098,7 @@
if (d->softkeyicon[i] != status) { /* Avoid resending the same icon */
d->softkeyicon[i] = status;
if (d->session)
- SendFavorite(i, status + 1, d->session, d->softkeylabel[i]);
+ Sendfavorite(i, status + 1, d->session, d->softkeylabel[i]);
}
}
}
@@ -1158,7 +1147,7 @@
ast_verbose("close_client session %p device %p lines %p sub %p\n",
s, s->device, s->device->lines,
s->device->lines->subs[SUB_REAL]);
- ChangeFavoriteIcon(s, FAV_ICON_NONE);
+ change_favorite_icon(s, FAV_ICON_NONE);
sub = s->device->lines->subs[SUB_REAL];
if (sub) {
if (sub->owner) { /* Call in progress ? */
@@ -1188,7 +1177,7 @@
}
/* Return 1 if the session chained link was modified */
-static int SendRetransmit(struct unistimsession *pte)
+static int send_retransmit(struct unistimsession *pte)
{
int i;
@@ -1200,7 +1189,7 @@
close_client(pte);
return 1;
}
- pte->timeout = GetTickCount() + RETRANSMIT_TIMER;
+ pte->timeout = get_tick_count() + RETRANSMIT_TIMER;
for (i = pte->last_buf_available - (pte->seq_server - pte->last_seq_ack);
i < pte->last_buf_available; i++) {
@@ -1235,17 +1224,17 @@
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending text at pos %d, inverse flag %d\n", pos, inverse);
- memcpy(buffsend + SIZE_HEADER, Packetsend_text, sizeof(Packetsend_text));
+ memcpy(buffsend + SIZE_HEADER, packet_send_text, sizeof(packet_send_text));
buffsend[10] = pos;
buffsend[11] = inverse;
i = strlen(text);
if (i > TEXT_LENGTH_MAX)
i = TEXT_LENGTH_MAX;
memcpy(buffsend + 12, text, i);
- send_client(SIZE_HEADER + sizeof(Packetsend_text), buffsend, pte);
-}
-
-static void send_textStatus(struct unistimsession *pte, const char *text)
+ send_client(SIZE_HEADER + sizeof(packet_send_text), buffsend, pte);
+}
+
+static void send_text_status(struct unistimsession *pte, const char *text)
{
BUFFSEND;
int i;
@@ -1258,24 +1247,24 @@
int j;
for (i = 0, j = 0; i < 4; i++, j += 7) {
int pos = 0x08 + (i * 0x20);
- memcpy(buffsend + SIZE_HEADER, PacketSendStatus2,
- sizeof(PacketSendStatus2));
+ memcpy(buffsend + SIZE_HEADER, packet_send_status2,
+ sizeof(packet_send_status2));
buffsend[9] = pos;
memcpy(buffsend + 10, (j < n) ? (text + j) : " ", 7);
- send_client(SIZE_HEADER + sizeof(PacketSendStatus2), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_status2), buffsend, pte);
}
return;
}
}
- memcpy(buffsend + SIZE_HEADER, PacketSendStatus, sizeof(PacketSendStatus));
+ memcpy(buffsend + SIZE_HEADER, packet_send_status, sizeof(packet_send_status));
i = strlen(text);
if (i > STATUS_LENGTH_MAX)
i = STATUS_LENGTH_MAX;
memcpy(buffsend + 10, text, i);
- send_client(SIZE_HEADER + sizeof(PacketSendStatus), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_status), buffsend, pte);
}
@@ -1283,29 +1272,29 @@
* 4 = bar 0.6s on/0.3s off, 5 = bar 0.5s on/0.5s off, 6 = bar 2s on/0.5s off
* 7 = bar off, 8 = speaker off, 9 = speaker on, 10 = headphone off, 11 = headphone on
* 18 = mute off, 19 mute on */
-static void SendLedUpdate(struct unistimsession *pte, unsigned char led)
+static void send_led_update(struct unistimsession *pte, unsigned char led)
{
BUFFSEND;
if (unistimdebug)
- ast_verbose("Sending LedUpdate (%x)\n", led);
- memcpy(buffsend + SIZE_HEADER, PacketSendLedUpdate, sizeof(PacketSendLedUpdate));
+ ast_verbose("Sending led_update (%x)\n", led);
+ memcpy(buffsend + SIZE_HEADER, packet_send_led_update, sizeof(packet_send_led_update));
buffsend[9] = led;
- send_client(SIZE_HEADER + sizeof(PacketSendLedUpdate), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_led_update), buffsend, pte);
}
/* output = OUTPUT_HANDSET, OUTPUT_HEADPHONE or OUTPUT_SPEAKER
* volume = VOLUME_LOW, VOLUME_NORMAL, VOLUME_INSANELY_LOUD
* mute = MUTE_OFF, MUTE_ON */
static void
-SendSelectOutput(struct unistimsession *pte, unsigned char output, unsigned char volume,
+send_select_output(struct unistimsession *pte, unsigned char output, unsigned char volume,
unsigned char mute)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending select output packet output=%x volume=%x mute=%x\n", output,
volume, mute);
- memcpy(buffsend + SIZE_HEADER, PacketSendSelectOutput,
- sizeof(PacketSendSelectOutput));
+ memcpy(buffsend + SIZE_HEADER, packet_send_select_output,
+ sizeof(packet_send_select_output));
buffsend[9] = output;
if (output == OUTPUT_SPEAKER)
volume = VOLUME_LOW_SPEAKER;
@@ -1316,39 +1305,39 @@
buffsend[11] = MUTE_ON;
else
buffsend[11] = mute;
- send_client(SIZE_HEADER + sizeof(PacketSendSelectOutput), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_select_output), buffsend, pte);
if (mute == MUTE_OFF)
- SendLedUpdate(pte, 0x18);
+ send_led_update(pte, 0x18);
else if (mute == MUTE_ON)
- SendLedUpdate(pte, 0x19);
+ send_led_update(pte, 0x19);
pte->device->mute = mute;
if (output == OUTPUT_HANDSET) {
if (mute == MUTE_ON)
- ChangeFavoriteIcon(pte, FAV_ICON_ONHOLD_BLACK);
+ change_favorite_icon(pte, FAV_ICON_ONHOLD_BLACK);
else
- ChangeFavoriteIcon(pte, FAV_ICON_OFFHOOK_BLACK);
- SendLedUpdate(pte, 0x08);
- SendLedUpdate(pte, 0x10);
+ change_favorite_icon(pte, FAV_ICON_OFFHOOK_BLACK);
+ send_led_update(pte, 0x08);
+ send_led_update(pte, 0x10);
} else if (output == OUTPUT_HEADPHONE) {
if (mute == MUTE_ON)
- ChangeFavoriteIcon(pte, FAV_ICON_HEADPHONES_ONHOLD);
+ change_favorite_icon(pte, FAV_ICON_HEADPHONES_ONHOLD);
else
- ChangeFavoriteIcon(pte, FAV_ICON_HEADPHONES);
- SendLedUpdate(pte, 0x08);
- SendLedUpdate(pte, 0x11);
+ change_favorite_icon(pte, FAV_ICON_HEADPHONES);
+ send_led_update(pte, 0x08);
+ send_led_update(pte, 0x11);
} else if (output == OUTPUT_SPEAKER) {
- SendLedUpdate(pte, 0x10);
- SendLedUpdate(pte, 0x09);
+ send_led_update(pte, 0x10);
+ send_led_update(pte, 0x09);
if (pte->device->receiver_state == STATE_OFFHOOK) {
if (mute == MUTE_ON)
- ChangeFavoriteIcon(pte, FAV_ICON_SPEAKER_ONHOLD_BLACK);
+ change_favorite_icon(pte, FAV_ICON_SPEAKER_ONHOLD_BLACK);
else
- ChangeFavoriteIcon(pte, FAV_ICON_SPEAKER_ONHOOK_BLACK);
+ change_favorite_icon(pte, FAV_ICON_SPEAKER_ONHOOK_BLACK);
} else {
if (mute == MUTE_ON)
- ChangeFavoriteIcon(pte, FAV_ICON_SPEAKER_ONHOLD_BLACK);
+ change_favorite_icon(pte, FAV_ICON_SPEAKER_ONHOLD_BLACK);
else
- ChangeFavoriteIcon(pte, FAV_ICON_SPEAKER_OFFHOOK_BLACK);
+ change_favorite_icon(pte, FAV_ICON_SPEAKER_OFFHOOK_BLACK);
}
} else
ast_log(LOG_WARNING, "Invalid ouput (%d)\n", output);
@@ -1357,15 +1346,15 @@
pte->device->output = output;
}
-static void SendRing(struct unistimsession *pte, char volume, char style)
+static void send_ring(struct unistimsession *pte, char volume, char style)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending ring packet\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendRing, sizeof(PacketSendRing));
+ memcpy(buffsend + SIZE_HEADER, packet_send_ring, sizeof(packet_send_ring));
buffsend[24] = style + 0x10;
buffsend[29] = volume * 0x10;
- send_client(SIZE_HEADER + sizeof(PacketSendRing), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_ring), buffsend, pte);
}
static void send_no_ring(struct unistimsession *pte)
@@ -1373,22 +1362,22 @@
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending no ring packet\n");
- memcpy(buffsend + SIZE_HEADER, Packetsend_no_ring, sizeof(Packetsend_no_ring));
- send_client(SIZE_HEADER + sizeof(Packetsend_no_ring), buffsend, pte);
-}
-
-static void send_textTitle(struct unistimsession *pte, const char *text)
+ memcpy(buffsend + SIZE_HEADER, packet_send_no_ring, sizeof(packet_send_no_ring));
+ send_client(SIZE_HEADER + sizeof(packet_send_no_ring), buffsend, pte);
+}
+
+static void send_texttitle(struct unistimsession *pte, const char *text)
{
BUFFSEND;
int i;
if (unistimdebug)
ast_verbose("Sending title text\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendTitle, sizeof(PacketSendTitle));
+ memcpy(buffsend + SIZE_HEADER, packet_send_title, sizeof(packet_send_title));
i = strlen(text);
if (i > 12)
i = 12;
memcpy(buffsend + 10, text, i);
- send_client(SIZE_HEADER + sizeof(PacketSendTitle), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_title), buffsend, pte);
}
@@ -1408,7 +1397,7 @@
text[i] = '\0';
send_text(TEXT_LINE0, TEXT_NORMAL, pte, text);
}
-static void SendDateTime(struct unistimsession *pte)
+static void send_date_time(struct unistimsession *pte)
{
BUFFSEND;
struct systemtime systime;
@@ -1418,13 +1407,13 @@
if (unistimdebug)
ast_verbose("Sending Time & Date\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendDateTime, sizeof(PacketSendDateTime));
- GetLocalTime(&systime);
+ memcpy(buffsend + SIZE_HEADER, packet_send_date_time, sizeof(packet_send_date_time));
+ get_localtime(&systime);
buffsend[10] = (unsigned char) systime.w_month;
buffsend[11] = (unsigned char) systime.w_day;
buffsend[12] = (unsigned char) systime.w_hour;
buffsend[13] = (unsigned char) systime.w_minute;
- send_client(SIZE_HEADER + sizeof(PacketSendDateTime), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_date_time), buffsend, pte);
}
static void send_date_time2(struct unistimsession *pte)
@@ -1437,8 +1426,8 @@
if (unistimdebug)
ast_verbose("Sending Time & Date #2\n");
- memcpy(buffsend + SIZE_HEADER, Packetsend_date_time2, sizeof(Packetsend_date_time2));
- GetLocalTime(&systime);
+ memcpy(buffsend + SIZE_HEADER, packet_send_date_time2, sizeof(packet_send_date_time2));
+ get_localtime(&systime);
if (pte->device)
buffsend[9] = pte->device->datetimeformat;
else
@@ -1447,7 +1436,7 @@
buffsend[15] = (unsigned char) systime.w_day;
buffsend[16] = (unsigned char) systime.w_hour;
buffsend[17] = (unsigned char) systime.w_minute;
- send_client(SIZE_HEADER + sizeof(Packetsend_date_time2), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_date_time2), buffsend, pte);
}
static void send_date_time3(struct unistimsession *pte)
@@ -1461,7 +1450,7 @@
if (unistimdebug)
ast_verbose("Sending Time & Date #3\n");
memcpy(buffsend + SIZE_HEADER, packet_send_date_time3, sizeof(packet_send_date_time3));
- GetLocalTime(&systime);
+ get_localtime(&systime);
buffsend[10] = (unsigned char) systime.w_month;
buffsend[11] = (unsigned char) systime.w_day;
buffsend[12] = (unsigned char) systime.w_hour;
@@ -1469,26 +1458,26 @@
send_client(SIZE_HEADER + sizeof(packet_send_date_time3), buffsend, pte);
}
-static void SendBlinkCursor(struct unistimsession *pte)
+static void send_blink_cursor(struct unistimsession *pte)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending set blink\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendBlinkCursor, sizeof(PacketSendBlinkCursor));
- send_client(SIZE_HEADER + sizeof(PacketSendBlinkCursor), buffsend, pte);
+ memcpy(buffsend + SIZE_HEADER, packet_send_blink_cursor, sizeof(packet_send_blink_cursor));
+ send_client(SIZE_HEADER + sizeof(packet_send_blink_cursor), buffsend, pte);
return;
}
/* pos : 0xab (a=0/2/4 = line ; b = row) */
-static void SendCursorPos(struct unistimsession *pte, unsigned char pos)
+static void send_cursor_pos(struct unistimsession *pte, unsigned char pos)
{
BUFFSEND;
if (unistimdebug)
ast_verbose("Sending set cursor position\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendSetPosCursor,
- sizeof(PacketSendSetPosCursor));
+ memcpy(buffsend + SIZE_HEADER, packet_send_set_pos_cursor,
+ sizeof(packet_send_set_pos_cursor));
buffsend[11] = pos;
- send_client(SIZE_HEADER + sizeof(PacketSendSetPosCursor), buffsend, pte);
+ send_client(SIZE_HEADER + sizeof(packet_send_set_pos_cursor), buffsend, pte);
return;
}
@@ -1498,10 +1487,10 @@
if (unistimdebug)
ast_verbose("ResumeConnectionWithServer received\n");
if (unistimdebug)
- ast_verbose("Sending PacketSendQueryMacAddress\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendQueryMacAddress,
- sizeof(PacketSendQueryMacAddress));
- send_client(SIZE_HEADER + sizeof(PacketSendQueryMacAddress), buffsend, pte);
+ ast_verbose("Sending packet_send_query_mac_address\n");
+ memcpy(buffsend + SIZE_HEADER, packet_send_query_mac_address,
+ sizeof(packet_send_query_mac_address));
+ send_client(SIZE_HEADER + sizeof(packet_send_query_mac_address), buffsend, pte);
return;
}
@@ -1701,22 +1690,22 @@
}
if (unistimdebug)
ast_verbose("\nSending S1\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendS1, sizeof(PacketSendS1));
- send_client(SIZE_HEADER + sizeof(PacketSendS1), buffsend, pte);
+ memcpy(buffsend + SIZE_HEADER, packet_send_S1, sizeof(packet_send_S1));
+ send_client(SIZE_HEADER + sizeof(packet_send_S1), buffsend, pte);
if (unistimdebug)
- ast_verbose("Sending QueryBasicManager04\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendQueryBasicManager04,
- sizeof(PacketSendQueryBasicManager04));
- send_client(SIZE_HEADER + sizeof(PacketSendQueryBasicManager04), buffsend, pte);
+ ast_verbose("Sending query_basic_manager_04\n");
+ memcpy(buffsend + SIZE_HEADER, packet_send_query_basic_manager_04,
+ sizeof(packet_send_query_basic_manager_04));
+ send_client(SIZE_HEADER + sizeof(packet_send_query_basic_manager_04), buffsend, pte);
if (unistimdebug)
- ast_verbose("Sending QueryBasicManager10\n");
- memcpy(buffsend + SIZE_HEADER, PacketSendQueryBasicManager10,
- sizeof(PacketSendQueryBasicManager10));
- send_client(SIZE_HEADER + sizeof(PacketSendQueryBasicManager10), buffsend, pte);
-
- SendDateTime(pte);
+ ast_verbose("Sending query_basic_manager_10\n");
+ memcpy(buffsend + SIZE_HEADER, packet_send_query_basic_manager_10,
+ sizeof(packet_send_query_basic_manager_10));
+ send_client(SIZE_HEADER + sizeof(packet_send_query_basic_manager_10), buffsend, pte);
+
+ send_date_time(pte);
return;
}
@@ -1741,7 +1730,7 @@
return 0;
}
-static int WriteHistory(struct unistimsession *pte, char way, char ismissed)
+static int write_history(struct unistimsession *pte, char way, char ismissed)
{
char tmp[AST_CONFIG_MAX_PATH], tmp2[AST_CONFIG_MAX_PATH];
char line1[TEXT_LENGTH_MAX + 1];
@@ -1768,7 +1757,7 @@
return -1;
}
}
- GetLocalTime(&systime);
+ get_localtime(&systime);
if (ismissed) {
if (way == 'i')
strcpy(tmp2, "Miss");
@@ -1858,8 +1847,7 @@
return -1;
}
size = (MAX_ENTRY_LOG - 1) * TEXT_LENGTH_MAX * 3;
- if (!(histbuf = ast_malloc(size)));
- {
+ if (!(histbuf = ast_malloc(size))) {
fclose(f);
fclose(f2);
return -1;
@@ -1894,7 +1882,7 @@
{
send_no_ring(pte);
pte->device->missed_call++;
- WriteHistory(pte, 'i', 1);
+ write_history(pte, 'i', 1);
show_main_page(pte);
return;
}
@@ -2016,7 +2004,7 @@
struct unistim_line *l = pte->device->lines;
sub = pte->device->lines->subs[SUB_REAL];
- SendStopTimer(pte);
+ send_stop_timer(pte);
if (sub->owner) {
sub->alreadygone = 1;
if (l->subs[SUB_THREEWAY]) {
@@ -2037,7 +2025,7 @@
}
change_callerid(pte, 0, pte->device->redial_number);
change_callerid(pte, 1, "");
- WriteHistory(pte, 'o', pte->device->missed_call);
+ write_history(pte, 'o', pte->device->missed_call);
pte->device->missed_call = 0;
show_main_page(pte);
return;
@@ -2155,18 +2143,18 @@
if ((sub->owner->readformat == AST_FORMAT_ULAW) ||
(sub->owner->readformat == AST_FORMAT_ALAW)) {
if (unistimdebug)
- ast_verbose("Sending PacketSendRTPpacketSize for codec %d\n", codec);
- memcpy(buffsend + SIZE_HEADER, PacketSendRTPpacketSize,
- sizeof(PacketSendRTPpacketSize));
+ ast_verbose("Sending packet_send_rtp_packet_size for codec %d\n", codec);
+ memcpy(buffsend + SIZE_HEADER, packet_send_rtp_packet_size,
+ sizeof(packet_send_rtp_packet_size));
buffsend[10] = codec;
- send_client(SIZE_HEADER + sizeof(PacketSendRTPpacketSize), buffsend,
+ send_client(SIZE_HEADER + sizeof(packet_send_rtp_packet_size), buffsend,
[... 1400 lines stripped ...]
More information about the asterisk-commits
mailing list