mirror of
https://github.com/asterisk/asterisk.git
synced 2025-08-19 12:19:42 +00:00
Compare commits
5 Commits
13.6.0-rc1
...
1.0.2
Author | SHA1 | Date | |
---|---|---|---|
|
5a35b4c6c8 | ||
|
cfe6d10bd9 | ||
|
b98f1d2eea | ||
|
e30271738a | ||
|
13b960c28b |
@@ -1,6 +0,0 @@
|
||||
asterisk
|
||||
build.h
|
||||
ast_expr.c
|
||||
.version
|
||||
.depend
|
||||
.applied
|
6
CHANGES
Executable file → Normal file
6
CHANGES
Executable file → Normal file
@@ -1,9 +1,13 @@
|
||||
Asterisk 1.0.2
|
||||
-- Major bugfix release
|
||||
Asterisk 1.0.1
|
||||
-- Added AGI over TCP support
|
||||
-- Add ability to purge callers from queue if no agents are logged in
|
||||
-- Fix inband PRI indication detection
|
||||
-- Fix for MGCP - always request digits if no RTP stream
|
||||
-- Fixed seg fault for ast_control_streamfile
|
||||
-- Added AGI over TCP support
|
||||
-- Make pick-up extension configurable via features.conf
|
||||
-- Numerous other bug fixes
|
||||
Asterisk 1.0.0
|
||||
-- Use Q.931 standard cause codes for asterisk cause codes
|
||||
-- Bug fixes from the bug tracker
|
||||
|
4
CREDITS
Executable file → Normal file
4
CREDITS
Executable file → Normal file
@@ -58,12 +58,14 @@ Thorsten Lockert - OpenBSD, FreeBSD ports, making MacOS X port run on 10.3,
|
||||
bugs. tholo@sigmasoft.com
|
||||
Brian West - ODBC support and Bug Marshaling
|
||||
William Waites - syslog support, SIP NAT traversal for SIP-UA. ww@styx.org
|
||||
Rich Murphey - Porting to FreeBSD, NetBSD, OpenBSD, and Darwin.
|
||||
rich@whiteoaklabs.com http://whiteoaklabs.com
|
||||
|
||||
=== OTHER CONTRIBUTIONS ===
|
||||
John Todd - Monkey sounds and associated teletorture prompt
|
||||
|
||||
=== HOLD MUSIC ===
|
||||
Music provided by www.freeplaymusic.com
|
||||
Music provided by www.opsound.org
|
||||
|
||||
=== OTHER SOURCE CODE IN ASTERISK ===
|
||||
|
||||
|
4
Makefile
Executable file → Normal file
4
Makefile
Executable file → Normal file
@@ -146,7 +146,7 @@ endif # FreeBSD
|
||||
|
||||
ifeq (${OSARCH},NetBSD)
|
||||
CFLAGS+=-pthread
|
||||
INCLUDE+=-I/usr/local/include
|
||||
INCLUDE+=-I/usr/local/include -I/usr/pkg/include
|
||||
endif
|
||||
|
||||
ifeq (${OSARCH},OpenBSD)
|
||||
@@ -197,7 +197,7 @@ ifeq (${OSARCH},FreeBSD)
|
||||
LIBS+=-lcrypto
|
||||
endif
|
||||
ifeq (${OSARCH},NetBSD)
|
||||
LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -lncurses
|
||||
LIBS+=-lpthread -lcrypto -lm -L/usr/local/lib -L/usr/pkg/lib -lncurses
|
||||
endif
|
||||
ifeq (${OSARCH},OpenBSD)
|
||||
LIBS=-lcrypto -lpthread -lm -lncurses
|
||||
|
@@ -1,8 +0,0 @@
|
||||
About Hold Music
|
||||
================
|
||||
Digium has licensed the music included with
|
||||
the Asterisk distribution From FreePlayMusic
|
||||
for use and distribution with Asterisk. It
|
||||
is licensed ONLY for use as hold music within
|
||||
an Asterisk based PBX.
|
||||
|
22
README.opsound
Normal file
22
README.opsound
Normal file
@@ -0,0 +1,22 @@
|
||||
About Hold Music
|
||||
================
|
||||
These files were obtained from http://opsound.org, where the authors placed them
|
||||
under the Creative Commons Attribution-Share Alike 2.5 license, a copy of which
|
||||
may be found at http://creativecommons.org.
|
||||
|
||||
Credits
|
||||
================
|
||||
macroform-cold_day - Paul Shuler (Macroform)
|
||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
|
||||
|
||||
macroform-robot_dity - Paul Shuler (Macroform)
|
||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
|
||||
|
||||
macroform-the_simplicity - Paul Shuler (Macroform)
|
||||
paulshuler@gmail.com - http://macroform.bandcamp.com/
|
||||
|
||||
manolo_camp-morning_coffee - Manolo Camp
|
||||
beatbastard@gmx.net - http://ccmixter.org/people/ManoloCamp
|
||||
|
||||
reno_project-system - Reno Project
|
||||
renoproject@hotmail.com - http://www.jamendo.com/en/album/23661
|
7
acl.c
Executable file → Normal file
7
acl.c
Executable file → Normal file
@@ -242,20 +242,19 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
|
||||
|
||||
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
|
||||
m_rtmsg.m_rtm.rtm_type = RTM_GET;
|
||||
m_rtmsg.m_rtm.rtm_flags = RTF_UP | RTF_HOST;
|
||||
m_rtmsg.m_rtm.rtm_version = RTM_VERSION;
|
||||
ast_mutex_lock(&routeseq_lock);
|
||||
seq = ++routeseq;
|
||||
ast_mutex_unlock(&routeseq_lock);
|
||||
m_rtmsg.m_rtm.rtm_seq = seq;
|
||||
m_rtmsg.m_rtm.rtm_addrs = RTA_IFA | RTA_DST;
|
||||
m_rtmsg.m_rtm.rtm_addrs = RTA_DST | RTA_IFA;
|
||||
m_rtmsg.m_rtm.rtm_msglen = sizeof(struct rt_msghdr) + sizeof(struct sockaddr_in);
|
||||
sin = (struct sockaddr_in *)m_rtmsg.m_space;
|
||||
sin->sin_family = AF_INET;
|
||||
sin->sin_len = sizeof(struct sockaddr_in);
|
||||
sin->sin_addr = *them;
|
||||
|
||||
if ((s = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) {
|
||||
if ((s = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) {
|
||||
ast_log(LOG_ERROR, "Error opening routing socket\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -268,7 +267,7 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
|
||||
}
|
||||
do {
|
||||
l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
|
||||
} while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != 1 || m_rtmsg.m_rtm.rtm_pid != pid));
|
||||
} while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != seq || m_rtmsg.m_rtm.rtm_pid != pid));
|
||||
if (l < 0) {
|
||||
if (errno != EAGAIN)
|
||||
ast_log(LOG_ERROR, "Error reading from routing socket\n");
|
||||
|
0
aescrypt.c
Executable file → Normal file
0
aescrypt.c
Executable file → Normal file
@@ -1,3 +0,0 @@
|
||||
eagi-test
|
||||
eagi-sphinx-test
|
||||
.depend
|
0
agi/DialAnMp3.agi
Executable file → Normal file
0
agi/DialAnMp3.agi
Executable file → Normal file
0
agi/Makefile
Executable file → Normal file
0
agi/Makefile
Executable file → Normal file
0
agi/agi-test.agi
Executable file → Normal file
0
agi/agi-test.agi
Executable file → Normal file
0
agi/eagi-sphinx-test.c
Executable file → Normal file
0
agi/eagi-sphinx-test.c
Executable file → Normal file
0
agi/eagi-test.c
Executable file → Normal file
0
agi/eagi-test.c
Executable file → Normal file
0
agi/fastagi-test
Executable file → Normal file
0
agi/fastagi-test
Executable file → Normal file
0
agi/numeralize
Executable file → Normal file
0
agi/numeralize
Executable file → Normal file
@@ -1 +0,0 @@
|
||||
.depend
|
0
apps/Makefile
Executable file → Normal file
0
apps/Makefile
Executable file → Normal file
0
apps/app_adsiprog.c
Executable file → Normal file
0
apps/app_adsiprog.c
Executable file → Normal file
0
apps/app_alarmreceiver.c
Executable file → Normal file
0
apps/app_alarmreceiver.c
Executable file → Normal file
0
apps/app_authenticate.c
Executable file → Normal file
0
apps/app_authenticate.c
Executable file → Normal file
0
apps/app_cdr.c
Executable file → Normal file
0
apps/app_cdr.c
Executable file → Normal file
0
apps/app_chanisavail.c
Executable file → Normal file
0
apps/app_chanisavail.c
Executable file → Normal file
0
apps/app_controlplayback.c
Executable file → Normal file
0
apps/app_controlplayback.c
Executable file → Normal file
0
apps/app_cut.c
Executable file → Normal file
0
apps/app_cut.c
Executable file → Normal file
0
apps/app_datetime.c
Executable file → Normal file
0
apps/app_datetime.c
Executable file → Normal file
0
apps/app_db.c
Executable file → Normal file
0
apps/app_db.c
Executable file → Normal file
3
apps/app_dial.c
Executable file → Normal file
3
apps/app_dial.c
Executable file → Normal file
@@ -336,7 +336,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
|
||||
case AST_CONTROL_PROGRESS:
|
||||
if (option_verbose > 2)
|
||||
ast_verbose ( VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", o->chan->name,in->name);
|
||||
ast_indicate(in, AST_CONTROL_PROGRESS);
|
||||
if (!outgoing->ringbackonly)
|
||||
ast_indicate(in, AST_CONTROL_PROGRESS);
|
||||
break;
|
||||
case AST_CONTROL_OFFHOOK:
|
||||
/* Ignore going off hook */
|
||||
|
0
apps/app_directory.c
Executable file → Normal file
0
apps/app_directory.c
Executable file → Normal file
0
apps/app_disa.c
Executable file → Normal file
0
apps/app_disa.c
Executable file → Normal file
0
apps/app_echo.c
Executable file → Normal file
0
apps/app_echo.c
Executable file → Normal file
0
apps/app_enumlookup.c
Executable file → Normal file
0
apps/app_enumlookup.c
Executable file → Normal file
0
apps/app_eval.c
Executable file → Normal file
0
apps/app_eval.c
Executable file → Normal file
0
apps/app_exec.c
Executable file → Normal file
0
apps/app_exec.c
Executable file → Normal file
6
apps/app_festival.c
Executable file → Normal file
6
apps/app_festival.c
Executable file → Normal file
@@ -305,9 +305,9 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||
if (!(festivalcommand = ast_variable_retrieve(cfg, "general", "festivalcommand"))) {
|
||||
festivalcommand = "(tts_textasterisk \"%s\" 'file)(quit)\n";
|
||||
}
|
||||
ast_destroy(cfg);
|
||||
if (!vdata || ast_strlen_zero(vdata)) {
|
||||
ast_log(LOG_WARNING, "festival requires an argument (text)\n");
|
||||
ast_destroy(cfg);
|
||||
return -1;
|
||||
}
|
||||
strncpy(data, vdata, sizeof(data) - 1);
|
||||
@@ -325,6 +325,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||
|
||||
if (fd < 0) {
|
||||
ast_log(LOG_WARNING,"festival_client: can't get socket\n");
|
||||
ast_destroy(cfg);
|
||||
return -1;
|
||||
}
|
||||
memset(&serv_addr, 0, sizeof(serv_addr));
|
||||
@@ -333,6 +334,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||
serverhost = ast_gethostbyname(host, &ahp);
|
||||
if (serverhost == (struct hostent *)0) {
|
||||
ast_log(LOG_WARNING,"festival_client: gethostbyname failed\n");
|
||||
ast_destroy(cfg);
|
||||
return -1;
|
||||
}
|
||||
memmove(&serv_addr.sin_addr,serverhost->h_addr, serverhost->h_length);
|
||||
@@ -342,6 +344,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||
|
||||
if (connect(fd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) != 0) {
|
||||
ast_log(LOG_WARNING,"festival_client: connect to server failed\n");
|
||||
ast_destroy(cfg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -444,6 +447,7 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
||||
}
|
||||
} while (strcmp(ack,"OK\n") != 0);
|
||||
close(fd);
|
||||
ast_destroy(cfg);
|
||||
LOCAL_USER_REMOVE(u);
|
||||
return res;
|
||||
|
||||
|
0
apps/app_flash.c
Executable file → Normal file
0
apps/app_flash.c
Executable file → Normal file
5
apps/app_forkcdr.c
Executable file → Normal file
5
apps/app_forkcdr.c
Executable file → Normal file
@@ -23,7 +23,8 @@
|
||||
static char *tdesc = "Fork The CDR into 2 seperate entities.";
|
||||
static char *app = "ForkCDR";
|
||||
static char *synopsis =
|
||||
"Forks the Call Data Record\n"
|
||||
"Forks the Call Data Record";
|
||||
static char *descrip =
|
||||
" ForkCDR(): Causes the Call Data Record to fork an additional\n"
|
||||
"cdr record starting from the time of the fork call\n";
|
||||
|
||||
@@ -68,7 +69,7 @@ int unload_module(void)
|
||||
|
||||
int load_module(void)
|
||||
{
|
||||
return ast_register_application(app, forkcdr_exec, synopsis, tdesc);
|
||||
return ast_register_application(app, forkcdr_exec, synopsis, descrip);
|
||||
}
|
||||
|
||||
char *description(void)
|
||||
|
0
apps/app_getcpeid.c
Executable file → Normal file
0
apps/app_getcpeid.c
Executable file → Normal file
0
apps/app_groupcount.c
Executable file → Normal file
0
apps/app_groupcount.c
Executable file → Normal file
30
apps/app_hasnewvoicemail.c
Executable file → Normal file
30
apps/app_hasnewvoicemail.c
Executable file → Normal file
@@ -38,6 +38,7 @@
|
||||
#include <asterisk/pbx.h>
|
||||
#include <asterisk/module.h>
|
||||
#include <asterisk/lock.h>
|
||||
#include <asterisk/utils.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
@@ -70,7 +71,7 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
||||
{
|
||||
int res=0;
|
||||
struct localuser *u;
|
||||
char vmpath[256], *input, *varname = NULL, *vmbox, *vmfolder = "INBOX", *context = "default";
|
||||
char vmpath[256], *temps, *input, *varname = NULL, *vmbox, *vmfolder = "INBOX", *context = "default";
|
||||
DIR *vmdir;
|
||||
struct dirent *vment;
|
||||
int vmcount = 0;
|
||||
@@ -83,21 +84,22 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
||||
|
||||
input = ast_strdupa((char *)data);
|
||||
if (input) {
|
||||
if ((vmbox = strsep(&input,":")))
|
||||
if ((vmfolder = strsep(&input,"|")))
|
||||
temps = input;
|
||||
if ((temps = strsep(&input, "|"))) {
|
||||
if (input && !ast_strlen_zero(input))
|
||||
varname = input;
|
||||
else
|
||||
vmfolder = input;
|
||||
else
|
||||
if ((vmbox = strsep(&input,"|")))
|
||||
varname = input;
|
||||
else
|
||||
vmbox = input;
|
||||
|
||||
if (index(vmbox,'@')) {
|
||||
context = vmbox;
|
||||
vmbox = strsep(&context,"@");
|
||||
input = temps;
|
||||
}
|
||||
if ((temps = strsep(&input, ":"))) {
|
||||
if (input && !ast_strlen_zero(input))
|
||||
vmfolder = input;
|
||||
input = temps;
|
||||
}
|
||||
if ((vmbox = strsep(&input, "@")))
|
||||
if (input && !ast_strlen_zero(input))
|
||||
context = input;
|
||||
if (!vmbox)
|
||||
vmbox = input;
|
||||
|
||||
snprintf(vmpath,sizeof(vmpath), "%s/voicemail/%s/%s/%s", (char *)ast_config_AST_SPOOL_DIR, context, vmbox, vmfolder);
|
||||
if (!(vmdir = opendir(vmpath))) {
|
||||
|
0
apps/app_ices.c
Executable file → Normal file
0
apps/app_ices.c
Executable file → Normal file
0
apps/app_image.c
Executable file → Normal file
0
apps/app_image.c
Executable file → Normal file
0
apps/app_intercom.c
Executable file → Normal file
0
apps/app_intercom.c
Executable file → Normal file
0
apps/app_lookupblacklist.c
Executable file → Normal file
0
apps/app_lookupblacklist.c
Executable file → Normal file
0
apps/app_lookupcidname.c
Executable file → Normal file
0
apps/app_lookupcidname.c
Executable file → Normal file
0
apps/app_macro.c
Executable file → Normal file
0
apps/app_macro.c
Executable file → Normal file
7
apps/app_meetme.c
Executable file → Normal file
7
apps/app_meetme.c
Executable file → Normal file
@@ -1454,14 +1454,17 @@ static int admin_exec(struct ast_channel *chan, void *data) {
|
||||
command = strsep(¶ms, "|");
|
||||
caller = strsep(¶ms, "|");
|
||||
|
||||
ast_mutex_lock(&conflock);
|
||||
if (!command) {
|
||||
ast_log(LOG_WARNING, "MeetmeAdmin requires a command!\n");
|
||||
ast_mutex_unlock(&conflock);
|
||||
return -1;
|
||||
}
|
||||
cnf = confs;
|
||||
while (cnf) {
|
||||
if (strcmp(cnf->confno, conf) == 0)
|
||||
break;
|
||||
cnf = cnf->next;
|
||||
}
|
||||
ast_mutex_unlock(&conflock);
|
||||
|
||||
if (caller)
|
||||
user = find_user(cnf, caller);
|
||||
|
0
apps/app_milliwatt.c
Executable file → Normal file
0
apps/app_milliwatt.c
Executable file → Normal file
0
apps/app_mp3.c
Executable file → Normal file
0
apps/app_mp3.c
Executable file → Normal file
0
apps/app_nbscat.c
Executable file → Normal file
0
apps/app_nbscat.c
Executable file → Normal file
0
apps/app_osplookup.c
Executable file → Normal file
0
apps/app_osplookup.c
Executable file → Normal file
0
apps/app_parkandannounce.c
Executable file → Normal file
0
apps/app_parkandannounce.c
Executable file → Normal file
0
apps/app_playback.c
Executable file → Normal file
0
apps/app_playback.c
Executable file → Normal file
0
apps/app_privacy.c
Executable file → Normal file
0
apps/app_privacy.c
Executable file → Normal file
0
apps/app_qcall.c
Executable file → Normal file
0
apps/app_qcall.c
Executable file → Normal file
0
apps/app_queue.c
Executable file → Normal file
0
apps/app_queue.c
Executable file → Normal file
0
apps/app_random.c
Executable file → Normal file
0
apps/app_random.c
Executable file → Normal file
0
apps/app_read.c
Executable file → Normal file
0
apps/app_read.c
Executable file → Normal file
2
apps/app_record.c
Executable file → Normal file
2
apps/app_record.c
Executable file → Normal file
@@ -301,7 +301,7 @@ static int record_exec(struct ast_channel *chan, void *data)
|
||||
ast_log(LOG_WARNING, "Could not answer channel '%s'\n", chan->name);
|
||||
|
||||
LOCAL_USER_REMOVE(u);
|
||||
if (silence > 0) {
|
||||
if ((silence > 0) && rfmt) {
|
||||
res = ast_set_read_format(chan, rfmt);
|
||||
if (res)
|
||||
ast_log(LOG_WARNING, "Unable to restore read format on '%s'\n", chan->name);
|
||||
|
0
apps/app_rpt.c
Executable file → Normal file
0
apps/app_rpt.c
Executable file → Normal file
0
apps/app_sayunixtime.c
Executable file → Normal file
0
apps/app_sayunixtime.c
Executable file → Normal file
0
apps/app_senddtmf.c
Executable file → Normal file
0
apps/app_senddtmf.c
Executable file → Normal file
0
apps/app_sendtext.c
Executable file → Normal file
0
apps/app_sendtext.c
Executable file → Normal file
0
apps/app_setcallerid.c
Executable file → Normal file
0
apps/app_setcallerid.c
Executable file → Normal file
0
apps/app_setcdruserfield.c
Executable file → Normal file
0
apps/app_setcdruserfield.c
Executable file → Normal file
0
apps/app_setcidname.c
Executable file → Normal file
0
apps/app_setcidname.c
Executable file → Normal file
0
apps/app_setcidnum.c
Executable file → Normal file
0
apps/app_setcidnum.c
Executable file → Normal file
0
apps/app_skel.c
Executable file → Normal file
0
apps/app_skel.c
Executable file → Normal file
13
apps/app_sms.c
Executable file → Normal file
13
apps/app_sms.c
Executable file → Normal file
@@ -26,6 +26,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <ctype.h>
|
||||
#include "../astconf.h"
|
||||
|
||||
/* ToDo */
|
||||
/* When acting as SC and answering, should check for messages and send instead of sending EST as first packet */
|
||||
@@ -36,6 +37,9 @@
|
||||
|
||||
static unsigned char message_ref; /* arbitary message ref */
|
||||
|
||||
static char log_file[255];
|
||||
static char spool_dir[255];
|
||||
|
||||
static char *tdesc = "SMS/PSTN handler";
|
||||
|
||||
static char *app = "SMS";
|
||||
@@ -315,7 +319,7 @@ sms_log (sms_t * h, char status)
|
||||
{ /* log the output, and remove file */
|
||||
if (*h->oa || *h->da)
|
||||
{
|
||||
int o = open ("/var/log/asterisk/sms", O_CREAT | O_APPEND | O_WRONLY, 0666);
|
||||
int o = open (log_file, O_CREAT | O_APPEND | O_WRONLY, 0666);
|
||||
if (o >= 0)
|
||||
{
|
||||
char line[1000], *p;
|
||||
@@ -517,7 +521,7 @@ sms_writefile (sms_t * h)
|
||||
char fn2[200] = "";
|
||||
FILE *o;
|
||||
|
||||
strncpy(fn, "/var/spool/asterisk/sms", sizeof(fn) - 1);
|
||||
strncpy(fn, spool_dir, sizeof(fn) - 1);
|
||||
mkdir (fn, 0777); /* ensure it exists */
|
||||
snprintf(fn + strlen(fn), sizeof(fn) - strlen(fn), "/%s.%s", h->smsc ? "me-sc" : "sc-me", h->queue);
|
||||
mkdir (fn, 0777); /* ensure it exists */
|
||||
@@ -689,7 +693,7 @@ sms_nextoutgoing (sms_t * h)
|
||||
DIR *d;
|
||||
char more = 0;
|
||||
|
||||
strncpy(fn, "/var/spool/asterisk/sms", sizeof(fn) - 1);
|
||||
strncpy(fn, spool_dir, sizeof(fn) - 1);
|
||||
mkdir(fn, 0777); /* ensure it exists */
|
||||
snprintf(fn + strlen (fn), sizeof(fn) - strlen(fn), "/%s.%s", h->smsc ? "sc-me" : "me-sc", h->queue);
|
||||
mkdir (fn, 0777); /* ensure it exists */
|
||||
@@ -769,6 +773,7 @@ sms_nextoutgoing (sms_t * h)
|
||||
{ /* no message */
|
||||
h->omsg[0] = 0x94; /* SMS_REL */
|
||||
h->omsg[1] = 0;
|
||||
h->hangup = 1;
|
||||
sms_messagetx (h);
|
||||
}
|
||||
}
|
||||
@@ -1204,6 +1209,8 @@ load_module (void)
|
||||
for (p = 0; p < 128; p++)
|
||||
sms8to7[sms7to8[p]] = p;
|
||||
}
|
||||
snprintf(log_file, sizeof(log_file), "%s/sms", ast_config_AST_LOG_DIR);
|
||||
snprintf(spool_dir, sizeof(spool_dir), "%s/sms", ast_config_AST_SPOOL_DIR);
|
||||
return ast_register_application (app, sms_exec, synopsis, descrip);
|
||||
}
|
||||
|
||||
|
0
apps/app_softhangup.c
Executable file → Normal file
0
apps/app_softhangup.c
Executable file → Normal file
0
apps/app_sql_postgres.c
Executable file → Normal file
0
apps/app_sql_postgres.c
Executable file → Normal file
0
apps/app_striplsd.c
Executable file → Normal file
0
apps/app_striplsd.c
Executable file → Normal file
0
apps/app_substring.c
Executable file → Normal file
0
apps/app_substring.c
Executable file → Normal file
0
apps/app_system.c
Executable file → Normal file
0
apps/app_system.c
Executable file → Normal file
0
apps/app_talkdetect.c
Executable file → Normal file
0
apps/app_talkdetect.c
Executable file → Normal file
0
apps/app_test.c
Executable file → Normal file
0
apps/app_test.c
Executable file → Normal file
0
apps/app_transfer.c
Executable file → Normal file
0
apps/app_transfer.c
Executable file → Normal file
0
apps/app_txtcidname.c
Executable file → Normal file
0
apps/app_txtcidname.c
Executable file → Normal file
0
apps/app_url.c
Executable file → Normal file
0
apps/app_url.c
Executable file → Normal file
2
apps/app_userevent.c
Executable file → Normal file
2
apps/app_userevent.c
Executable file → Normal file
@@ -54,12 +54,12 @@ static int userevent_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
|
||||
strncpy(info, (char *)data, strlen((char *)data) + AST_MAX_EXTENSION-1);
|
||||
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
|
||||
eventbody = strchr(eventname, '|');
|
||||
if (eventbody) {
|
||||
*eventbody = '\0';
|
||||
eventbody++;
|
||||
}
|
||||
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
|
||||
LOCAL_USER_ADD(u);
|
||||
|
||||
if(eventbody) {
|
||||
|
0
apps/app_verbose.c
Executable file → Normal file
0
apps/app_verbose.c
Executable file → Normal file
141
apps/app_voicemail.c
Executable file → Normal file
141
apps/app_voicemail.c
Executable file → Normal file
@@ -215,7 +215,10 @@ static char *descrip_vmain =
|
||||
"for the checking of voicemail. The mailbox can be passed as the option,\n"
|
||||
"which will stop the voicemail system from prompting the user for the mailbox.\n"
|
||||
"If the mailbox is preceded by 's' then the password check will be skipped. If\n"
|
||||
"a context is specified, logins are considered in that voicemail context only.\n"
|
||||
"the mailbox is preceded by 'p' then the supplied mailbox is prepended to the\n"
|
||||
"user's entry and the resulting string is used as the mailbox number. This is\n"
|
||||
"useful for virtual hosting of voicemail boxes. If a context is specified,\n"
|
||||
"logins are considered in that voicemail context only.\n"
|
||||
"Returns -1 if the user hangs up or 0 otherwise.\n";
|
||||
|
||||
static char *synopsis_vm_box_exists =
|
||||
@@ -705,6 +708,18 @@ static int make_file(char *dest, int len, char *dir, int num)
|
||||
return snprintf(dest, len, "%s/msg%04d", dir, num);
|
||||
}
|
||||
|
||||
static int last_message_index(char *dir)
|
||||
{
|
||||
int x;
|
||||
char fn[256];
|
||||
for (x=0;x<MAXMSG;x++) {
|
||||
make_file(fn, sizeof(fn), dir, x);
|
||||
if (ast_fileexists(fn, NULL, NULL) < 1)
|
||||
break;
|
||||
}
|
||||
return x-1;
|
||||
}
|
||||
|
||||
static int
|
||||
inbuf(struct baseio *bio, FILE *fi)
|
||||
{
|
||||
@@ -989,7 +1004,7 @@ static int sendmail(char *srcemail, struct ast_vm_user *vmu, int msgnum, char *m
|
||||
fclose(p);
|
||||
snprintf(tmp2, sizeof(tmp2), "( %s < %s ; rm -f %s ) &", mailcmd, tmp, tmp);
|
||||
ast_safe_system(tmp2);
|
||||
ast_log(LOG_DEBUG, "Sent mail to %s with command '%s'\n", who, mailcmd);
|
||||
ast_log(LOG_DEBUG, "Sent mail to %s with command '%s'\n", vmu->email, mailcmd);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
|
||||
return -1;
|
||||
@@ -1403,22 +1418,22 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
|
||||
}
|
||||
/* Check for a '0' here */
|
||||
if (res == '0') {
|
||||
transfer:
|
||||
strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
|
||||
if (!ast_strlen_zero(vmu->exit)) {
|
||||
strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
|
||||
} else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
|
||||
strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
|
||||
transfer:
|
||||
if (vmu->operator) {
|
||||
strncpy(chan->exten, "o", sizeof(chan->exten) - 1);
|
||||
if (!ast_strlen_zero(vmu->exit)) {
|
||||
strncpy(chan->context, vmu->exit, sizeof(chan->context) - 1);
|
||||
} else if (ousemacro && !ast_strlen_zero(chan->macrocontext)) {
|
||||
strncpy(chan->context, chan->macrocontext, sizeof(chan->context) - 1);
|
||||
}
|
||||
ast_play_and_wait(chan, "transfer");
|
||||
chan->priority = 0;
|
||||
free_user(vmu);
|
||||
return 0;
|
||||
} else {
|
||||
ast_play_and_wait(chan, "vm-sorry");
|
||||
return 0;
|
||||
}
|
||||
chan->priority = 0;
|
||||
free_user(vmu);
|
||||
return 0;
|
||||
}
|
||||
if (res >= 0) {
|
||||
/* Unless we're *really* silent, try to send the beep */
|
||||
res = ast_streamfile(chan, "beep", chan->language);
|
||||
if (!res)
|
||||
res = ast_waitstream(chan, "");
|
||||
}
|
||||
if (res < 0) {
|
||||
free_user(vmu);
|
||||
@@ -1434,6 +1449,12 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
|
||||
break;
|
||||
msgnum++;
|
||||
} while(msgnum < MAXMSG);
|
||||
if (res >= 0) {
|
||||
/* Unless we're *really* silent, try to send the beep */
|
||||
res = ast_streamfile(chan, "beep", chan->language);
|
||||
if (!res)
|
||||
res = ast_waitstream(chan, "");
|
||||
}
|
||||
if (msgnum < MAXMSG) {
|
||||
/* Store information */
|
||||
snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);
|
||||
@@ -1525,16 +1546,56 @@ leave_vm_out:
|
||||
|
||||
static int count_messages(char *dir)
|
||||
{
|
||||
int x;
|
||||
char fn[256];
|
||||
for (x=0;x<MAXMSG;x++) {
|
||||
make_file(fn, sizeof(fn), dir, x);
|
||||
if (ast_fileexists(fn, NULL, NULL) < 1)
|
||||
break;
|
||||
/* Find all .txt files - even if they are not in sequence from 0000 */
|
||||
|
||||
|
||||
int vmcount = 0;
|
||||
DIR *vmdir = NULL;
|
||||
struct dirent *vment = NULL;
|
||||
|
||||
if ((vmdir = opendir(dir))) {
|
||||
while ((vment = readdir(vmdir)))
|
||||
{
|
||||
if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
|
||||
{
|
||||
vmcount++;
|
||||
}
|
||||
}
|
||||
closedir(vmdir);
|
||||
}
|
||||
return x;
|
||||
|
||||
return vmcount;
|
||||
}
|
||||
|
||||
static void resequence_mailbox(char * dir)
|
||||
{
|
||||
/* we know max messages, so stop process when number is hit */
|
||||
|
||||
int x,dest;
|
||||
char sfn[256];
|
||||
char dfn[256];
|
||||
char stxt[256];
|
||||
char dtxt[256];
|
||||
|
||||
for (x=0,dest=0;x<MAXMSG;x++) {
|
||||
make_file(sfn, sizeof(sfn), dir, x);
|
||||
if (ast_fileexists(sfn, NULL, NULL) > 0) {
|
||||
|
||||
if(x != dest) {
|
||||
make_file(dfn, sizeof(dfn), dir, dest);
|
||||
ast_filerename(sfn,dfn,NULL);
|
||||
|
||||
snprintf(stxt, sizeof(stxt), "%s.txt", sfn);
|
||||
snprintf(dtxt, sizeof(dtxt), "%s.txt", dfn);
|
||||
rename(stxt, dtxt);
|
||||
}
|
||||
|
||||
dest++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int say_and_wait(struct ast_channel *chan, int num, char *language)
|
||||
{
|
||||
int d;
|
||||
@@ -2545,6 +2606,20 @@ static void open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu,int box)
|
||||
strncpy(vms->curbox, mbox(box), sizeof(vms->curbox) - 1);
|
||||
make_dir(vms->curdir, sizeof(vms->curdir), vmu->context, vms->username, vms->curbox);
|
||||
vms->lastmsg = count_messages(vms->curdir) - 1;
|
||||
|
||||
/*
|
||||
The following test is needed in case sequencing gets messed up.
|
||||
There appears to be more than one way to mess up sequence, so
|
||||
we will not try to find all of the root causes--just fix it when
|
||||
detected.
|
||||
*/
|
||||
|
||||
if(vms->lastmsg != last_message_index(vms->curdir))
|
||||
{
|
||||
ast_log(LOG_NOTICE, "Resequencing Mailbox: %s\n", vms->curdir);
|
||||
resequence_mailbox(vms->curdir);
|
||||
}
|
||||
|
||||
snprintf(vms->vmbox, sizeof(vms->vmbox), "vm-%s", vms->curbox);
|
||||
}
|
||||
|
||||
@@ -3800,7 +3875,7 @@ static int handle_show_voicemail_users(int fd, int argc, char *argv[])
|
||||
if ((vmdir = opendir(dirname))) {
|
||||
/* No matter what the format of VM, there will always be a .txt file for each message. */
|
||||
while ((vment = readdir(vmdir)))
|
||||
if (!strncmp(vment->d_name + 7,".txt",4))
|
||||
if (strlen(vment->d_name) > 7 && !strncmp(vment->d_name + 7,".txt",4))
|
||||
vmcount++;
|
||||
closedir(vmdir);
|
||||
}
|
||||
@@ -4584,9 +4659,7 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
|
||||
/* User has hung up, no options to give */
|
||||
return res;
|
||||
if (cmd == '0') {
|
||||
/* Erase the message if 0 pushed during playback */
|
||||
ast_play_and_wait(chan, "vm-deleted");
|
||||
vm_delete(recordfile);
|
||||
break;
|
||||
} else if (cmd == '*') {
|
||||
break;
|
||||
}
|
||||
@@ -4639,13 +4712,11 @@ static int play_record_review(struct ast_channel *chan, char *playfile, char *re
|
||||
return 1;
|
||||
#endif
|
||||
case '0':
|
||||
if (outsidecaller && vmu->operator) {
|
||||
if (message_exists)
|
||||
ast_play_and_wait(chan, "vm-msgsaved");
|
||||
return cmd;
|
||||
} else
|
||||
cmd = ast_play_and_wait(chan, "vm-sorry");
|
||||
break;
|
||||
if (message_exists || recorded) {
|
||||
ast_play_and_wait(chan, "vm-deleted");
|
||||
vm_delete(recordfile);
|
||||
}
|
||||
return cmd;
|
||||
default:
|
||||
/* If the caller is an ouside caller, and the review option is enabled,
|
||||
allow them to review the message, but let the owner of the box review
|
||||
|
0
apps/app_waitforring.c
Executable file → Normal file
0
apps/app_waitforring.c
Executable file → Normal file
0
apps/app_zapateller.c
Executable file → Normal file
0
apps/app_zapateller.c
Executable file → Normal file
0
apps/app_zapbarge.c
Executable file → Normal file
0
apps/app_zapbarge.c
Executable file → Normal file
0
apps/app_zapras.c
Executable file → Normal file
0
apps/app_zapras.c
Executable file → Normal file
0
apps/app_zapscan.c
Executable file → Normal file
0
apps/app_zapscan.c
Executable file → Normal file
0
apps/enter.h
Executable file → Normal file
0
apps/enter.h
Executable file → Normal file
0
apps/leave.h
Executable file → Normal file
0
apps/leave.h
Executable file → Normal file
0
apps/rpt_flow.pdf
Executable file → Normal file
0
apps/rpt_flow.pdf
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user