summaryrefslogtreecommitdiff
path: root/contrib/utils
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-12-22 09:23:22 -0500
committerSean Bright <sean.bright@gmail.com>2017-12-22 09:23:22 -0500
commitfd0ca1c3f9b972a52d48a82b492fd6bac772dc78 (patch)
tree42d2a87726d196f4db1c68489007520a4c597062 /contrib/utils
parent9ef97b5a9191e51f1edc66bb17728fd9fe552c35 (diff)
Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
Diffstat (limited to 'contrib/utils')
-rw-r--r--contrib/utils/README.rawplayer9
-rw-r--r--contrib/utils/eagi_proxy.c40
-rw-r--r--contrib/utils/rawplayer.c5
-rw-r--r--contrib/utils/zones2indications.c16
4 files changed, 33 insertions, 37 deletions
diff --git a/contrib/utils/README.rawplayer b/contrib/utils/README.rawplayer
index 146898a5c..46211fd8b 100644
--- a/contrib/utils/README.rawplayer
+++ b/contrib/utils/README.rawplayer
@@ -23,15 +23,12 @@ and set up a class in musiconhold.conf like so:
default => custom:/var/lib/asterisk/holdmusic_raw,/usr/bin/rawplayer
-This is the most efficient way to implement moh because no cpu usage is required to
+This is the most efficient way to implement moh because no cpu usage is required to
explode the very compressed mp3 data then downsample the music to the 8khz mono on the fly
-instead the data is already stored on the disk in the format that asterisk needs it to be
-and the player does little more than pick up frames from the file and hand them to right
+instead the data is already stored on the disk in the format that asterisk needs it to be
+and the player does little more than pick up frames from the file and hand them to right
to the asterisk pipe where the audio is shared into all the channels who require it.
If you have cpu to spare and want a simple mp3 solution consider the format_mp3 from
asterisk-addons and the files based moh.
-
-
-
diff --git a/contrib/utils/eagi_proxy.c b/contrib/utils/eagi_proxy.c
index 0a96d5a2f..117d51e72 100644
--- a/contrib/utils/eagi_proxy.c
+++ b/contrib/utils/eagi_proxy.c
@@ -71,10 +71,10 @@ char window[WINSIZE];
#define WINBUF_NUM 2400 /* number of WINSIZE windows = 1 minute */
char* winbuf;
char *end, *bs, *be;
-/* winbuf - start of buffer
- * end - end of buffer
+/* winbuf - start of buffer
+ * end - end of buffer
* bs - start of data
- * be - end of data
+ * be - end of data
*/
int command_desc; /* command transfer descriptor */
@@ -107,7 +107,7 @@ void* readSignal(void* ptr);
int main()
{
int ret;
-
+
atexit(finalize);
setlinebuf(stdin);
@@ -118,7 +118,7 @@ int main()
bs=be=winbuf;
speech_desc=connect_to_host("localhost",SIGNAL_PORT);
- if(speech_desc<0)
+ if(speech_desc<0)
{
perror("signal socket");
return -1;
@@ -126,7 +126,7 @@ int main()
command_desc=connect_to_host("localhost",COMMAND_PORT);
- if(command_desc<0)
+ if(command_desc<0)
{
perror("command socket");
return -1;
@@ -137,14 +137,14 @@ int main()
pthread_create(&signal_thread,NULL,readSignal,NULL);
while(connected)
- {
+ {
pthread_mutex_lock(&command_mutex);
ret=read_some(command_desc,buf,BUFSIZE);
pthread_mutex_unlock(&command_mutex);
if(ret>0)
{
buf[ret]=0;
- printf("%s",buf);
+ printf("%s",buf);
}
}
@@ -155,7 +155,7 @@ void finalize()
{
close(command_desc);
close(speech_desc);
- free(winbuf);
+ free(winbuf);
}
void* readStdin(void* ptr)
@@ -168,7 +168,7 @@ void* readStdin(void* ptr)
write_buf(command_desc,buf,strlen(buf));
pthread_mutex_unlock(&command_mutex);
#endif
- if(feof(stdin) || buf[0]=='\n')
+ if(feof(stdin) || buf[0]=='\n')
{
break;
}
@@ -221,9 +221,9 @@ int connect_to_host(char* name, int port)
int res,desc;
int opts;
struct sockaddr_in host;
-
- /* get address */
+
+ /* get address */
if(!strcmp(name,"localhost"))
address=htonl(2130706433); /*127.0.0.1*/
else
@@ -232,7 +232,7 @@ int connect_to_host(char* name, int port)
if(address==(in_addr_t)-1)
{
host_entity = gethostbyname(name); /* search for the host under this name */
-
+
if(!host_entity)
{
fprintf(stderr,"EAGI proxy: Wrong address!\n"); /* can't find anything*/
@@ -250,11 +250,11 @@ int connect_to_host(char* name, int port)
}
memset((void*)&host,0,sizeof(struct sockaddr_in));
-
+
host.sin_family=AF_INET;
host.sin_port=htons(port);
host.sin_addr.s_addr=address;
-
+
res=connect(desc,(struct sockaddr*)&host,sizeof(host));
if(res<0)
{
@@ -292,15 +292,15 @@ int read_some(int desc, char* buffer, int size)
{
perror("Error reading");
connected=0;
- }
+ }
break;
}
- if(res==0)
+ if(res==0)
{
connected=0;
break;
}
-
+
buffer[i]=c;
i++;
}
@@ -385,7 +385,7 @@ int write_amap(int desc, char* buf, int size)
ret=write(desc,buf,size);
if(ret<0)
{
- if(errno!=EAGAIN)
+ if(errno!=EAGAIN)
{
perror("Error writing");
connected=0;
@@ -402,7 +402,7 @@ int write_amap(int desc, char* buf, int size)
void setnonblocking(int desc)
{
int opts;
-
+
opts = fcntl(desc,F_GETFL);
if(opts < 0)
{
diff --git a/contrib/utils/rawplayer.c b/contrib/utils/rawplayer.c
index 2733264a0..14f9de435 100644
--- a/contrib/utils/rawplayer.c
+++ b/contrib/utils/rawplayer.c
@@ -27,9 +27,9 @@ static int deliver_file(char *path, int fdout) {
}
if(fd)
close(fd);
- } else
+ } else
return -1;
-
+
return error;
}
@@ -43,4 +43,3 @@ int main(int argc, char *argv[]) {
exit(1);
}
}
-
diff --git a/contrib/utils/zones2indications.c b/contrib/utils/zones2indications.c
index 74c937527..d1def5300 100644
--- a/contrib/utils/zones2indications.c
+++ b/contrib/utils/zones2indications.c
@@ -18,7 +18,7 @@
/*! \file
* \brief print libtonozone data as Asterisk indications.conf
- */
+ */
#include <stdio.h>
#include <stdlib.h>
@@ -27,7 +27,7 @@
#define PROGRAM "zones2indication"
-void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char* name,
+void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char* name,
int toneid) {
int i;
for (i=0; i<DAHDI_TONE_MAX; i++) {
@@ -40,7 +40,7 @@ void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char* name,
void print_indications(struct ind_tone_zone *zone_data) {
int i;
-
+
printf (
"[%s]\n"
"; Source: libtonezone.\n"
@@ -48,8 +48,8 @@ void print_indications(struct ind_tone_zone *zone_data) {
"\n",
zone_data->country, zone_data->description
);
-
- printf(
+
+ printf(
"ringcadence = "
);
for(i=0; ; i++) {
@@ -60,7 +60,7 @@ void print_indications(struct ind_tone_zone *zone_data) {
printf("%d",zone_data->ringcadence[i]);
}
putchar('\n');
-
+
print_tone_zone_sound(zone_data, "dial", DAHDI_TONE_DIALTONE);
print_tone_zone_sound(zone_data, "busy", DAHDI_TONE_BUSY);
print_tone_zone_sound(zone_data, "ring", DAHDI_TONE_RINGTONE);
@@ -122,7 +122,7 @@ int main(int argc, char* argv[]){
int opt_print_all = 0;
int opt;
char* endptr = NULL;
-
+
while((opt = getopt(argc, argv, "ac:hn:")) != -1) {
switch(opt) {
case 'a':
@@ -146,7 +146,7 @@ int main(int argc, char* argv[]){
break;
}
}
-
+
/* If we got here, the user selected no option */
usage();
return 2;