mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-18 15:54:05 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e9791815e4 | ||
|
|
be16aac57d | ||
|
|
f4387c881c | ||
|
|
d2aafad4fb | ||
|
|
1ac03f4abd | ||
|
|
4ed56df62c | ||
|
|
f42ada7a25 | ||
|
|
84c5074ec3 | ||
|
|
932f5ca647 | ||
|
|
71fdd7d526 | ||
|
|
643879cabc | ||
|
|
703220f1f4 |
1
.lastclean
Normal file
1
.lastclean
Normal file
@@ -0,0 +1 @@
|
||||
9
|
||||
2
CREDITS
2
CREDITS
@@ -95,7 +95,7 @@ Leif Madsen, Jared Smith and Jim van Meggelen - the Asterisk book
|
||||
available under a Creative Commons License at http://www.asteriskdocs.org
|
||||
|
||||
=== HOLD MUSIC ===
|
||||
Music provided by www.freeplaymusic.com
|
||||
Music provided by www.opsound.org
|
||||
|
||||
=== OTHER SOURCE CODE IN ASTERISK ===
|
||||
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -58,7 +58,7 @@ contact us:
|
||||
+1.877.546.8963 (via telephone in the USA)
|
||||
+1.256.428.6000 (via telephone outside the USA)
|
||||
+1.256.864.0464 (via FAX inside or outside the USA)
|
||||
IAX2/misery.digium.com/6000 (via IAX2)
|
||||
IAX2/pbx.digium.com (via IAX2)
|
||||
licensing@digium.com (via email)
|
||||
|
||||
Digium, Inc.
|
||||
|
||||
@@ -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
|
||||
@@ -294,7 +294,7 @@ static int hash_zero(const void *user_obj, const int flags)
|
||||
* A container is just an object, after all!
|
||||
*/
|
||||
struct ao2_container *
|
||||
ao2_container_alloc(const uint n_buckets, ao2_hash_fn hash_fn,
|
||||
ao2_container_alloc(const unsigned int n_buckets, ao2_hash_fn hash_fn,
|
||||
ao2_callback_fn cmp_fn)
|
||||
{
|
||||
/* XXX maybe consistency check on arguments ? */
|
||||
|
||||
@@ -164,6 +164,7 @@ static int trunkfreq = 20;
|
||||
static int authdebug = 1;
|
||||
static int autokill = 0;
|
||||
static int iaxcompat = 0;
|
||||
static int lastauthmethod = 0;
|
||||
|
||||
static int iaxdefaultdpcache=10 * 60; /* Cache dialplan entries for 10 minutes by default */
|
||||
|
||||
@@ -1318,10 +1319,10 @@ static int find_callno(unsigned short callno, unsigned short dcallno, struct soc
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
start = 1 + (rand() % (TRUNK_CALL_START - 1));
|
||||
start = 2 + (rand() % (TRUNK_CALL_START - 1));
|
||||
for (x = start; 1; x++) {
|
||||
if (x == TRUNK_CALL_START) {
|
||||
x = 0;
|
||||
x = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2750,7 +2751,7 @@ static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in
|
||||
if (peername) {
|
||||
var = ast_load_realtime("iaxpeers", "name", peername, "host", "dynamic", NULL);
|
||||
if (!var && sin)
|
||||
var = ast_load_realtime("iaxpeers", "name", peername, "host", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
|
||||
var = ast_load_realtime("iaxpeers", "name", peername, "host", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), (char *) NULL);
|
||||
} else if (sin) {
|
||||
char porta[25];
|
||||
ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr);
|
||||
@@ -2874,7 +2875,7 @@ static struct iax2_user *realtime_user(const char *username, struct sockaddr_in
|
||||
|
||||
var = ast_load_realtime("iaxusers", "name", username, "host", "dynamic", NULL);
|
||||
if (!var && sin)
|
||||
var = ast_load_realtime("iaxusers", "name", username, "host", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr));
|
||||
var = ast_load_realtime("iaxusers", "name", username, "host", ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), (char *) NULL);
|
||||
if (!var && sin) {
|
||||
char porta[6];
|
||||
snprintf(porta, sizeof(porta), "%d", ntohs(sin->sin_port));
|
||||
@@ -3102,7 +3103,7 @@ struct parsed_dial_string {
|
||||
static int send_apathetic_reply(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int command, int ts, unsigned char seqno)
|
||||
{
|
||||
struct ast_iax2_full_hdr f = { .scallno = htons(0x8000 | callno), .dcallno = htons(dcallno),
|
||||
.ts = htonl(ts), .iseqno = seqno, .oseqno = seqno, .type = AST_FRAME_IAX,
|
||||
.ts = htonl(ts), .iseqno = seqno, .oseqno = 0, .type = AST_FRAME_IAX,
|
||||
.csub = compress_subclass(command) };
|
||||
|
||||
return sendto(defaultsockfd, &f, sizeof(f), 0, (struct sockaddr *)sin, sizeof(*sin));
|
||||
@@ -6087,23 +6088,34 @@ static int registry_authrequest(char *name, int callno)
|
||||
{
|
||||
struct iax_ie_data ied;
|
||||
struct iax2_peer *p;
|
||||
int authmethods;
|
||||
|
||||
if (!iaxs[callno]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* SLD: third call to find_peer in registration */
|
||||
p = find_peer(name, 1);
|
||||
if (p) {
|
||||
memset(&ied, 0, sizeof(ied));
|
||||
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
|
||||
if (p->authmethods & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
|
||||
/* Build the challenge */
|
||||
snprintf(iaxs[callno]->challenge, sizeof(iaxs[callno]->challenge), "%d", rand());
|
||||
iax_ie_append_str(&ied, IAX_IE_CHALLENGE, iaxs[callno]->challenge);
|
||||
}
|
||||
iax_ie_append_str(&ied, IAX_IE_USERNAME, name);
|
||||
if (ast_test_flag(p, IAX_TEMPONLY))
|
||||
destroy_peer(p);
|
||||
return send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, ied.buf, ied.pos, -1);;
|
||||
}
|
||||
ast_log(LOG_WARNING, "No such peer '%s'\n", name);
|
||||
return 0;
|
||||
if ((p = find_peer(name, 1))) {
|
||||
lastauthmethod = p->authmethods;
|
||||
}
|
||||
|
||||
authmethods = p ? p->authmethods : lastauthmethod ? lastauthmethod : (IAX_AUTH_PLAINTEXT | IAX_AUTH_MD5);
|
||||
if (p && ast_test_flag(p, IAX_TEMPONLY)) {
|
||||
destroy_peer(p);
|
||||
} else if (!delayreject) {
|
||||
ast_log(LOG_WARNING, "No such peer '%s'\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&ied, 0, sizeof(ied));
|
||||
iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
|
||||
if (authmethods & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
|
||||
/* Build the challenge */
|
||||
snprintf(iaxs[callno]->challenge, sizeof(iaxs[callno]->challenge), "%d", rand());
|
||||
iax_ie_append_str(&ied, IAX_IE_CHALLENGE, iaxs[callno]->challenge);
|
||||
}
|
||||
iax_ie_append_str(&ied, IAX_IE_USERNAME, name);
|
||||
return send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_REGAUTH, 0, ied.buf, ied.pos, -1);;
|
||||
}
|
||||
|
||||
static int registry_rerequest(struct iax_ies *ies, int callno, struct sockaddr_in *sin)
|
||||
@@ -6842,7 +6854,7 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
|
||||
/* Deal with POKE/PONG without allocating a callno */
|
||||
if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_POKE) {
|
||||
/* Reply back with a PONG, but don't care about the result. */
|
||||
send_apathetic_reply(1, ntohs(fh->scallno), &sin, IAX_COMMAND_PONG, ntohs(fh->ts), fh->oseqno);
|
||||
send_apathetic_reply(1, ntohs(fh->scallno), &sin, IAX_COMMAND_PONG, ntohs(fh->ts), fh->iseqno + 1);
|
||||
return 1;
|
||||
} else if (f.frametype == AST_FRAME_IAX && f.subclass == IAX_COMMAND_ACK && dcallno == 1) {
|
||||
/* Ignore */
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#ifndef _ASTERISK_ASTOBJ2_H
|
||||
#define _ASTERISK_ASTOBJ2_H
|
||||
|
||||
#include "asterisk/compat.h"
|
||||
|
||||
/*! \file
|
||||
*
|
||||
* \brief Object Model implementing objects and containers.
|
||||
@@ -330,7 +332,7 @@ struct ao2_container;
|
||||
*
|
||||
* destructor is set implicitly.
|
||||
*/
|
||||
struct ao2_container *ao2_container_alloc(const uint n_buckets,
|
||||
struct ao2_container *ao2_container_alloc(const unsigned int n_buckets,
|
||||
ao2_hash_fn hash_fn, ao2_callback_fn cmp_fn);
|
||||
|
||||
/*!
|
||||
@@ -527,11 +529,11 @@ struct ao2_iterator {
|
||||
/*! current bucket */
|
||||
int bucket;
|
||||
/*! container version */
|
||||
uint c_version;
|
||||
unsigned int c_version;
|
||||
/*! pointer to the current object */
|
||||
void *obj;
|
||||
/*! container version when the object was created */
|
||||
uint version;
|
||||
unsigned int version;
|
||||
};
|
||||
|
||||
struct ao2_iterator ao2_iterator_init(struct ao2_container *c, int flags);
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short u_int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
|
||||
char* strsep(char** str, const char* delims);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
Music Provided By www.freeplaymusic.com. These sound files are provided by
|
||||
Digium under license from Freeplay Music Corporation for use in conjunction
|
||||
with the Asterisk software only.
|
||||
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.
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
sounds/moh/macroform-cold_day.mp3
Normal file
BIN
sounds/moh/macroform-cold_day.mp3
Normal file
Binary file not shown.
BIN
sounds/moh/macroform-robot_dity.mp3
Normal file
BIN
sounds/moh/macroform-robot_dity.mp3
Normal file
Binary file not shown.
BIN
sounds/moh/macroform-the_simplicity.mp3
Normal file
BIN
sounds/moh/macroform-the_simplicity.mp3
Normal file
Binary file not shown.
BIN
sounds/moh/manolo_camp-morning_coffee.mp3
Normal file
BIN
sounds/moh/manolo_camp-morning_coffee.mp3
Normal file
Binary file not shown.
BIN
sounds/moh/reno_project-system.mp3
Normal file
BIN
sounds/moh/reno_project-system.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user