1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

Add asterisk16 after repo-copy from net/asterisk. Some functions (e.g.

DAHDI support) are still missed and will be added on later date.
This commit is contained in:
Maxim Sobolev 2009-02-14 21:17:22 +00:00
parent 6cd9fd8746
commit 38e1f1309a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=228315
24 changed files with 970 additions and 1333 deletions

View File

@ -35,6 +35,7 @@
SUBDIR += asterisk12
SUBDIR += asterisk12-addons
SUBDIR += asterisk12-app-ldap
SUBDIR += asterisk16
SUBDIR += astfax
SUBDIR += astmanproxy
SUBDIR += atmsupport

View File

@ -6,8 +6,8 @@
#
PORTNAME= asterisk
PORTVERSION= 1.4.22.1
PORTREVISION= 1
PORTVERSION= 1.6.0.5
PKGNAMESUFFIX= 16
CATEGORIES= net
MASTER_SITES= http://downloads.digium.com/pub/asterisk/ \
http://downloads.digium.com/pub/asterisk/old-releases/ \
@ -41,8 +41,10 @@ MAKE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
OPENH323DIR=${LOCALBASE}/share/openh323 \
OSVERSION=${OSVERSION} \
NOISY_BUILD=YES \
DOCSDIR=${DOCSDIR} \
ASTCFLAGS="${CFLAGS}"
MAN8= asterisk.8 astgenkey.8 autosupport.8 safe_asterisk.8
CONFLICTS= asterisk*-1.2* asterisk*-1.4*
OPTIONS= OGGVORBIS "Enable Ogg Vorbis support" on \
ODBC "Enable ODBC support" on \
@ -53,14 +55,14 @@ OPTIONS= OGGVORBIS "Enable Ogg Vorbis support" on \
FREETDS "Enable FreeTDS support" on \
JABBER "Enable Jabber and Gtalk support" on \
SQLITE "Enable SQLITE support" on \
CODEC_PATCH "Apply codec negotiation patch" off \
ILBC "Enable iLBC codec" off \
MISC_PATCHES "Apply additional patches" off
# CODEC_PATCH "Apply codec negotiation patch" off \
# MISC_PATCHES "Apply additional patches" off
.include <bsd.port.pre.mk>
.if ${ARCH} == "i386" || ${ARCH} == "amd64"
OPTIONS+= ZAPTEL "Enable Zaptel support" off
#OPTIONS+= ZAPTEL "Enable Zaptel support" off
# Include this since we have altered OPTIONS.
.include "$(PORTSDIR)/Mk/bsd.port.options.mk"

View File

@ -1,6 +1,3 @@
MD5 (asterisk-1.4.22.1.tar.gz) = 00bfb39b63a614acb032cae0494de888
SHA256 (asterisk-1.4.22.1.tar.gz) = aef8fd6d9dbf135fcd0259d73382bf8a485f378cc6572214fd92e718806209d6
SIZE (asterisk-1.4.22.1.tar.gz) = 11602819
MD5 (asterisk-1.4.22-codec-negotiation-20081110.diff.gz) = 56aeedb24ea3042138b68792b8edbc40
SHA256 (asterisk-1.4.22-codec-negotiation-20081110.diff.gz) = fb765bdd6aa028ae519648348e9c7d2a91a2338079f9d32f89022d2dbb4b434b
SIZE (asterisk-1.4.22-codec-negotiation-20081110.diff.gz) = 40040
MD5 (asterisk-1.6.0.5.tar.gz) = 3a5461059738ef745b9c3161c1ffaba8
SHA256 (asterisk-1.6.0.5.tar.gz) = 24511963dab4740e56b0afeec2b62b87af3e5bb19ef784dda34e36a871f1abeb
SIZE (asterisk-1.6.0.5.tar.gz) = 13251816

View File

