mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Various minor cleanups (bug #931)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -338,7 +338,7 @@ time_t t;
|
|||||||
strcpy(channel->exten,extstr);
|
strcpy(channel->exten,extstr);
|
||||||
strcpy(channel->context,context);
|
strcpy(channel->context,context);
|
||||||
channel->priority = 1;
|
channel->priority = 1;
|
||||||
printf("Caller ID is %s\n", channel->callerid);
|
if(debug) printf("Caller ID is %s\n", channel->callerid);
|
||||||
ast_pbx_run(channel);
|
ast_pbx_run(channel);
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
@@ -1131,8 +1131,9 @@ static int queue_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("queue: %s, options: %s, url: %s, announce: %s\n",
|
if (option_debug)
|
||||||
queuename, options, url, announceoverride);
|
ast_log(LOG_DEBUG, "queue: %s, options: %s, url: %s, announce: %s\n",
|
||||||
|
queuename, options, url, announceoverride);
|
||||||
/* Setup our queue entry */
|
/* Setup our queue entry */
|
||||||
memset(&qe, 0, sizeof(qe));
|
memset(&qe, 0, sizeof(qe));
|
||||||
qe.chan = chan;
|
qe.chan = chan;
|
||||||
|
@@ -1232,7 +1232,7 @@ static void ast_readconfig(void) {
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char c;
|
int c;
|
||||||
char filename[80] = "";
|
char filename[80] = "";
|
||||||
char hostname[256];
|
char hostname[256];
|
||||||
char tmp[80];
|
char tmp[80];
|
||||||
@@ -1269,7 +1269,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/* Check for options */
|
/* Check for options */
|
||||||
while((c=getopt(argc, argv, "hfdvqprgcinx:C:")) != EOF) {
|
while((c=getopt(argc, argv, "hfdvqprgcinx:C:")) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'd':
|
case 'd':
|
||||||
option_debug++;
|
option_debug++;
|
||||||
|
@@ -150,12 +150,12 @@ static int g729_write(struct ast_filestream *fs, struct ast_frame *f)
|
|||||||
ast_log(LOG_WARNING, "Asked to write non-G729 frame (%d)!\n", f->subclass);
|
ast_log(LOG_WARNING, "Asked to write non-G729 frame (%d)!\n", f->subclass);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (f->datalen % 20) {
|
if (f->datalen % 10) {
|
||||||
ast_log(LOG_WARNING, "Invalid data length, %d, should be multiple of 20\n", f->datalen);
|
ast_log(LOG_WARNING, "Invalid data length, %d, should be multiple of 10\n", f->datalen);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
|
if ((res = write(fs->fd, f->data, f->datalen)) != f->datalen) {
|
||||||
ast_log(LOG_WARNING, "Bad write (%d/20): %s\n", res, strerror(errno));
|
ast_log(LOG_WARNING, "Bad write (%d/10): %s\n", res, strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -235,7 +235,8 @@ int ast_set_indication_country(const char *country)
|
|||||||
if (country) {
|
if (country) {
|
||||||
struct tone_zone *z = ast_get_indication_zone(country);
|
struct tone_zone *z = ast_get_indication_zone(country);
|
||||||
if (z) {
|
if (z) {
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n",country);
|
if (option_verbose > 2)
|
||||||
|
ast_verbose(VERBOSE_PREFIX_3 "Setting default indication country to '%s'\n",country);
|
||||||
current_tonezone = z;
|
current_tonezone = z;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -359,7 +360,8 @@ int ast_register_indication_country(struct tone_zone *zone)
|
|||||||
tone_zones = zone;
|
tone_zones = zone;
|
||||||
ast_mutex_unlock(&tzlock);
|
ast_mutex_unlock(&tzlock);
|
||||||
|
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Registered indication country '%s'\n",zone->country);
|
if (option_verbose > 2)
|
||||||
|
ast_verbose(VERBOSE_PREFIX_3 "Registered indication country '%s'\n",zone->country);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +392,8 @@ int ast_unregister_indication_country(const char *country)
|
|||||||
ast_log(LOG_NOTICE,"Removed default indication country '%s'\n",tz->country);
|
ast_log(LOG_NOTICE,"Removed default indication country '%s'\n",tz->country);
|
||||||
current_tonezone = NULL;
|
current_tonezone = NULL;
|
||||||
}
|
}
|
||||||
ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n",tz->country);
|
if (option_verbose > 2)
|
||||||
|
ast_verbose(VERBOSE_PREFIX_3 "Unregistered indication country '%s'\n",tz->country);
|
||||||
free_zone(tz);
|
free_zone(tz);
|
||||||
tz = tmp;
|
tz = tmp;
|
||||||
res = 0;
|
res = 0;
|
||||||
|
@@ -339,8 +339,7 @@ int load_module(void)
|
|||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
snprintf((char *)qdir,sizeof(qdir)-1,"%s/%s",(char *)ast_config_AST_SPOOL_DIR,"outgoing");
|
snprintf((char *)qdir,sizeof(qdir)-1,"%s/%s",(char *)ast_config_AST_SPOOL_DIR,"outgoing");
|
||||||
printf("%s\n",qdir);
|
if (mkdir(qdir, 0700) && (errno != EEXIST)) {
|
||||||
if (mkdir(qdir, 0700) && (errno != EEXIST)) {
|
|
||||||
ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
|
ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include <asterisk/pbx.h>
|
#include <asterisk/pbx.h>
|
||||||
#include <asterisk/module.h>
|
#include <asterisk/module.h>
|
||||||
#include <asterisk/translate.h>
|
#include <asterisk/translate.h>
|
||||||
|
#include <asterisk/options.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -62,7 +63,8 @@ static void *autodial(void *ignore)
|
|||||||
int flags = fcntl(fd, F_GETFL);
|
int flags = fcntl(fd, F_GETFL);
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
|
fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
|
||||||
ast_log(LOG_DEBUG, "Entered Wil-Calu fd=%d\n",fd);
|
if (option_debug)
|
||||||
|
ast_log(LOG_DEBUG, "Entered Wil-Calu fd=%d\n",fd);
|
||||||
if(fd<0) {
|
if(fd<0) {
|
||||||
ast_log(LOG_WARNING, "Autodial: Unable to open file\n");
|
ast_log(LOG_WARNING, "Autodial: Unable to open file\n");
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
Reference in New Issue
Block a user