mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-20 19:53:10 +00:00
automerge commit
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@29006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2125,10 +2125,10 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
|
|||||||
|
|
||||||
cur = cur->next;
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
if (qe->parent->timeout)
|
if (qe->expire && (!qe->parent->timeout || (qe->expire - now) <= qe->parent->timeout))
|
||||||
to = qe->parent->timeout * 1000;
|
to = (qe->expire - now) * 1000;
|
||||||
else
|
else
|
||||||
to = -1;
|
to = (qe->parent->timeout) ? qe->parent->timeout * 1000 : -1;
|
||||||
ring_one(qe, outgoing, &numbusies);
|
ring_one(qe, outgoing, &numbusies);
|
||||||
ast_mutex_unlock(&qe->parent->lock);
|
ast_mutex_unlock(&qe->parent->lock);
|
||||||
if (use_weight)
|
if (use_weight)
|
||||||
|
@@ -1178,25 +1178,24 @@ static void sms_messagetx(sms_t * h)
|
|||||||
static int sms_generate (struct ast_channel *chan, void *data, int len, int samples)
|
static int sms_generate (struct ast_channel *chan, void *data, int len, int samples)
|
||||||
{
|
{
|
||||||
struct ast_frame f = { 0 };
|
struct ast_frame f = { 0 };
|
||||||
unsigned char waste[AST_FRIENDLY_OFFSET];
|
#define MAXSAMPLES 800
|
||||||
#ifdef OUTALAW
|
#ifdef OUTALAW
|
||||||
unsigned char buf[800];
|
unsigned char *buf;
|
||||||
#else
|
#else
|
||||||
signed short buf[800];
|
short *buf;
|
||||||
#endif
|
#endif
|
||||||
|
#define SAMPLE2LEN sizeof(*buf)
|
||||||
sms_t *h = data;
|
sms_t *h = data;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (len > sizeof (buf)) {
|
if (samples > MAXSAMPLES) {
|
||||||
ast_log (LOG_WARNING, "Only doing %d bytes (%d bytes requested)\n", (int)(sizeof (buf) / sizeof (signed short)), len);
|
ast_log (LOG_WARNING, "Only doing %d samples (%d requested)\n",
|
||||||
len = sizeof (buf);
|
MAXSAMPLES, samples);
|
||||||
#ifdef OUTALAW
|
samples = MAXSAMPLES;
|
||||||
samples = len;
|
|
||||||
#else
|
|
||||||
samples = len / 2;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
waste[0] = 0; /* make compiler happy */
|
len = samples * SAMPLE2LEN + AST_FRIENDLY_OFFSET;
|
||||||
|
buf = alloca(len);
|
||||||
|
|
||||||
f.frametype = AST_FRAME_VOICE;
|
f.frametype = AST_FRAME_VOICE;
|
||||||
#ifdef OUTALAW
|
#ifdef OUTALAW
|
||||||
f.subclass = AST_FORMAT_ALAW;
|
f.subclass = AST_FORMAT_ALAW;
|
||||||
@@ -1206,8 +1205,7 @@ static int sms_generate (struct ast_channel *chan, void *data, int len, int samp
|
|||||||
f.datalen = samples * 2;
|
f.datalen = samples * 2;
|
||||||
#endif
|
#endif
|
||||||
f.offset = AST_FRIENDLY_OFFSET;
|
f.offset = AST_FRIENDLY_OFFSET;
|
||||||
f.mallocd = 0;
|
f.data = buf + AST_FRIENDLY_OFFSET;
|
||||||
f.data = buf;
|
|
||||||
f.samples = samples;
|
f.samples = samples;
|
||||||
f.src = "app_sms";
|
f.src = "app_sms";
|
||||||
/* create a buffer containing the digital sms pattern */
|
/* create a buffer containing the digital sms pattern */
|
||||||
|
Reference in New Issue
Block a user