@ -1,225 +0,0 @@
--- include/asterisk/rtp.h.orig 2008-03-18 13:35:42.000000000 +0200
+++ include/asterisk/rtp.h 2008-03-18 13:35:58.000000000 +0200
@@ -251,6 +251,9 @@
int ast_rtp_codec_getformat(int pt);
+void ast_rtp_set_chan_name(struct ast_rtp *, const char *);
+void ast_rtp_set_chan_id(struct ast_rtp *, const char *);
+
/*! \brief Set rtp timeout */
void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout);
/*! \brief Set rtp hold timeout */
--- main/rtp.c.orig 2008-04-08 14:53:18.000000000 +0300
+++ main/rtp.c 2008-04-08 14:54:14.000000000 +0300
@@ -81,6 +81,7 @@
static int rtpstart; /*!< First port for RTP sessions (set in rtp.conf) */
static int rtpend; /*!< Last port for RTP sessions (set in rtp.conf) */
static int rtpdebug; /*!< Are we debugging? */
+static int rtpdebugdtmf; /*!< Are we debugging DTMFs? */
static int rtcpdebug; /*!< Are we debugging RTCP? */
static int rtcpstats; /*!< Are we debugging RTCP? */
static int rtcpinterval = RTCP_DEFAULT_INTERVALMS; /*!< Time between rtcp reports in millisecs */
@@ -168,6 +169,8 @@
struct ast_codec_pref pref;
struct ast_rtp *bridged; /*!< Who we are Packet bridged to */
int set_marker_bit:1; /*!< Whether to set the marker bit or not */
+ char chan_name[100];
+ char chan_id[100];
};
/* Forward declarations */
@@ -669,8 +672,8 @@
struct ast_frame *f = NULL;
event = ntohl(*((unsigned int *)(data)));
event &= 0x001F;
- if (option_debug > 2 || rtpdebug)
- ast_log(LOG_DEBUG, "Cisco DTMF Digit: %08x (len = %d)\n", event, len);
+ if (option_debug > 2 || rtpdebug || rtpdebugdtmf)
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF packet: %08x (len = %d)\n", rtp->chan_name, rtp->chan_id, event, len);
if (event < 10) {
resp = '0' + event;
} else if (event < 11) {
@@ -684,12 +687,24 @@
}
if (rtp->resp && (rtp->resp != resp)) {
f = send_dtmf(rtp, AST_FRAME_DTMF_END);
+ ast_log(LOG_DEBUG, "Channel: %s %s Cisco DTMF event: %c\n", rtp->chan_name, rtp->chan_id, rtp->resp);
}
rtp->resp = resp;
rtp->dtmfcount = dtmftimeout;
return f;
}
+void ast_rtp_set_chan_id(struct ast_rtp *rtp, const char *chan_id) {
+ if (rtp == NULL || chan_id == NULL)
+ return;
+ snprintf(rtp->chan_id, sizeof(rtp->chan_id), "%s", chan_id);
+}
+
+void ast_rtp_set_chan_name(struct ast_rtp *rtp, const char *chan_name) {
+ if (rtp == NULL || chan_name == NULL)
+ return;
+ snprintf(rtp->chan_name, sizeof(rtp->chan_name), "%s", chan_name);
+}
/*!
* \brief Process RTP DTMF and events according to RFC 2833.
*
@@ -1051,6 +1066,10 @@
struct rtpPayloadType rtpPT;
int reconstruct = ntohl(rtpheader[0]);
+ /* If we are listening for DTMF - then feed all packets into the core to keep the RTP stream consistent when relaying DTMFs */
+ if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF))
+ return -1;
+
/* Get fields from packet */
payload = (reconstruct & 0x7f0000) >> 16;
mark = (((reconstruct & 0x800000) >> 23) != 0);
@@ -1062,10 +1081,6 @@
if (!bridged->current_RTP_PT[payload].code)
return -1;
- /* If the payload is DTMF, and we are listening for DTMF - then feed it into the core */
- if (ast_test_flag(rtp, FLAG_P2P_NEED_DTMF) && !rtpPT.isAstFormat && rtpPT.code == AST_RTP_DTMF)
- return -1;
-
/* Otherwise adjust bridged payload to match */
bridged_payload = ast_rtp_lookup_code(bridged, rtpPT.isAstFormat, rtpPT.code);
@@ -1254,11 +1269,12 @@
/* This is special in-band data that's not one of our codecs */
if (rtpPT.code == AST_RTP_DTMF) {
/* It's special -- rfc2833 process it */
- if (rtp_debug_test_addr(&sin)) {
+ if (rtp_debug_test_addr(&sin) || rtpdebugdtmf) {
unsigned char *data;
unsigned int event;
unsigned int event_end;
unsigned int duration;
+
data = rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen;
event = ntohl(*((unsigned int *)(data)));
event >>= 24;
@@ -1267,9 +1283,12 @@
event_end >>= 24;
duration = ntohl(*((unsigned int *)(data)));
duration &= 0xFFFF;
- ast_verbose("Got RTP RFC2833 from %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d) \n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
+
+ ast_verbose("Channel: %s %s Got RTP RFC2833 from %s:%u to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u, mark %d, event %08x, end %d, duration %-5.5d)\n", rtp->chan_name, rtp->chan_id, ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port), ast_inet_ntoa(rtp->us.sin_addr), ntohs(rtp->us.sin_port), payloadtype, seqno, timestamp, res - hdrlen, (mark?1:0), event, ((event_end & 0x80)?1:0), duration);
}
f = process_rfc2833(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen, seqno, timestamp);
+ if (rtpdebugdtmf && f)
+ ast_verbose("Channel: %s %s Got RFC2833 DTMF event %c of type %s\n", rtp->chan_name, rtp->chan_id, f->subclass, (f->frametype == AST_FRAME_DTMF_BEGIN ? "DTMF BEGIN" : (f->frametype == AST_FRAME_DTMF_END ? "DTMF_END" : "UNKNOWN")));
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
if (rtp->lastevent <= seqno || (rtp->lastevent >= 65530 && seqno <= 6)) {
@@ -2198,8 +2217,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%u: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
/* Increment sequence number */
@@ -2242,8 +2262,9 @@
ast_log(LOG_ERROR, "RTP Transmission error to %s:%d: %s\n",
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), strerror(errno));
- if (rtp_debug_test_addr(&rtp->them))
- ast_verbose("Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ if (rtp_debug_test_addr(&rtp->them) || rtpdebugdtmf)
+ ast_verbose("Channel: %s %s Sent RTP DTMF packet to %s:%u (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",
+ rtp->chan_name, rtp->chan_id,
ast_inet_ntoa(rtp->them.sin_addr),
ntohs(rtp->them.sin_port), rtp->send_payload, rtp->seqno, rtp->lastdigitts, res - hdrlen);
@@ -3481,6 +3502,16 @@
return RESULT_SUCCESS;
}
+static int rtp_do_debug_dtmf(int fd, int argc, char *argv[])
+{
+ if (argc != 3)
+ return RESULT_SHOWUSAGE;
+
+ rtpdebugdtmf = 1;
+ ast_cli(fd, "RTP DTMF debugging enabled\n");
+ return RESULT_SUCCESS;
+}
+
static int rtp_do_debug(int fd, int argc, char *argv[])
{
if (argc != 2) {
@@ -3541,6 +3572,7 @@
if (argc != 3)
return RESULT_SHOWUSAGE;
rtpdebug = 0;
+ rtpdebugdtmf = 0;
ast_cli(fd,"RTP Debugging Disabled\n");
return RESULT_SUCCESS;
}
@@ -3601,7 +3633,7 @@
}
static char debug_usage[] =
- "Usage: rtp debug [ip host[:port]]\n"
+ "Usage: rtp debug [ip host[:port] | dtmf]\n"
" Enable dumping of all RTP packets to and from host.\n";
static char no_debug_usage[] =
@@ -3676,6 +3708,10 @@
rtp_do_debug, "Enable RTP debugging",
debug_usage },
+ { { "rtp", "debug", "dtmf", NULL },
+ rtp_do_debug_dtmf, "Enable RTP debugging on DTMFs",
+ debug_usage },
+
{ { "rtp", "debug", "off", NULL },
rtp_no_debug, "Disable RTP debugging",
no_debug_usage, NULL, &cli_rtp_no_debug_deprecated },
--- channels/chan_sip.c.orig 2008-06-10 00:29:41.000000000 -0700
+++ channels/chan_sip.c 2008-06-10 00:42:00.000000000 -0700
@@ -3813,6 +3813,7 @@
ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
else {
p->owner = newchan;
+ ast_rtp_set_chan_name(p->rtp, newchan->name);
/* Re-invite RTP back to Asterisk. Needed if channel is masqueraded out of a native
RTP bridge (i.e., RTP not going through Asterisk): RTP bridge code might not be
able to do this if the masquerade happens before the bridge breaks (e.g., AMI
@@ -4085,6 +4086,7 @@
if (i->rtp) {
tmp->fds[0] = ast_rtp_fd(i->rtp);
tmp->fds[1] = ast_rtcp_fd(i->rtp);
+ ast_rtp_set_chan_id(i->rtp, i->callid);
}
if (needvideo && i->vrtp) {
tmp->fds[2] = ast_rtp_fd(i->vrtp);
@@ -4112,6 +4114,8 @@
if (!ast_strlen_zero(i->language))
ast_string_field_set(tmp, language, i->language);
i->owner = tmp;
+ ast_rtp_set_chan_name(i->rtp, tmp->name);
+
ast_module_ref(ast_module_info->self);
ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
/*Since it is valid to have extensions in the dialplan that have unescaped characters in them
@@ -4531,8 +4535,10 @@
build_via(p);
if (!callid)
build_callid_pvt(p);
- else
+ else {
ast_string_field_set(p, callid, callid);
+ ast_rtp_set_chan_id(p->rtp, p->callid);
+ }
/* Assign default music on hold class */
ast_string_field_set(p, mohinterpret, default_mohinterpret);
ast_string_field_set(p, mohsuggest, default_mohsuggest);

View File

@ -1,276 +0,0 @@
--- apps/app_dial.c.orig 2008-08-06 02:13:20.000000000 +0300
+++ apps/app_dial.c 2009-01-06 16:54:27.000000000 +0200
@@ -303,6 +303,8 @@
OPT_CALLEE_MONITOR | OPT_CALLER_MONITOR | OPT_CALLEE_PARK | OPT_CALLER_PARK) && \
!chan->audiohooks && !peer->audiohooks)
+static int detect_disconnect(struct ast_channel *chan, char code);
+
/* We define a custom "local user" structure because we
use it not only for keeping track of what is in use but
also for keeping track of who we're dialing. */
@@ -732,9 +734,9 @@
}
if (ast_test_flag(peerflags, OPT_CALLER_HANGUP) &&
- (f->subclass == '*')) { /* hmm it it not guaranteed to be '*' anymore. */
+ detect_disconnect(in, f->subclass)) { /* hmm it it not guaranteed to be '*' anymore. */
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "User hit %c to disconnect call.\n", f->subclass);
+ ast_verbose(VERBOSE_PREFIX_3 "User requested call disconnect.\n");
*to=0;
ast_cdr_noanswer(in->cdr);
strcpy(status, "CANCEL");
@@ -775,6 +777,56 @@
return peer;
}
+static char featurecode[FEATURE_MAX_LEN + 1] = "";
+
+static int detect_disconnect(struct ast_channel *chan, char code)
+{
+ struct feature_interpret_result result;
+ int x;
+ struct ast_flags features;
+ int res = FEATURE_RETURN_PASSDIGITS;
+ struct ast_call_feature *feature;
+ char *cptr;
+ int len;
+
+ len = strlen(featurecode);
+ if (len >= FEATURE_MAX_LEN) {
+ featurecode[0] = '\0';
+ }
+ cptr = &featurecode[strlen(featurecode)];
+ cptr[0] = code;
+ cptr[1] = '\0';
+
+ memset(&features, 0, sizeof(struct ast_flags));
+ ast_set_flag(&features, AST_FEATURE_DISCONNECT);
+
+ ast_features_lock();
+
+ res = ast_feature_detect(chan, &features, featurecode, &result);
+
+ if (res != FEATURE_RETURN_STOREDIGITS)
+ featurecode[0] = '\0';
+
+ if (result.builtin_feature && result.builtin_feature->feature_mask & AST_FEATURE_DISCONNECT) {
+ ast_features_unlock();
+ return 1;
+ }
+
+ for (x = 0; x < result.num_dyn_features; ++x) {
+ feature = result.dynamic_features[x];
+ if (feature->feature_mask & AST_FEATURE_DISCONNECT) {
+ ast_features_unlock();
+ return 1;
+ }
+ }
+
+ ast_features_unlock();
+
+ return 0;
+}
+
+
+
static void replace_macro_delimiter(char *s)
{
for (; *s; s++)
--- include/asterisk/features.h.orig 2007-08-23 23:16:41.000000000 +0300
+++ include/asterisk/features.h 2009-01-06 16:54:27.000000000 +0200
@@ -31,6 +31,20 @@
#define FEATURE_EXTEN_LEN 32
#define FEATURE_MOH_LEN 80 /* same as MAX_MUSICCLASS from channel.h */
+#define FEATURE_RETURN_HANGUP -1
+#define FEATURE_RETURN_SUCCESSBREAK 0
+#define FEATURE_RETURN_PBX_KEEPALIVE AST_PBX_KEEPALIVE
+#define FEATURE_RETURN_NO_HANGUP_PEER AST_PBX_NO_HANGUP_PEER
+#define FEATURE_RETURN_PASSDIGITS 21
+#define FEATURE_RETURN_STOREDIGITS 22
+#define FEATURE_RETURN_SUCCESS 23
+#define FEATURE_RETURN_KEEPTRYING 24
+
+#define FEATURE_SENSE_CHAN (1 << 0)
+#define FEATURE_SENSE_PEER (1 << 1)
+
+typedef int (*feature_operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
+
/*! \brief main call feature structure */
struct ast_call_feature {
int feature_mask;
@@ -38,7 +52,7 @@
char sname[FEATURE_SNAME_LEN];
char exten[FEATURE_MAX_LEN];
char default_exten[FEATURE_MAX_LEN];
- int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense, void *data);
+ feature_operation operation;
unsigned int flags;
char app[FEATURE_APP_LEN];
char app_args[FEATURE_APP_ARGS_LEN];
@@ -47,6 +61,12 @@
};
+struct feature_interpret_result {
+ struct ast_call_feature *builtin_feature;
+ struct ast_call_feature *dynamic_features[20];
+ int num_dyn_features;
+};
+
/*! \brief Park a call and read back parked location
* \param chan the channel to actually be parked
@@ -94,4 +114,10 @@
\param feature the ast_call_feature object which was registered before*/
void ast_unregister_feature(struct ast_call_feature *feature);
+int ast_feature_detect(struct ast_channel *chan, const struct ast_flags *features, char *code, struct feature_interpret_result *result);
+
+void ast_features_lock(void);
+void ast_features_unlock(void);
+
+
#endif /* _AST_FEATURES_H */
--- res/res_features.c.orig 2008-09-09 18:40:24.000000000 +0300
+++ res/res_features.c 2009-01-06 16:58:57.000000000 +0200
@@ -517,18 +517,6 @@
}
-#define FEATURE_RETURN_HANGUP -1
-#define FEATURE_RETURN_SUCCESSBREAK 0
-#define FEATURE_RETURN_PBX_KEEPALIVE AST_PBX_KEEPALIVE
-#define FEATURE_RETURN_NO_HANGUP_PEER AST_PBX_NO_HANGUP_PEER
-#define FEATURE_RETURN_PASSDIGITS 21
-#define FEATURE_RETURN_STOREDIGITS 22
-#define FEATURE_RETURN_SUCCESS 23
-#define FEATURE_RETURN_KEEPTRYING 24
-
-#define FEATURE_SENSE_CHAN (1 << 0)
-#define FEATURE_SENSE_PEER (1 << 1)
-
/*! \brief
* set caller and callee according to the direction
*/
@@ -1126,33 +1114,36 @@
return res;
}
-static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
+void ast_features_lock(void)
+{
+ ast_rwlock_rdlock(&features_lock);
+ AST_LIST_LOCK(&feature_list);
+}
+
+void ast_features_unlock(void)
+{
+ AST_LIST_UNLOCK(&feature_list);
+ ast_rwlock_unlock(&features_lock);
+}
+
+int ast_feature_detect(struct ast_channel *chan, const struct ast_flags *features, char *code, struct feature_interpret_result *result)
{
int x;
- struct ast_flags features;
struct ast_call_feature *feature;
- const char *dynamic_features;
+ const char *dynamic_features = pbx_builtin_getvar_helper(chan, "DYNAMIC_FEATURES");
char *tmp, *tok;
int res = FEATURE_RETURN_PASSDIGITS;
int feature_detected = 0;
- if (sense == FEATURE_SENSE_CHAN) {
- ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL);
- dynamic_features = pbx_builtin_getvar_helper(chan, "DYNAMIC_FEATURES");
- } else {
- ast_copy_flags(&features, &(config->features_callee), AST_FLAGS_ALL);
- dynamic_features = pbx_builtin_getvar_helper(peer, "DYNAMIC_FEATURES");
- }
- if (option_debug > 2)
- ast_log(LOG_DEBUG, "Feature interpret: chan=%s, peer=%s, code=%s, sense=%d, features=%d dynamic=%s\n", chan->name, peer->name, code, sense, features.flags, dynamic_features);
+ result->builtin_feature = NULL;
+ result->num_dyn_features = 0;
- ast_rwlock_rdlock(&features_lock);
for (x = 0; x < FEATURES_COUNT; x++) {
- if ((ast_test_flag(&features, builtin_features[x].feature_mask)) &&
+ if ((ast_test_flag(features, builtin_features[x].feature_mask)) &&
!ast_strlen_zero(builtin_features[x].exten)) {
/* Feature is up for consideration */
if (!strcmp(builtin_features[x].exten, code)) {
- res = builtin_features[x].operation(chan, peer, config, code, sense, NULL);
+ result->builtin_feature = &builtin_features[x];
feature_detected = 1;
break;
} else if (!strncmp(builtin_features[x].exten, code, strlen(code))) {
@@ -1169,9 +1160,7 @@
tmp = ast_strdupa(dynamic_features);
while ((tok = strsep(&tmp, "#"))) {
- AST_LIST_LOCK(&feature_list);
if (!(feature = find_dynamic_feature(tok))) {
- AST_LIST_UNLOCK(&feature_list);
continue;
}
@@ -1179,21 +1168,52 @@
if (!strcmp(feature->exten, code)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 " Feature Found: %s exten: %s\n",feature->sname, tok);
- res = feature->operation(chan, peer, config, code, sense, feature);
- if (res != FEATURE_RETURN_KEEPTRYING) {
- AST_LIST_UNLOCK(&feature_list);
+ result->dynamic_features[result->num_dyn_features++] = feature;
+ if (result->num_dyn_features >= (sizeof(result->dynamic_features) / sizeof(result->dynamic_features[0]))) {
break;
}
res = FEATURE_RETURN_PASSDIGITS;
} else if (!strncmp(feature->exten, code, strlen(code)))
res = FEATURE_RETURN_STOREDIGITS;
- AST_LIST_UNLOCK(&feature_list);
}
return res;
}
+static int ast_feature_interpret(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense)
+{
+ struct feature_interpret_result result;
+ int x;
+ struct ast_flags features;
+ int res = FEATURE_RETURN_PASSDIGITS;
+ struct ast_call_feature *feature;
+
+ if (sense == FEATURE_SENSE_CHAN)
+ ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL);
+ else
+ ast_copy_flags(&features, &(config->features_callee), AST_FLAGS_ALL);
+ if (option_debug > 2)
+ ast_log(LOG_DEBUG, "Feature interpret: chan=%s, peer=%s, sense=%d, features=%d\n", chan->name, peer->name, sense, features.flags);
+
+ ast_features_lock();
+ res = ast_feature_detect(chan, &features, code, &result);
+
+ if (result.builtin_feature)
+ res = result.builtin_feature->operation(chan, peer, config, code, sense, NULL);
+
+ for (x = 0; x < result.num_dyn_features; ++x) {
+ feature = result.dynamic_features[x];
+ res = feature->operation(chan, peer, config, code, sense, feature);
+ if (res != FEATURE_RETURN_KEEPTRYING)
+ break;
+ res = FEATURE_RETURN_PASSDIGITS;
+ }
+
+ ast_features_unlock();
+ return res;
+}
+
static void set_config_flags(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config)
{
int x;

View File

@ -1,36 +1,45 @@
--- Makefile.orig 2008-05-05 13:17:55.000000000 -0700
+++ Makefile 2008-06-10 01:07:09.000000000 -0700
@@ -129,7 +129,7 @@
--- Makefile.orig 2008-12-02 16:53:56.000000000 -0800
+++ Makefile 2009-02-14 12:36:45.000000000 -0800
@@ -117,7 +117,7 @@
OVERWRITE=y
# Include debug and macro symbols in the executables (-g) and profiling info (-pg)
-DEBUG=-g3
+#DEBUG=-g3
# Define standard directories for various platforms
@@ -147,7 +147,7 @@
ASTMANDIR=$(mandir)
ifneq ($(findstring BSD,$(OSARCH)),)
ASTVARLIBDIR=$(prefix)/share/asterisk
- ASTVARRUNDIR=$(localstatedir)/run/asterisk
+ ASTVARRUNDIR=$(localstatedir)/run
ASTDBDIR=$(localstatedir)/db/asterisk
else
ASTVARLIBDIR=$(localstatedir)/lib/asterisk
endif
@@ -214,9 +214,11 @@
@@ -242,9 +242,11 @@
ASTLDFLAGS+=-L/usr/local/lib
endif
+ifneq ($(OSARCH),FreeBSD)
ifneq ($(PROC),ultrasparc)
ASTCFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
endif
+endif
ifeq ($(PROC),ppc)
ASTCFLAGS+=-fsigned-char
@@ -224,7 +224,7 @@
@@ -252,7 +254,7 @@
ifeq ($(OSARCH),FreeBSD)
# -V is understood by BSD Make, not by GNU make.
- BSDVERSION=$(shell make -V OSVERSION -f /usr/share/mk/bsd.port.subdir.mk)
+ BSDVERSION=$(OSVERSION)
ASTCFLAGS+=$(shell if test $(BSDVERSION) -lt 500016 ; then echo "-D_THREAD_SAFE"; fi)
AST_LIBS+=$(shell if test $(BSDVERSION) -lt 502102 ; then echo "-lc_r"; else echo "-pthread"; fi)
endif
@@ -404,15 +404,15 @@
@@ -461,21 +463,21 @@
# Should static HTTP be installed during make samples or even with its own target ala
# webvoicemail? There are portions here that *could* be customized but might also be
# improved a lot. I'll put it here for now.
@ -40,6 +49,14 @@
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTDATADIR)/static-http ; \
done
if [ -d doc/tex/asterisk ] ; then \
- mkdir -p $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(MKDIR) $(DESTDIR)$(DOCSDIR) ; \
for n in doc/tex/asterisk/* ; do \
- $(INSTALL) -m 644 $$n $(DESTDIR)$(ASTDATADIR)/static-http/docs ; \
+ $(BSD_INSTALL_DATA) $$n $(DESTDIR)$(DOCSDIR) ; \
done \
fi
- mkdir -p $(DESTDIR)$(ASTDATADIR)/images
+ $(MKDIR) $(DESTDIR)$(ASTDATADIR)/images
for x in images/*.jpg; do \
@ -51,7 +68,7 @@
$(MAKE) -C sounds install
update:
@@ -433,47 +433,47 @@
@@ -499,47 +501,47 @@
OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
installdirs:
@ -90,7 +107,7 @@
- cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
- chmod 755 $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
+ cat contrib/scripts/safe_asterisk | sed 's|__ASTERISK_SBIN_DIR__|$(ASTSBINDIR)|;s|__ASTERISK_VARRUN_DIR__|$(ASTVARRUNDIR)|;' > contrib/scripts/safe_asterisk.out;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ;\
+ ${BSD_INSTALL_SCRIPT} contrib/scripts/safe_asterisk.out $(DESTDIR)$(ASTSBINDIR)/safe_asterisk;\
fi
- $(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
- $(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
@ -131,7 +148,7 @@
fi
$(SUBDIRS_INSTALL):
@@ -507,7 +507,7 @@
@@ -573,7 +575,7 @@
@exit 1
endif
@ -140,31 +157,37 @@
@if [ -x /usr/sbin/asterisk-post-install ]; then \
/usr/sbin/asterisk-post-install $(DESTDIR) . ; \
fi
@@ -545,31 +545,23 @@
upgrade: bininstall
@@ -605,38 +607,25 @@
# XXX why *.adsi is installed first ?
adsi:
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.adsi; do \
if [ ! -f $(DESTDIR)$(ASTETCDIR)/$$x ]; then \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
@echo Installing adsi config files...
- @mkdir -p $(DESTDIR)$(ASTETCDIR)
+ @$(MKDIR) $(DESTDIR)$(ASTETCDIR)
@for x in configs/*.adsi; do \
dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`" ; \
if [ -f $${dst} ] ; then \
- echo "Overwriting $$x" ; \
- else \
- echo "Installing $$x" ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x` ; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x`-dist ; \
done
samples: adsi
- mkdir -p $(DESTDIR)$(ASTETCDIR)
+ $(MKDIR) $(DESTDIR)$(ASTETCDIR)
for x in configs/*.sample; do \
- if [ -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
@echo Installing other config files...
- @mkdir -p $(DESTDIR)$(ASTETCDIR)
+ @$(MKDIR) $(DESTDIR)$(ASTETCDIR)
@for x in configs/*.sample; do \
- dst="$(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`" ; \
- if [ -f $${dst} ]; then \
- if [ "$(OVERWRITE)" = "y" ]; then \
- if cmp -s $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $$x ; then \
- if cmp -s $${dst} $$x ; then \
- echo "Config file $$x is unchanged"; \
- continue; \
- fi ; \
- mv -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`.old ; \
- mv -f $${dst} $${dst}.old ; \
- else \
- echo "Skipping config file $$x"; \
- continue; \
@ -173,21 +196,22 @@
+ if [ ! -f $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ]; then \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample`;\
fi ; \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(ASTETCDIR)/`$(BASENAME) $$x .sample` ;\
- echo "Installing file $$x"; \
- $(INSTALL) -m 644 $$x $${dst} ;\
done
- if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ if true; then \
- @if [ "$(OVERWRITE)" = "y" ] || [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ @if true; then \
echo "Creating asterisk.conf"; \
( \
echo "[directories]" ; \
echo "astetcdir => $(ASTETCDIR)" ; \
@@ -614,20 +606,23 @@
echo ";astctlowner = root" ; \
echo ";astctlgroup = apache" ; \
echo ";astctl = asterisk.ctl" ; \
echo "[directories](!) ; remove the (!) to enable this" ; \
@@ -692,13 +681,16 @@
echo "pbx_realtime=1.6" ; \
echo "res_agi=1.6" ; \
echo "app_set=1.6" ; \
- ) > $(DESTDIR)$(ASTCONFPATH) ; \
+ ) > $(DESTDIR)$(ASTCONFPATH)-dist ; \
+ if [ ! -f $(DESTDIR)$(ASTCONFPATH) ]; then \
+ cp $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ $(BSD_INSTALL_DATA) $(DESTDIR)$(ASTCONFPATH)-dist $(DESTDIR)$(ASTCONFPATH); \
+ fi; \
else \
echo "Skipping asterisk.conf creation"; \
@ -195,6 +219,18 @@
- mkdir -p $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
+ $(MKDIR) $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)
- @mkdir -p $(DESTDIR)$(ASTDATADIR)/phoneprov
+ @$(MKDIR) $(DESTDIR)$(ASTDATADIR)/phoneprov
@for x in phoneprov/*; do \
dst="$(DESTDIR)$(ASTDATADIR)/$$x" ; \
if [ -f $${dst} ]; then \
@@ -714,14 +706,14 @@
fi ;\
fi ; \
echo "Installing file $$x"; \
- $(INSTALL) -m 644 $$x $${dst} ;\
+ $(BSD_INSTALL_DATA) $$x $${dst} ;\
done
webvmail:
@[ -d $(DESTDIR)$(HTTP_DOCSDIR)/ ] || ( printf "http docs directory not found.\nUpdate assignment of variable HTTP_DOCSDIR in Makefile!\n" && exit 1 )
@ -203,8 +239,5 @@
- mkdir -p $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
+ $(MKDIR) $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk
for x in images/*.gif; do \
- $(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
+ $(BSD_INSTALL_DATA) $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
$(INSTALL) -m 644 $$x $(DESTDIR)$(HTTP_DOCSDIR)/_asterisk/; \
done
@echo " +--------- Asterisk Web Voicemail ----------+"
@echo " + +"

View File

@ -3,19 +3,13 @@ $FreeBSD$
--- Makefile.rules
+++ Makefile.rules
@@ -27,6 +27,7 @@
CMD_PREFIX=
@@ -35,7 +35,9 @@
CMD_PREFIX=
endif
+ifneq ($(OSARCH),FreeBSD)
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
# More GSM codec optimization
# Uncomment to enable MMXTM optimizations for x86 architecture CPU's
@@ -37,6 +38,7 @@
OPTIMIZE?=-O6
ASTCFLAGS+=$(OPTIMIZE)
endif
+endif
%.o: %.c
$(ECHO_PREFIX) echo " [CC] $< -> $@"
ifeq ($(findstring DONT_OPTIMIZE,$(MENUSELECT_CFLAGS)),)
# More GSM codec optimization

View File

@ -1,5 +1,8 @@
--- agi/Makefile.orig Sat Dec 16 23:14:34 2006
+++ agi/Makefile Wed Mar 28 11:13:21 2007
$FreeBSD$
--- agi/Makefile
+++ agi/Makefile
@@ -13,7 +13,9 @@
.PHONY: clean all uninstall
@ -11,7 +14,7 @@
ifeq ($(OSARCH),SunOS)
LIBS+=-lsocket -lnsl
@@ -31,8 +33,9 @@ eagi-test: eagi-test.o strcompat.o
@@ -40,8 +42,9 @@
eagi-sphinx-test: eagi-sphinx-test.o
install: all

View File

@ -1,9 +1,9 @@
$FreeBSD$
--- channels/Makefile.orig
--- channels/Makefile
+++ channels/Makefile
@@ -32,9 +32,10 @@
@@ -27,9 +27,10 @@
endif
ifeq ($(OSARCH),FreeBSD)
@ -16,7 +16,7 @@ $FreeBSD$
endif
ifeq ($(OSARCH),NetBSD)
@@ -78,12 +79,13 @@
@@ -69,12 +70,13 @@
h323/libchanh323.a h323/Makefile.ast:
$(CMD_PREFIX) $(MAKE) -C h323
$(CMD_PREFIX) rm -f ../main/asterisk
@ -26,7 +26,7 @@ $FreeBSD$
- $(CMD_PREFIX) echo
- $(CMD_PREFIX) echo "***************************************************************"
- $(CMD_PREFIX) exit 1
+ $(CMD_PREFIX) $(MAKE) -C . chan_h323.so
+ $(MAKE) -C . chan_h323.so
+# $(CMD_PREFIX) echo "***************************************************************"
+# $(CMD_PREFIX) echo
+# $(CMD_PREFIX) echo "********** Re-run 'make' to pick up H.323 parameters **********"
@ -36,7 +36,7 @@ $FreeBSD$
endif
dist-clean::
@@ -113,8 +115,12 @@
@@ -89,8 +91,12 @@
else
chan_h323.so: chan_h323.o h323/libchanh323.a
$(ECHO_PREFIX) echo " [LD] $^ -> $@"

View File

@ -1,11 +1,14 @@
--- channels/chan_sip.c.orig 2008-06-10 00:46:46.000000000 -0700
+++ channels/chan_sip.c 2008-06-10 00:46:46.000000000 -0700
@@ -496,7 +496,7 @@
$FreeBSD$
--- channels/chan_sip.c
+++ channels/chan_sip.c
@@ -611,7 +611,7 @@
#define DEFAULT_MOHINTERPRET "default"
#define DEFAULT_MOHSUGGEST ""
#define DEFAULT_VMEXTEN "asterisk"
-#define DEFAULT_CALLERID "asterisk"
+#define DEFAULT_CALLERID "Unknown"
#define DEFAULT_NOTIFYMIME "application/simple-message-summary"
#define DEFAULT_MWITIME 10
#define DEFAULT_ALLOWGUEST TRUE
#define DEFAULT_CALLCOUNTER FALSE

View File

@ -0,0 +1,14 @@
$FreeBSD$
--- channels/h323/Makefile.in
+++ channels/h323/Makefile.in
@@ -13,7 +13,7 @@
STDCCFLAGS += -I../../include -include ../../include/asterisk/autoconfig.h
STDCCFLAGS += -fPIC
#OPTCCFLAGS +=
-CFLAGS = -pipe
+CFLAGS = -pipe @CXXFLAGS@
TARGET = libchanh323.a
TARGET += Makefile.ast
SOURCES = ast_h323.cxx compat_h323.cxx cisco-h225.cxx caps_h323.cxx

View File

@ -1,27 +1,18 @@
$FreeBSD$
--- configure.orig
--- configure
+++ configure
@@ -3951,8 +3951,6 @@
@@ -4041,8 +4041,6 @@
case "${host_os}" in
freebsd*)
ac_default_prefix=/usr/local
- CPPFLAGS=-I/usr/local/include
- LDFLAGS=-L/usr/local/lib
;;
*)
ac_default_prefix=/usr
@@ -27517,7 +27515,7 @@
if test "${HAS_PWLIB:-unset}" != "unset"; then
- PWLIB_VERSION=`grep "PWLIB_VERSION" ${PWLIB_INCDIR}/ptbuildopts.h | cut -f2 -d ' ' | sed -e 's/"//g'`
+ PWLIB_VERSION=`grep "PWLIB_VERSION" ${PWLIB_INCDIR}/ptbuildopts.h | tr '\t' ' ' | cut -f3 -d ' ' | sed -e 's/"//g'`
PWLIB_MAJOR_VERSION=`echo ${PWLIB_VERSION} | cut -f1 -d.`
PWLIB_MINOR_VERSION=`echo ${PWLIB_VERSION} | cut -f2 -d.`
PWLIB_BUILD_NUMBER=`echo ${PWLIB_VERSION} | cut -f3 -d.`
@@ -28118,6 +28116,7 @@
@@ -41733,6 +41731,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
@ -29,7 +20,7 @@ $FreeBSD$
#include <${HOME}/openh323/include/h323.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -28158,6 +28157,7 @@
@@ -41773,6 +41772,7 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
@ -37,7 +28,7 @@ $FreeBSD$
#include <${HOME}/openh323/include/h323.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
@@ -28260,6 +28260,7 @@
@@ -41875,6 +41875,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
@ -45,7 +36,7 @@ $FreeBSD$
#include </usr/local/include/openh323/h323.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -28300,6 +28301,7 @@
@@ -41915,6 +41916,7 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
@ -53,16 +44,7 @@ $FreeBSD$
#include </usr/local/include/openh323/h323.h>
_ACEOF
if { (ac_try="$ac_cpp conftest.$ac_ext"
@@ -28477,7 +28479,7 @@
if test "${HAS_OPENH323:-unset}" != "unset"; then
- OPENH323_VERSION=`grep "OPENH323_VERSION" ${OPENH323_INCDIR}/openh323buildopts.h | cut -f2 -d ' ' | sed -e 's/"//g'`
+ OPENH323_VERSION=`grep "OPENH323_VERSION" ${OPENH323_INCDIR}/openh323buildopts.h | tr '\t' ' ' | cut -f3 -d ' ' | sed -e 's/"//g'`
OPENH323_MAJOR_VERSION=`echo ${OPENH323_VERSION} | cut -f1 -d.`
OPENH323_MINOR_VERSION=`echo ${OPENH323_VERSION} | cut -f2 -d.`
OPENH323_BUILD_NUMBER=`echo ${OPENH323_VERSION} | cut -f3 -d.`
@@ -28552,7 +28554,7 @@
@@ -42167,7 +42169,7 @@
fi
@ -71,7 +53,7 @@ $FreeBSD$
if test "${HAS_OPENH323:-unset}" != "unset"; then
{ echo "$as_me:$LINENO: checking OpenH323 installation validity" >&5
@@ -34788,6 +34790,7 @@
@@ -47131,6 +47133,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
@ -79,7 +61,7 @@ $FreeBSD$
#include <h323.h>
_ACEOF
rm -f conftest.$ac_objext
@@ -34828,6 +34831,7 @@
@@ -47171,6 +47174,7 @@
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */

View File

@ -1,13 +0,0 @@
$FreeBSD$
--- include/asterisk/utils.h 2004/10/10 12:55:50 1.1
+++ include/asterisk/utils.h 2004/10/10 12:56:43
@@ -37,7 +37,6 @@
#ifdef inet_ntoa
#undef inet_ntoa
#endif
-#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__
#ifdef LINUX
#define ast_pthread_create pthread_create

View File

@ -1,34 +1,32 @@
$FreeBSD$
--- main/Makefile.orig
--- main/Makefile
+++ main/Makefile
@@ -102,8 +102,8 @@
@@ -110,8 +110,8 @@
cd editline && test -f config.h || CFLAGS="$(PTHREAD_CFLAGS) $(subst $(ASTTOPDIR),../../,$(ASTCFLAGS:-Werror=))" LDFLAGS="$(ASTLDFLAGS)" ./configure --build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) --with-ncurses=$(NCURSES_DIR) --with-curses=$(CURSES_DIR) --with-termcap=$(TERMCAP_DIR) --with-tinfo=$(TINFO_DIR)
$(MAKE) -C editline libedit.a
-db1-ast/libdb1.a:
-db1-ast/libdb1.a: CHECK_SUBDIR
- CFLAGS="$(subst $(ASTTOPDIR),../../,$(ASTCFLAGS))" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
+#db1-ast/libdb1.a:
+#db1-ast/libdb1.a: CHECK_SUBDIR
+# CFLAGS="$(subst $(ASTTOPDIR),../../,$(ASTCFLAGS))" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
ast_expr2.c ast_expr2.h:
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
@@ -138,7 +138,7 @@
H323LDLIBS=
@@ -168,13 +168,13 @@
GMIMELDFLAGS+=$(GMIME_LIB)
endif
-asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+asterisk: $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
@$(ASTTOPDIR)/build_tools/make_build_h > $(ASTTOPDIR)/include/asterisk/build.h.tmp
@if cmp -s $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; then echo ; else \
mv $(ASTTOPDIR)/include/asterisk/build.h.tmp $(ASTTOPDIR)/include/asterisk/build.h ; \
@@ -149,7 +149,7 @@
-$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a $(AST_EMBED_LDSCRIPTS)
+$(MAIN_TGT): $(OBJS) editline/libedit.a $(AST_EMBED_LDSCRIPTS)
@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS)
$(CMD_PREFIX) $(CC) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
else
- $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS)
+ $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS)
- $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(H323LDLIBS) $(GMIMELDFLAGS)
+ $(CMD_PREFIX) $(CXX) $(STATIC_BUILD) -o $@ $(ASTLINK) $(AST_EMBED_LDFLAGS) $(ASTLDFLAGS) $(H323LDFLAGS) $^ buildinfo.o $(AST_LIBS) $(AST_EMBED_LIBS) $(GMIMELDFLAGS)
endif
$(CMD_PREFIX) $(ASTTOPDIR)/build_tools/strip_nonapi $@ || rm $@

