mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 14:56:58 +00:00
Merge Olle's comment patch (bug #3097)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1013,15 +1013,15 @@ static int dial_exec(struct ast_channel *chan, void *data)
|
||||
ast_channel_sendurl( peer, url );
|
||||
} /* /JDG */
|
||||
if (announce && announcemsg) {
|
||||
// Start autoservice on the other chan
|
||||
/* Start autoservice on the other chan */
|
||||
res = ast_autoservice_start(chan);
|
||||
// Now Stream the File
|
||||
/* Now Stream the File */
|
||||
if (!res)
|
||||
res = ast_streamfile(peer,announcemsg,peer->language);
|
||||
if (!res) {
|
||||
digit = ast_waitstream(peer, AST_DIGIT_ANY);
|
||||
}
|
||||
// Ok, done. stop autoservice
|
||||
/* Ok, done. stop autoservice */
|
||||
res = ast_autoservice_stop(chan);
|
||||
if (digit > 0 && !res)
|
||||
res = ast_senddigit(chan, digit);
|
||||
|
@@ -120,7 +120,7 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) {
|
||||
if (x != fd)
|
||||
close(x);
|
||||
}
|
||||
//IAS
|
||||
/*IAS */
|
||||
#ifdef __PPC__
|
||||
for( x=0; x<length; x+=2)
|
||||
{
|
||||
@@ -216,7 +216,7 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
|
||||
res = -1;
|
||||
break;
|
||||
}
|
||||
if (res < needed) { // last frame
|
||||
if (res < needed) { /* last frame */
|
||||
ast_log(LOG_DEBUG, "Last frame\n");
|
||||
res=0;
|
||||
break;
|
||||
@@ -231,8 +231,9 @@ static int send_waveform_to_channel(struct ast_channel *chan, char *waveform, in
|
||||
}
|
||||
close(fds[0]);
|
||||
close(fds[1]);
|
||||
// if (pid > -1)
|
||||
// kill(pid, SIGKILL);
|
||||
|
||||
/* if (pid > -1) */
|
||||
/* kill(pid, SIGKILL); */
|
||||
if (!res && owriteformat)
|
||||
ast_set_write_format(chan, owriteformat);
|
||||
return res;
|
||||
|
@@ -799,7 +799,7 @@ zapretry:
|
||||
}
|
||||
}
|
||||
if (user->adminflags & ADMINFLAG_KICKME) {
|
||||
//You have been kicked.
|
||||
/* You have been kicked. */
|
||||
if (!ast_streamfile(chan, "conf-kicked", chan->language))
|
||||
ast_waitstream(chan, "");
|
||||
ret = 0;
|
||||
|
@@ -38,8 +38,8 @@ static char *synopsis = "Play an MP3 file or stream";
|
||||
|
||||
static char *descrip =
|
||||
" MP3Player(location) Executes mpg123 to play the given location\n"
|
||||
"which typically would be a filename or a URL. Returns -1 on\n"
|
||||
"hangup or 0 otherwise. User can exit by pressing any key\n.";
|
||||
"which typically would be a filename o a URL. User can exit by pressing any key\n."
|
||||
"Returns -1 on hangup or 0 otherwise.";
|
||||
|
||||
STANDARD_LOCAL_USER;
|
||||
|
||||
|
@@ -124,7 +124,7 @@ static char *descrip =
|
||||
" The timeout will cause the queue to fail out after a specified number of\n"
|
||||
"seconds, checked between each queues.conf 'timeout' and 'retry' cycle.\n";
|
||||
|
||||
// [PHM 06/26/03]
|
||||
/* PHM 06/26/03 */
|
||||
static char *app_aqm = "AddQueueMember" ;
|
||||
static char *app_aqm_synopsis = "Dynamically adds queue members" ;
|
||||
static char *app_aqm_descrip =
|
||||
@@ -1506,7 +1506,7 @@ static int wait_a_bit(struct queue_ent *qe)
|
||||
return ast_waitfordigit(qe->chan, retrywait);
|
||||
}
|
||||
|
||||
// [PHM 06/26/03]
|
||||
/* [PHM 06/26/03] */
|
||||
|
||||
static struct member * interface_exists( struct ast_call_queue * q, char * interface )
|
||||
{
|
||||
@@ -1994,7 +1994,7 @@ static int queue_exec(struct ast_channel *chan, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
// if (option_debug)
|
||||
/* if (option_debug) */
|
||||
ast_log(LOG_DEBUG, "queue: %s, options: %s, url: %s, announce: %s, timeout: %d, priority: %d\n",
|
||||
queuename, options, url, announceoverride, qe.queuetimeout, (int)prio);
|
||||
|
||||
|
@@ -226,7 +226,7 @@ static int aPGSQL_connect(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l -1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
var=strsep(&stringp," ");
|
||||
optionstring=strsep(&stringp,"\n");
|
||||
|
||||
@@ -267,9 +267,9 @@ static int aPGSQL_query(struct ast_channel *chan, void *data) {
|
||||
s2=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
while (1) { // ugly trick to make branches with break;
|
||||
while (1) { /* ugly trick to make branches with break; */
|
||||
var=s3;
|
||||
s4=strsep(&stringp," ");
|
||||
id=atoi(s4);
|
||||
@@ -330,10 +330,10 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
s2=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
fetchid_var=strsep(&stringp," ");
|
||||
while (1) { // ugly trick to make branches with break;
|
||||
var=fetchid_var; // fetchid
|
||||
while (1) { /* ugly trick to make branches with break; */
|
||||
var=fetchid_var; /* fetchid */
|
||||
fnd=0;
|
||||
|
||||
AST_LIST_TRAVERSE(headp,variables,entries) {
|
||||
@@ -350,19 +350,19 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
}
|
||||
|
||||
s4=strsep(&stringp," ");
|
||||
id=atoi(s4); // resultid
|
||||
id=atoi(s4); /* resultid */
|
||||
if ((PGSQLres=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) {
|
||||
ast_log(LOG_WARNING,"Invalid result identifier %d passed in aPGSQL_fetch\n",id);
|
||||
res=-1;
|
||||
break;
|
||||
}
|
||||
id=atoi(s7); //fetchid
|
||||
id=atoi(s7); /*fetchid */
|
||||
if ((lalares=find_identifier(id,AST_PGSQL_ID_FETCHID))==NULL) {
|
||||
i=0; // fetching the very first row
|
||||
i=0; /* fetching the very first row */
|
||||
} else {
|
||||
i=*lalares;
|
||||
free(lalares);
|
||||
del_identifier(id,AST_PGSQL_ID_FETCHID); // will re-add it a bit later
|
||||
del_identifier(id,AST_PGSQL_ID_FETCHID); /* will re-add it a bit later */
|
||||
}
|
||||
|
||||
if (i<PQntuples(PGSQLres)) {
|
||||
@@ -383,11 +383,11 @@ static int aPGSQL_fetch(struct ast_channel *chan, void *data) {
|
||||
pbx_builtin_setvar_helper(chan,s5,s6);
|
||||
}
|
||||
lalares=malloc(sizeof(int));
|
||||
*lalares = ++i; // advance to the next row
|
||||
*lalares = ++i; /* advance to the next row */
|
||||
id1 = add_identifier(AST_PGSQL_ID_FETCHID,lalares);
|
||||
} else {
|
||||
ast_log(LOG_WARNING,"ast_PGSQL_fetch : EOF\n");
|
||||
id1 = 0; // no more rows
|
||||
id1 = 0; /* no more rows */
|
||||
}
|
||||
snprintf(s, sizeof(s), "%d", id1);
|
||||
ast_log(LOG_WARNING,"Setting var '%s' to value '%s'\n",fetchid_var,s);
|
||||
@@ -413,7 +413,7 @@ static int aPGSQL_reset(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) {
|
||||
@@ -439,7 +439,7 @@ static int aPGSQL_clear(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_RESID))==NULL) {
|
||||
@@ -469,7 +469,7 @@ static int aPGSQL_disconnect(struct ast_channel *chan, void *data) {
|
||||
s1=malloc(l);
|
||||
strncpy(s1, data, l - 1);
|
||||
stringp=s1;
|
||||
strsep(&stringp," "); // eat the first token, we already know it :P
|
||||
strsep(&stringp," "); /* eat the first token, we already know it :P */
|
||||
s3=strsep(&stringp," ");
|
||||
id=atoi(s3);
|
||||
if ((karoto=find_identifier(id,AST_PGSQL_ID_CONNID))==NULL) {
|
||||
|
@@ -1299,7 +1299,7 @@ yuck:
|
||||
#else
|
||||
static int count_messages(char *dir)
|
||||
{
|
||||
// Find all .txt files - even if they are not in sequence from 0000
|
||||
/* Find all .txt files - even if they are not in sequence from 0000 */
|
||||
|
||||
int vmcount = 0;
|
||||
DIR *vmdir = NULL;
|
||||
@@ -2214,12 +2214,10 @@ leave_vm_out:
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifdef USE_ODBC_STORAGE
|
||||
#endif
|
||||
|
||||
static void resequence_mailbox(char * dir)
|
||||
{
|
||||
// we know max messages, so stop process when number is hit
|
||||
/* we know max messages, so stop process when number is hit */
|
||||
|
||||
int x,dest;
|
||||
char sfn[256];
|
||||
|
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* Comma Separated Value CDR records.
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, inc
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License.
|
||||
@@ -39,32 +39,33 @@
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
/* The values are as follows:
|
||||
/*----------------------------------------------------
|
||||
The values are as follows:
|
||||
|
||||
|
||||
"accountcode", // accountcode is the account name of detail records, Master.csv contains all records
|
||||
// Detail records are configured on a channel basis, IAX and SIP are determined by user
|
||||
// Zap is determined by channel in zaptel.conf
|
||||
"accountcode", accountcode is the account name of detail records, Master.csv contains all records *
|
||||
Detail records are configured on a channel basis, IAX and SIP are determined by user *
|
||||
Zap is determined by channel in zaptel.conf
|
||||
"source",
|
||||
"destination",
|
||||
"destination context",
|
||||
"callerid",
|
||||
"channel",
|
||||
"destination channel", (if applicable)
|
||||
"last application", // Last application run on the channel
|
||||
"last app argument", // argument to the last channel
|
||||
"last application", Last application run on the channel
|
||||
"last app argument", argument to the last channel
|
||||
"start time",
|
||||
"answer time",
|
||||
"end time",
|
||||
duration, // Duration is the whole length that the entire call lasted. ie. call rx'd to hangup
|
||||
// "end time" minus "start time"
|
||||
billable seconds, // the duration that a call was up after other end answered which will be <= to duration
|
||||
// "end time" minus "answer time"
|
||||
"disposition", // ANSWERED, NO ANSWER, BUSY
|
||||
"amaflags", // DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.
|
||||
"uniqueid", // unique call identifier
|
||||
"userfield" // user field set via SetCDRUserField
|
||||
*/
|
||||
duration, Duration is the whole length that the entire call lasted. ie. call rx'd to hangup
|
||||
"end time" minus "start time"
|
||||
billable seconds, the duration that a call was up after other end answered which will be <= to duration
|
||||
"end time" minus "answer time"
|
||||
"disposition", ANSWERED, NO ANSWER, BUSY
|
||||
"amaflags", DOCUMENTATION, BILL, IGNORE etc, specified on a per channel basis like accountcode.
|
||||
"uniqueid", unique call identifier
|
||||
"userfield" user field set via SetCDRUserField
|
||||
----------------------------------------------------------*/
|
||||
|
||||
static char *desc = "Comma Separated Values CDR Backend";
|
||||
|
||||
|
@@ -508,7 +508,7 @@ static int agent_call(struct ast_channel *ast, char *dest, int timeout)
|
||||
if (res)
|
||||
ast_log(LOG_WARNING, "Unable to set read format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
|
||||
} else {
|
||||
// Agent hung-up
|
||||
/* Agent hung-up */
|
||||
p->chan = NULL;
|
||||
}
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Asterisk -- A telephony toolkit for Linux.
|
||||
*
|
||||
* Copyright (C) 2002, Linux Support Services
|
||||
* Copyright (C) 2002-2004, Digium, inc
|
||||
*
|
||||
* By Matthew Fredrickson <creslin@linux-support.net>
|
||||
* By Matthew Fredrickson <creslin@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
@@ -61,7 +61,7 @@
|
||||
#define MIN_SWITCH_TIME 600
|
||||
|
||||
static snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
|
||||
//static int block = O_NONBLOCK;
|
||||
/* static int block = O_NONBLOCK; */
|
||||
static char indevname[50] = ALSA_INDEV;
|
||||
static char outdevname[50] = ALSA_OUTDEV;
|
||||
|
||||
@@ -284,14 +284,14 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream)
|
||||
snd_pcm_sw_params_t *swparams = NULL;
|
||||
struct pollfd pfd;
|
||||
snd_pcm_uframes_t period_size = PERIOD_FRAMES * 4;
|
||||
//int period_bytes = 0;
|
||||
/* int period_bytes = 0; */
|
||||
snd_pcm_uframes_t buffer_size = 0;
|
||||
|
||||
unsigned int rate = DESIRED_RATE;
|
||||
#if 0
|
||||
unsigned int per_min = 1;
|
||||
#endif
|
||||
//unsigned int per_max = 8;
|
||||
/* unsigned int per_max = 8; */
|
||||
snd_pcm_uframes_t start_threshold, stop_threshold;
|
||||
|
||||
err = snd_pcm_open(&handle, dev, stream, O_NONBLOCK);
|
||||
@@ -334,7 +334,7 @@ static snd_pcm_t *alsa_card_init(char *dev, snd_pcm_stream_t stream)
|
||||
ast_log(LOG_DEBUG, "Period size is %d\n", err);
|
||||
}
|
||||
|
||||
buffer_size = 4096 * 2; //period_size * 16;
|
||||
buffer_size = 4096 * 2; /* period_size * 16; */
|
||||
err = snd_pcm_hw_params_set_buffer_size_near(handle, hwparams, &buffer_size);
|
||||
if (err < 0) {
|
||||
ast_log(LOG_WARNING, "Problem setting buffer size of %ld: %s\n", buffer_size, snd_strerror(err));
|
||||
@@ -542,7 +542,7 @@ static int alsa_write(struct ast_channel *chan, struct ast_frame *f)
|
||||
int len = sizpos;
|
||||
int pos;
|
||||
int res = 0;
|
||||
//size_t frames = 0;
|
||||
/* size_t frames = 0; */
|
||||
snd_pcm_state_t state;
|
||||
/* Immediately return if no sound is enabled */
|
||||
if (nosound)
|
||||
|
@@ -6617,8 +6617,8 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, in
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "timezone")) {
|
||||
strncpy(peer->zonetag, v->value, sizeof(peer->zonetag)-1);
|
||||
}// else if (strcasecmp(v->name,"type"))
|
||||
// ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
|
||||
}/* else if (strcasecmp(v->name,"type")) */
|
||||
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
|
||||
v=v->next;
|
||||
}
|
||||
if (!peer->authmethods)
|
||||
@@ -6755,8 +6755,8 @@ static struct iax2_user *build_user(const char *name, struct ast_variable *v, in
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "inkeys")) {
|
||||
strncpy(user->inkeys, v->value, sizeof(user->inkeys) - 1);
|
||||
}// else if (strcasecmp(v->name,"type"))
|
||||
// ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
|
||||
}/* else if (strcasecmp(v->name,"type")) */
|
||||
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
|
||||
v = v->next;
|
||||
}
|
||||
if (!user->authmethods) {
|
||||
@@ -7038,8 +7038,8 @@ static int set_config(char *config_file, struct sockaddr_in* sin){
|
||||
}
|
||||
} else if (!strcasecmp(v->name, "language")) {
|
||||
strncpy(language, v->value, sizeof(language) - 1);
|
||||
} //else if (strcasecmp(v->name,"type"))
|
||||
// ast_log(LOG_WARNING, "Ignoring %s\n", v->name);
|
||||
} /*else if (strcasecmp(v->name,"type")) */
|
||||
/* ast_log(LOG_WARNING, "Ignoring %s\n", v->name); */
|
||||
v = v->next;
|
||||
}
|
||||
iax2_capability = capability;
|
||||
|
@@ -1019,7 +1019,7 @@ static int mgcp_show_endpoints(int fd, int argc, char *argv[])
|
||||
e = g->endpoints;
|
||||
ast_cli(fd, "Gateway '%s' at %s (%s)\n", g->name, g->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), g->addr.sin_addr) : ast_inet_ntoa(iabuf, sizeof(iabuf), g->defaddr.sin_addr), g->dynamic ? "Dynamic" : "Static");
|
||||
while(e) {
|
||||
// JS: Don't show wilcard endpoint
|
||||
/* JS: Don't show wilcard endpoint */
|
||||
if (strcmp(e->name, g->wcardep) !=0)
|
||||
ast_cli(fd, " -- '%s@%s in '%s' is %s\n", e->name, g->name, e->context, e->sub->owner ? "active" : "idle");
|
||||
hasendpoints = 1;
|
||||
@@ -1721,7 +1721,7 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
|
||||
#if 0
|
||||
printf("Peer RTP is at port %s:%d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
|
||||
#endif
|
||||
// Scan through the RTP payload types specified in a "m=" line:
|
||||
/* Scan through the RTP payload types specified in a "m=" line: */
|
||||
ast_rtp_pt_clear(sub->rtp);
|
||||
codecs = m + len;
|
||||
while(strlen(codecs)) {
|
||||
@@ -1733,18 +1733,18 @@ static int process_sdp(struct mgcp_subchannel *sub, struct mgcp_request *req)
|
||||
codecs += len;
|
||||
}
|
||||
|
||||
// Next, scan through each "a=rtpmap:" line, noting each
|
||||
// specified RTP payload type (with corresponding MIME subtype):
|
||||
/* Next, scan through each "a=rtpmap:" line, noting each */
|
||||
/* specified RTP payload type (with corresponding MIME subtype): */
|
||||
sdpLineNum_iterator_init(&iterator);
|
||||
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
|
||||
char* mimeSubtype = strdup(a); // ensures we have enough space
|
||||
char* mimeSubtype = strdup(a); /* ensures we have enough space */
|
||||
if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue;
|
||||
// Note: should really look at the 'freq' and '#chans' params too
|
||||
/* Note: should really look at the 'freq' and '#chans' params too */
|
||||
ast_rtp_set_rtpmap_type(sub->rtp, codec, "audio", mimeSubtype);
|
||||
free(mimeSubtype);
|
||||
}
|
||||
|
||||
// Now gather all of the codecs that were asked for:
|
||||
/* Now gather all of the codecs that were asked for: */
|
||||
ast_rtp_get_current_formats(sub->rtp,
|
||||
&peercapability, &peerNonCodecCapability);
|
||||
p->capability = capability & peercapability;
|
||||
@@ -2167,7 +2167,7 @@ static int transmit_audit_endpoint(struct mgcp_endpoint *p)
|
||||
struct mgcp_request resp;
|
||||
reqprep(&resp, p, "AUEP");
|
||||
/* SC: removed unknown param VS */
|
||||
//add_header(&resp, "F", "A,R,D,S,X,N,I,T,O,ES,E,MD,M");
|
||||
/*add_header(&resp, "F", "A,R,D,S,X,N,I,T,O,ES,E,MD,M"); */
|
||||
add_header(&resp, "F", "A");
|
||||
/* SC: fill in new fields */
|
||||
resp.cmd = MGCP_CMD_AUEP;
|
||||
@@ -2923,7 +2923,7 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
|
||||
if (option_verbose > 2 && (strcmp(p->name, p->parent->wcardep) != 0)) {
|
||||
ast_verbose(VERBOSE_PREFIX_3 "Resetting interface %s@%s\n", p->name, p->parent->name);
|
||||
}
|
||||
// JS: For RSIP on wildcard we reset all endpoints
|
||||
/* JS: For RSIP on wildcard we reset all endpoints */
|
||||
if (!strcmp(p->name, p->parent->wcardep)) {
|
||||
/* Reset all endpoints */
|
||||
struct mgcp_endpoint *tmp_ep;
|
||||
@@ -2931,7 +2931,7 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
|
||||
g = p->parent;
|
||||
tmp_ep = g->endpoints;
|
||||
while (tmp_ep) {
|
||||
//if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/*") != 0)) {
|
||||
/*if ((strcmp(tmp_ep->name, "*") != 0) && (strcmp(tmp_ep->name, "aaln/*") != 0)) { */
|
||||
if (strcmp(tmp_ep->name, g->wcardep) != 0) {
|
||||
struct mgcp_subchannel *tmp_sub, *first_sub;
|
||||
if (option_verbose > 2) {
|
||||
@@ -3635,7 +3635,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
|
||||
e->needaudit = 1;
|
||||
}
|
||||
strncpy(gw->wcardep, v->value, sizeof(gw->wcardep)-1);
|
||||
//strncpy(e->name, "aaln/*", sizeof(e->name) - 1);
|
||||
/*strncpy(e->name, "aaln/*", sizeof(e->name) - 1); */
|
||||
/* XXX Should we really check for uniqueness?? XXX */
|
||||
strncpy(e->context, context, sizeof(e->context) - 1);
|
||||
strncpy(e->cid_num, cid_num, sizeof(e->cid_num) - 1);
|
||||
|
@@ -172,8 +172,8 @@ static int i4l_init(struct ast_modem_pvt *p)
|
||||
if (strlen(p->incomingmsn)) {
|
||||
char *q;
|
||||
snprintf(cmd, sizeof(cmd), "AT&L%s", p->incomingmsn);
|
||||
// translate , into ; since that is the seperator I4L uses, but can't be directly
|
||||
// put in the config file because it will interpret the rest of the line as comment.
|
||||
/* translate , into ; since that is the seperator I4L uses, but can't be directly */
|
||||
/* put in the config file because it will interpret the rest of the line as comment. */
|
||||
q = cmd+4;
|
||||
while (*q) {
|
||||
if (*q == ',') *q = ';';
|
||||
@@ -319,9 +319,9 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
|
||||
/* Read the first two bytes, first, in case it's a control message */
|
||||
res = read(p->fd, result, 2);
|
||||
if (res < 2) {
|
||||
// short read, means there was a hangup?
|
||||
// (or is this also possible without hangup?)
|
||||
// Anyway, reading from unitialized buffers is a bad idea anytime.
|
||||
/* short read, means there was a hangup? */
|
||||
/* (or is this also possible without hangup?) */
|
||||
/* Anyway, reading from unitialized buffers is a bad idea anytime. */
|
||||
if (errno == EAGAIN)
|
||||
return i4l_handle_escape(p, 0);
|
||||
return NULL;
|
||||
@@ -337,7 +337,7 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p)
|
||||
ast_modem_trim(result);
|
||||
if (!strcasecmp(result, "VCON")) {
|
||||
/* If we're in immediate mode, reply now */
|
||||
// if (p->mode == MODEM_MODE_IMMEDIATE)
|
||||
/* if (p->mode == MODEM_MODE_IMMEDIATE) */
|
||||
return i4l_handle_escape(p, 'X');
|
||||
} else
|
||||
if (!strcasecmp(result, "BUSY")) {
|
||||
@@ -587,11 +587,11 @@ static int i4l_dial(struct ast_modem_pvt *p, char *stuff)
|
||||
char tmpmsn[255];
|
||||
struct ast_channel *c = p->owner;
|
||||
|
||||
// Find callerid number first, to set the correct A number
|
||||
/* Find callerid number first, to set the correct A number */
|
||||
if (c && c->cid.cid_num && !(c->cid.cid_pres & 0x20)) {
|
||||
snprintf(tmpmsn, sizeof(tmpmsn), ",%s,", c->cid.cid_num);
|
||||
if(strlen(p->outgoingmsn) && strstr(p->outgoingmsn,tmpmsn) != NULL) {
|
||||
// Tell ISDN4Linux to use this as A number
|
||||
/* Tell ISDN4Linux to use this as A number */
|
||||
snprintf(cmd, sizeof(cmd), "AT&E%s\n", c->cid.cid_num);
|
||||
if (ast_modem_send(p, cmd, strlen(cmd))) {
|
||||
ast_log(LOG_WARNING, "Unable to set A number to %s\n", c->cid.cid_num);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Implementation of the Skinny protocol
|
||||
*
|
||||
* Asterisk is Copyright (C) 1999-2003 Mark Spencer
|
||||
* Copyright (C) 1999-2004 Digium, inc
|
||||
*
|
||||
* chan_skinny was developed by Jeremy McNamara & Florian Overkamp
|
||||
*
|
||||
@@ -1449,7 +1449,7 @@ static void *skinny_ss(void *data)
|
||||
((exten[0] != '*') || (!ast_strlen_zero(exten) > 2))) {
|
||||
ast_log(LOG_WARNING, "Can't match [%s] from '%s' in context %s\n", exten, chan->cid.cid_num ? chan->cid.cid_num : "<Unknown Caller>", chan->context);
|
||||
transmit_tone(s, SKINNY_REORDER);
|
||||
sleep(3); // hang out for 3 seconds to let congestion play
|
||||
sleep(3); /* hang out for 3 seconds to let congestion play */
|
||||
break;
|
||||
}
|
||||
if (!timeout)
|
||||
@@ -2716,7 +2716,7 @@ void delete_devices(void)
|
||||
int reload(void)
|
||||
{
|
||||
#if 0
|
||||
// XXX Causes Seg
|
||||
/* XXX Causes Seg - needs to be fixed, or? */
|
||||
|
||||
delete_devices();
|
||||
reload_config();
|
||||
|
@@ -5,9 +5,10 @@
|
||||
* Based on frompcm.c and topcm.c from the Emiliano MIPL browser/
|
||||
* interpreter. See http://www.bsdtelephony.com.mx
|
||||
*
|
||||
* Copyright (c) 2001 Linux Support Services, Inc. All rights reserved.
|
||||
* Copyright (c) 2001-2004 Digium, inc
|
||||
* All rights reserved.
|
||||
*
|
||||
* Karl Sackett <krs@linux-support.net>, 2001-3-21
|
||||
* Karl Sackett <krs@linux-support.net>, 2001-03-21
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* Based on frompcm.c and topcm.c from the Emiliano MIPL browser/
|
||||
* interpreter. See http://www.bsdtelephony.com.mx
|
||||
*
|
||||
* Copyright (c) 2004, Digium
|
||||
* Copyright (c) 2004, Digium, inc
|
||||
*
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
|
@@ -8,9 +8,9 @@
|
||||
*
|
||||
* See http://www.arl.wustl.edu/~jaf/
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004 Digium,inc
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
|
@@ -187,7 +187,7 @@ static int g729_seek(struct ast_filestream *fs, long sample_offset, int whence)
|
||||
if (whence != SEEK_FORCECUR) {
|
||||
offset = (offset > max)?max:offset;
|
||||
}
|
||||
// protect against seeking beyond begining.
|
||||
/* protect against seeking beyond begining. */
|
||||
offset = (offset < min)?min:offset;
|
||||
if (lseek(fs->fd, offset, SEEK_SET) < 0)
|
||||
return -1;
|
||||
|
@@ -3,9 +3,9 @@
|
||||
*
|
||||
* Save to raw, headerless GSM data.
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, inc
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
@@ -200,7 +200,7 @@ static int gsm_seek(struct ast_filestream *fs, long sample_offset, int whence)
|
||||
offset = distance + cur;
|
||||
else if(whence == SEEK_END)
|
||||
offset = max - distance;
|
||||
// Always protect against seeking past the begining.
|
||||
/* Always protect against seeking past the begining. */
|
||||
offset = (offset < min)?min:offset;
|
||||
if (whence != SEEK_FORCECUR) {
|
||||
offset = (offset > max)?max:offset;
|
||||
|
@@ -5,9 +5,9 @@
|
||||
*
|
||||
* Brian K. West <brian@bkw.org>
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2004, Digium, inc
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
@@ -189,7 +189,7 @@ static int ilbc_seek(struct ast_filestream *fs, long sample_offset, int whence)
|
||||
if (whence != SEEK_FORCECUR) {
|
||||
offset = (offset > max)?max:offset;
|
||||
}
|
||||
// protect against seeking beyond begining.
|
||||
/* protect against seeking beyond begining. */
|
||||
offset = (offset < min)?min:offset;
|
||||
if (lseek(fs->fd, offset, SEEK_SET) < 0)
|
||||
return -1;
|
||||
|
@@ -175,7 +175,7 @@ static int slinear_seek(struct ast_filestream *fs, long sample_offset, int whenc
|
||||
if (whence != SEEK_FORCECUR) {
|
||||
offset = (offset > max)?max:offset;
|
||||
}
|
||||
// always protect against seeking past begining.
|
||||
/* always protect against seeking past begining. */
|
||||
offset = (offset < min)?min:offset;
|
||||
return lseek(fs->fd, offset, SEEK_SET);
|
||||
}
|
||||
|
@@ -501,7 +501,7 @@ static int wav_seek(struct ast_filestream *fs, long sample_offset, int whence)
|
||||
offset = distance + cur;
|
||||
else if(whence == SEEK_END)
|
||||
offset = max - distance;
|
||||
// always protect against seeking past end of header
|
||||
/* always protect against seeking past end of header */
|
||||
offset = (offset < min)?min:offset;
|
||||
if (whence != SEEK_FORCECUR) {
|
||||
offset = (offset > max)?max:offset;
|
||||
|
52
utils/smsq.c
52
utils/smsq.c
@@ -10,8 +10,8 @@
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
// SMS queuing application for use with asterisk app_sms
|
||||
// by Adrian Kennard, 2004
|
||||
/* SMS queuing application for use with asterisk app_sms */
|
||||
/* by Adrian Kennard, 2004 */
|
||||
|
||||
/* reads next USC character from null terminated UTF-8 string and advanced pointer */
|
||||
/* for non valid UTF-8 sequences, returns character as is */
|
||||
@@ -65,8 +65,8 @@ static int utf8decode (unsigned char **pp)
|
||||
return *p; /* not sensible */
|
||||
}
|
||||
|
||||
// check for any queued messages in specific queue (queue="" means any queue)
|
||||
// returns 0 if nothing queued, 1 if queued and outgoing set up OK, 2 of outgoing exists
|
||||
/* check for any queued messages in specific queue (queue="" means any queue) */
|
||||
/* returns 0 if nothing queued, 1 if queued and outgoing set up OK, 2 of outgoing exists */
|
||||
static char txqcheck (char *dir, char *queue, char subaddress, char *channel, char *callerid, int wait, int delay, int retries, int concurrent)
|
||||
{
|
||||
char ogname[100],
|
||||
@@ -90,7 +90,7 @@ static char txqcheck (char *dir, char *queue, char subaddress, char *channel, ch
|
||||
return 0;
|
||||
}
|
||||
if (!ql)
|
||||
{ // not searching any specific queue, so use whatr we found as the queue
|
||||
{ /* not searching any specific queue, so use whatr we found as the queue */
|
||||
queue = fn->d_name;
|
||||
ql = p - queue;
|
||||
}
|
||||
@@ -150,18 +150,18 @@ static char txqcheck (char *dir, char *queue, char subaddress, char *channel, ch
|
||||
try++;
|
||||
snprintf(ogname, sizeof(ogname), "outgoing/smsq.%s.%s.%d", dir, queue, try);
|
||||
if (!link (temp, ogname))
|
||||
{ // queued OK
|
||||
{ /* queued OK */
|
||||
unlink (temp);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// failed to create call queue
|
||||
/* failed to create call queue */
|
||||
unlink (temp);
|
||||
return 2;
|
||||
}
|
||||
|
||||
// Process received queue entries and run through a process, setting environment variables
|
||||
/* Process received queue entries and run through a process, setting environment variables */
|
||||
static void rxqcheck (char *dir, char *queue, char *process)
|
||||
{
|
||||
unsigned char *p;
|
||||
@@ -186,7 +186,7 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
FILE *f;
|
||||
snprintf (filename, sizeof(filename), "sms/%s/%s", dir, fn->d_name);
|
||||
if (rename (filename, temp))
|
||||
continue; // cannot access file
|
||||
continue; /* cannot access file */
|
||||
f = fopen (temp, "r");
|
||||
unlink (temp);
|
||||
if (!f)
|
||||
@@ -229,7 +229,7 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
while (isspace (*p))
|
||||
*p++ = 0;
|
||||
if (*p == '=')
|
||||
{ // =
|
||||
{ /* = */
|
||||
*p++ = 0;
|
||||
if (!strcmp (line, "oa") || !strcmp (line, "da") || !strcmp (line, "scts") || !strcmp (line, "pid")
|
||||
|| !strcmp (line, "dcs") || !strcmp (line, "mr") || !strcmp (line, "vp"))
|
||||
@@ -237,7 +237,7 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
else if ((!strcmp (line, "srr") || !strcmp (line, "rp")) && atoi (p))
|
||||
setenv (line, "", 1);
|
||||
else if (!strcmp (line, "ud"))
|
||||
{ // read the user data as UTF-8
|
||||
{ /* read the user data as UTF-8 */
|
||||
long v;
|
||||
udl = 0;
|
||||
while ((v = utf8decode (&p)) && udl < 160)
|
||||
@@ -248,12 +248,12 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
{
|
||||
*p++ = 0;
|
||||
if (*p == '#')
|
||||
{ // ##
|
||||
{ /* ## */
|
||||
p++;
|
||||
if (!strcmp (line, "udh"))
|
||||
setenv (line, p, 1);
|
||||
else if (!strcmp (line, "ud"))
|
||||
{ // read user data UCS-2
|
||||
{ /* read user data UCS-2 */
|
||||
udl = 0;
|
||||
while (*p && udl < 160)
|
||||
{
|
||||
@@ -269,9 +269,9 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
}
|
||||
}
|
||||
} else
|
||||
{ // #
|
||||
{ /* # */
|
||||
if (!strcmp (line, "ud"))
|
||||
{ // read user data UCS-1
|
||||
{ /* read user data UCS-1 */
|
||||
udl = 0;
|
||||
while (*p && udl < 160)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
}
|
||||
}
|
||||
fclose (f);
|
||||
// set up user data variables
|
||||
/* set up user data variables */
|
||||
{
|
||||
char temp[481];
|
||||
int n,
|
||||
@@ -367,13 +367,13 @@ static void rxqcheck (char *dir, char *queue, char *process)
|
||||
}
|
||||
setenv ("ud16", temp, 1);
|
||||
}
|
||||
// run the command
|
||||
/* run the command */
|
||||
system (process);
|
||||
}
|
||||
closedir (d);
|
||||
}
|
||||
|
||||
// Main app
|
||||
/* Main app */
|
||||
int
|
||||
main (int argc, const char *argv[])
|
||||
{
|
||||
@@ -417,7 +417,7 @@ main (int argc, const char *argv[])
|
||||
*defaultsubaddress = "9",
|
||||
subaddress = 0,
|
||||
*scts = 0;
|
||||
poptContext optCon; // context for parsing command-line options
|
||||
poptContext optCon; /* context for parsing command-line options */
|
||||
const struct poptOption optionsTable[] = {
|
||||
{"queue", 'q', POPT_ARG_STRING | POPT_ARGFLAG_SHOW_DEFAULT, &queue, 0, "Queue [inc sub address]", "number[-X]"},
|
||||
{"da", 'd', POPT_ARG_STRING, &da, 0, "Destination address", "number"},
|
||||
@@ -485,7 +485,7 @@ main (int argc, const char *argv[])
|
||||
fprintf (stderr, "Command line arguments always treated as UTF-8\n");
|
||||
return 1;
|
||||
}
|
||||
// if (!where && poptPeekArg (optCon)) where = (char *) poptGetArg (optCon);
|
||||
/* if (!where && poptPeekArg (optCon)) where = (char *) poptGetArg (optCon); */
|
||||
if (!mt && !mo && process)
|
||||
mt = 1;
|
||||
if (!mt && !mo && oa)
|
||||
@@ -585,7 +585,7 @@ main (int argc, const char *argv[])
|
||||
return 1;
|
||||
}
|
||||
if (udfile)
|
||||
{ // get message from file
|
||||
{ /* get message from file */
|
||||
unsigned char dat[1204],
|
||||
*p = dat,
|
||||
*e;
|
||||
@@ -642,14 +642,14 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
|
||||
if (oa || da)
|
||||
{ // send message
|
||||
{ /* send message */
|
||||
char temp[100],
|
||||
queuename[100],
|
||||
*dir = (mo ? rx ? "sms/morx" : "sms/motx" : rx ? "sms/mtrx" : "sms/mttx");
|
||||
FILE *f;
|
||||
snprintf (temp, sizeof(temp), "sms/.smsq-%d", getpid ());
|
||||
mkdir ("sms", 0777); // ensure directory exists
|
||||
mkdir (dir, 0777); // ensure directory exists
|
||||
mkdir ("sms", 0777); /* ensure directory exists */
|
||||
mkdir (dir, 0777); /* ensure directory exists */
|
||||
snprintf (queuename, sizeof(queuename), "%s/%s.%ld-%d", dir, *queue ? queue : "0", (long)time (0), getpid ());
|
||||
f = fopen (temp, "w");
|
||||
if (!f)
|
||||
@@ -713,7 +713,7 @@ main (int argc, const char *argv[])
|
||||
}
|
||||
|
||||
if (!nodial && tx && !process)
|
||||
{ // dial to send messages
|
||||
{ /* dial to send messages */
|
||||
char ret=0,
|
||||
try = 3;
|
||||
if (nowait)
|
||||
@@ -725,7 +725,7 @@ main (int argc, const char *argv[])
|
||||
else
|
||||
ret = txqcheck ("mttx", queue, subaddress, mttxchannel, mttxcallerid, mttxwait, mttxdelay, mttxretries, concurrent);
|
||||
if (ret < 2)
|
||||
break; // sent, or queued OK
|
||||
break; /* sent, or queued OK */
|
||||
if (try)
|
||||
sleep (1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user