View File

@ -1,21 +1,21 @@
$FreeBSD$
--- main/db.c.orig Fri Jan 13 11:05:32 2006
+++ main/db.c Fri Jan 13 11:06:55 2006
@@ -35,6 +35,7 @@
#include <errno.h>
#include <unistd.h>
--- main/db.c
+++ main/db.c
@@ -36,6 +36,7 @@
#include <sys/time.h>
#include <signal.h>
#include <dirent.h>
+#include <db.h>
#include "asterisk.h"
@@ -51,7 +52,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revisi
#include "asterisk/channel.h"
#include "asterisk/file.h"
@@ -46,7 +47,6 @@
#include "asterisk/utils.h"
#include "asterisk/lock.h"
#include "asterisk/manager.h"
-#include "db1-ast/include/db.h"
#ifdef __CYGWIN__
#define dbopen __dbopen
static DB *astdb;
AST_MUTEX_DEFINE_STATIC(dblock);

View File

@ -1,11 +1,11 @@
$FreeBSD$
--- main/frame.c.orig Wed Jan 25 13:22:43 2006
+++ main/frame.c Wed Jan 25 13:21:25 2006
@@ -1170,7 +1170,7 @@ static int g723_len(unsigned char buf)
{
switch(buf & TYPE_MASK) {
--- main/frame.c
+++ main/frame.c
@@ -1260,7 +1260,7 @@
switch(type) {
case TYPE_DONTSEND:
- return 0;
+ return 2;

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- main/manager.c.orig
+++ main/manager.c
@@ -73,7 +73,7 @@
struct fast_originate_helper {
char tech[AST_MAX_EXTENSION];
- char data[AST_MAX_EXTENSION];
+ char data[AST_MAX_EXTENSION * 5];
int timeout;
char app[AST_MAX_APP];
char appdata[AST_MAX_EXTENSION];

View File

@ -1,9 +1,9 @@
$FreeBSD$
--- main/utils.c.orig
--- main/utils.c
+++ main/utils.c
@@ -914,8 +914,8 @@
@@ -936,8 +936,8 @@
pthread_attr_init(attr);
}

View File

@ -1,14 +0,0 @@
$FreeBSD$
--- res/res_agi.c
+++ res/res_agi.c
@@ -969,7 +969,7 @@
start = ast_tvnow();
while ((ms < 0) || ast_tvdiff_ms(ast_tvnow(), start) < ms) {
- res = ast_waitfor(chan, -1);
+ res = ast_waitfor(chan, ms - ast_tvdiff_ms(ast_tvnow(), start));
if (res < 0) {
ast_closestream(fs);
fdprintf(agi->fd, "200 result=%d (waitfor) endpos=%ld\n", res,sample_offset);

View File

@ -1,86 +0,0 @@
--- channels/chan_sip.c.orig 2008-03-12 17:37:00.000000000 +0200
+++ channels/chan_sip.c 2008-03-12 18:17:33.000000000 +0200
@@ -554,6 +554,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -4983,6 +4986,8 @@
int codec_index = 0;
int codec_pt_order[256];
+ int dtmf_present = 0;
+
if (!p->rtp) {
ast_log(LOG_ERROR, "Got SDP but have no RTP session allocated.\n");
return -1;
@@ -5408,12 +5413,20 @@
for (x = 0; x < codec_index; ++x) {
struct rtpPayloadType pt;
pt = ast_rtp_lookup_pt(p->rtp, codec_pt_order[x]);
+ if (pt.code == AST_RTP_DTMF)
+ dtmf_present = 1;
if (!pt.isAstFormat && !pt.code && p->vrtp)
pt = ast_rtp_lookup_pt(p->vrtp, codec_pt_order[x]);
if (pt.isAstFormat)
ast_codec_pref_append(&p->formats, pt.code);
}
ast_codec_pref_remove2(&p->formats, ~p->usercapability);
+ if (!dtmf_present && global_force_dtmf_relay) {
+ newnoncodeccapability |= AST_RTP_DTMF;
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ codec_pt_order[codec_index++] = global_force_dtmf_relay_pt;
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ }
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
@@ -16845,6 +16858,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -16901,6 +16917,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-04-25 08:53:52.000000000 -0700
+++ configs/sip.conf.sample 2008-06-10 00:45:37.000000000 -0700
@@ -53,6 +53,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View File

@ -1,70 +0,0 @@
--- channels/chan_sip.c.orig 2008-09-09 00:10:10.000000000 +0300
+++ channels/chan_sip.c 2008-12-12 17:02:05.000000000 +0200
@@ -557,6 +557,9 @@
static unsigned int global_tos_sip; /*!< IP type of service for SIP packets */
static unsigned int global_tos_audio; /*!< IP type of service for audio RTP packets */
static unsigned int global_tos_video; /*!< IP type of service for video RTP packets */
+static int global_force_dtmf_relay = 0;
+static int global_force_dtmf_relay_pt = 101;
+
static int compactheaders; /*!< send compact sip headers */
static int recordhistory; /*!< Record SIP history. Off by default */
static int dumphistory; /*!< Dump history to verbose before destroying SIP dialog */
@@ -5504,6 +5507,13 @@
/* Now gather all of the codecs that we are asked for: */
ast_rtp_get_current_formats(newaudiortp, &peercapability, &peernoncodeccapability);
+ /* Add telephone-event */
+ if (global_force_dtmf_relay && !(peernoncodeccapability & AST_RTP_DTMF)) {
+ ast_rtp_set_m_type(newaudiortp, global_force_dtmf_relay_pt);
+ found_rtpmap_codecs[last_rtpmap_codec++] = global_force_dtmf_relay_pt;
+ ast_rtp_set_rtpmap_type(newaudiortp, global_force_dtmf_relay_pt, "audio", "telephone-event", 0);
+ peernoncodeccapability |= AST_RTP_DTMF;
+ }
ast_rtp_get_current_formats(newvideortp, &vpeercapability, &vpeernoncodeccapability);
newjointcapability = p->capability & (peercapability | vpeercapability);
@@ -17440,6 +17450,9 @@
global_matchexterniplocally = FALSE;
+ global_force_dtmf_relay = 0;
+ global_force_dtmf_relay_pt = 101;
+
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
@@ -17496,6 +17509,18 @@
}
} else if (!strcasecmp(v->name, "vmexten")) {
ast_copy_string(default_vmexten, v->value, sizeof(default_vmexten));
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay")) {
+ if ((global_force_dtmf_relay = ast_true(v->value)))
+ ast_verbose("RTP DTMF relaying will be enforced\n");
+ else
+ ast_verbose("RTP DTMF relaying will not be enforced\n");
+ } else if (!strcasecmp(v->name, "rtp_force_dtmf_relay_pt")) {
+ sscanf(v->value, "%d", &global_force_dtmf_relay_pt);
+ if (global_force_dtmf_relay_pt < 96 || global_force_dtmf_relay_pt > 255) {
+ ast_verbose("RTP forced DTMF relay payload type is not valid: %d. Using default (101)\n", global_force_dtmf_relay_pt);
+ global_force_dtmf_relay_pt = 101;
+ } else
+ ast_log(LOG_WARNING, "RTP forced DTMF relay payload type is %d\n", global_force_dtmf_relay_pt);
} else if (!strcasecmp(v->name, "rtptimeout")) {
if ((sscanf(v->value, "%d", &global_rtptimeout) != 1) || (global_rtptimeout < 0)) {
ast_log(LOG_WARNING, "'%s' is not a valid RTP hold time at line %d. Using default.\n", v->value, v->lineno);
--- configs/sip.conf.sample.orig 2008-08-16 01:33:42.000000000 +0300
+++ configs/sip.conf.sample 2008-12-12 17:03:11.000000000 +0200
@@ -49,6 +49,12 @@
; and multiline formatted headers for strict
; SIP compatibility (defaults to "no")
+;rtp_force_dtmf_relay=no ; Enable RFC2833 DTMFs to be sent even if peer
+ ; hasn't announced support for it. Default: no
+
+;rtp_force_dtmf_relay_pt=101 ; RTP payload type value for enforced RFC2833
+ ; DTMFs. Default: 101
+
; See doc/ip-tos.txt for a description of these parameters.
;tos_sip=cs3 ; Sets TOS for SIP packets.
;tos_audio=ef ; Sets TOS for RTP audio packets.

View File

@ -1,12 +0,0 @@
--- channels/chan_sip.c.orig 2008-04-09 11:39:09.000000000 +0300
+++ channels/chan_sip.c 2008-04-09 11:40:28.000000000 +0300
@@ -2998,6 +2998,9 @@
p->t38.state = T38_LOCAL_DIRECT;
if (option_debug)
ast_log(LOG_DEBUG,"T38State change to %d on channel %s\n", p->t38.state, ast->name);
+ } else if (!strcasecmp(ast_var_name(current), "SIP_FORCE_CALLID")) {
+
+ ast_string_field_set(p, callid, ast_var_value(current));
}
}

View File

@ -1,45 +0,0 @@
--- channels/chan_sip.c.orig 2008-04-29 08:21:05.000000000 -0400
+++ channels/chan_sip.c 2008-05-28 18:41:48.000000000 -0400
@@ -15962,6 +15978,9 @@
char *ext, *host;
char tmp[256];
char *dest = data;
+ char *secret = NULL;
+ char *md5secret = NULL;
+ char *authname = NULL;
if (!(p = sip_alloc(NULL, NULL, 0, SIP_INVITE))) {
ast_log(LOG_ERROR, "Unable to build sip pvt data for '%s' (Out of memory or socket error)\n", (char *)data);
@@ -15983,6 +16002,17 @@
if (host) {
*host++ = '\0';
ext = tmp;
+ secret = strchr(ext, ':');
+ if (secret) {
+ *secret++ = '\0';
+ md5secret = strchr(secret, ':');
+ if (md5secret) {
+ *md5secret++ = '\0';
+ authname = strchr(md5secret, ':');
+ if (authname)
+ *authname++ = '\0';
+ }
+ }
} else {
ext = strchr(tmp, '/');
if (ext)
@@ -16015,6 +16045,14 @@
ast_string_field_set(p, username, ext);
ast_string_field_free(p, fullcontact);
}
+ if (secret && !ast_strlen_zero(secret))
+ ast_string_field_set(p, peersecret, secret);
+
+ if (md5secret && !ast_strlen_zero(md5secret))
+ ast_string_field_set(p, peermd5secret, md5secret);
+
+ if (authname && !ast_strlen_zero(authname))
+ ast_string_field_set(p, authname, authname);
#if 0
printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host);
#endif

File diff suppressed because it is too large Load Diff