[asterisk-commits] branch oej/videosupport r9014 - in
/team/oej/videosupport: ./ apps/ channels/...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jan 31 11:50:04 MST 2006
Author: oej
Date: Tue Jan 31 12:49:43 2006
New Revision: 9014
URL: http://svn.digium.com/view/asterisk?rev=9014&view=rev
Log:
Update to current trunk
Modified:
team/oej/videosupport/ (props changed)
team/oej/videosupport/.cleancount
team/oej/videosupport/apps/app_meetme.c
team/oej/videosupport/channel.c
team/oej/videosupport/channels/chan_agent.c
team/oej/videosupport/channels/chan_features.c
team/oej/videosupport/channels/chan_h323.c
team/oej/videosupport/channels/chan_iax2.c
team/oej/videosupport/channels/chan_local.c
team/oej/videosupport/channels/chan_mgcp.c
team/oej/videosupport/channels/chan_sip.c
team/oej/videosupport/channels/chan_zap.c
team/oej/videosupport/frame.c
team/oej/videosupport/include/asterisk/channel.h
team/oej/videosupport/include/asterisk/frame.h
team/oej/videosupport/rtp.c
team/oej/videosupport/udptl.c
Propchange: team/oej/videosupport/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan 31 12:49:43 2006
@@ -1,1 +1,1 @@
-/trunk:1-8932
+/trunk:1-9012
Modified: team/oej/videosupport/.cleancount
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/.cleancount?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/.cleancount (original)
+++ team/oej/videosupport/.cleancount Tue Jan 31 12:49:43 2006
@@ -1,1 +1,1 @@
-8
+9
Modified: team/oej/videosupport/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/apps/app_meetme.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/apps/app_meetme.c (original)
+++ team/oej/videosupport/apps/app_meetme.c Tue Jan 31 12:49:43 2006
@@ -206,7 +206,6 @@
};
static int admin_exec(struct ast_channel *chan, void *data);
-static struct ast_frame null_frame = { AST_FRAME_NULL, };
static void *recordthread(void *args);
@@ -426,8 +425,6 @@
unsigned char *data;
int len;
int res = -1;
- short *data2;
- int x;
if (!chan->_softhangup)
res = ast_autoservice_start(chan);
@@ -448,10 +445,7 @@
len = 0;
}
if (data) {
- data2 = alloca(len * 2);
- for (x=0;x<len;x++)
- data2[x] = AST_MULAW(data[x]);
- careful_write(conf->fd, (unsigned char *)data2, len << 1, 1);
+ careful_write(conf->fd, data, len, 1);
}
AST_LIST_UNLOCK(&confs);
@@ -1579,7 +1573,7 @@
if (conf->transpath[index]) {
conf->transframe[index] = ast_translate(conf->transpath[index], conf->origframe, 0);
if (!conf->transframe[index])
- conf->transframe[index] = &null_frame;
+ conf->transframe[index] = &ast_null_frame;
}
}
}
Modified: team/oej/videosupport/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channel.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channel.c (original)
+++ team/oej/videosupport/channel.c Tue Jan 31 12:49:43 2006
@@ -1760,17 +1760,13 @@
void *data;
int res;
#endif
- static struct ast_frame null_frame = {
- AST_FRAME_NULL,
- };
-
ast_mutex_lock(&chan->lock);
if (chan->masq) {
if (ast_do_masquerade(chan)) {
ast_log(LOG_WARNING, "Failed to perform masquerade\n");
f = NULL;
} else
- f = &null_frame;
+ f = &ast_null_frame;
ast_mutex_unlock(&chan->lock);
return f;
}
@@ -1838,8 +1834,7 @@
chan->timingdata = NULL;
ast_mutex_unlock(&chan->lock);
}
- f = &null_frame;
- return f;
+ return &ast_null_frame;
} else
ast_log(LOG_NOTICE, "No/unknown event '%d' on timer for '%s'?\n", blah, chan->name);
} else
@@ -1851,8 +1846,7 @@
chan->generatordata = NULL; /* reset to let ast_write get through */
chan->generator->generate(chan, tmp, -1, -1);
chan->generatordata = tmp;
- f = &null_frame;
- return f;
+ return &ast_null_frame;
}
/* Check for pending read queue */
@@ -1872,7 +1866,7 @@
f = chan->tech->exception(chan);
else {
ast_log(LOG_WARNING, "Exception flag set on '%s', but no exception handler\n", chan->name);
- f = &null_frame;
+ f = &ast_null_frame;
}
/* Clear the exception flag */
ast_clear_flag(chan, AST_FLAG_EXCEPTION);
@@ -1898,7 +1892,7 @@
if (f->subclass == AST_CONTROL_ANSWER) {
if (prestate == AST_STATE_UP) {
ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");
- f = &null_frame;
+ f = &ast_null_frame;
}
/* Answer the CDR */
ast_setstate(chan, AST_STATE_UP);
@@ -1912,7 +1906,7 @@
chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
else
ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
- f = &null_frame;
+ f = &ast_null_frame;
}
break;
case AST_FRAME_DTMF_BEGIN:
@@ -1924,14 +1918,14 @@
case AST_FRAME_VOICE:
if (dropaudio) {
ast_frfree(f);
- f = &null_frame;
+ f = &ast_null_frame;
} else if (!(f->subclass & chan->nativeformats)) {
/* This frame can't be from the current native formats -- drop it on the
floor */
ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n",
chan->name, ast_getformatname(f->subclass), ast_getformatname(chan->nativeformats));
ast_frfree(f);
- f = &null_frame;
+ f = &ast_null_frame;
} else {
if (chan->spies)
queue_frame_to_spies(chan, f, SPY_READ);
@@ -1962,7 +1956,7 @@
if (chan->readtrans) {
if (!(f = ast_translate(chan->readtrans, f, 1)))
- f = &null_frame;
+ f = &ast_null_frame;
}
/* Run any generator sitting on the channel */
@@ -3121,10 +3115,9 @@
);
ast_channel_free(clone);
} else {
- struct ast_frame null_frame = { AST_FRAME_NULL, };
ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name);
ast_set_flag(clone, AST_FLAG_ZOMBIE);
- ast_queue_frame(clone, &null_frame);
+ ast_queue_frame(clone, &ast_null_frame);
ast_mutex_unlock(&clone->lock);
}
Modified: team/oej/videosupport/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_agent.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_agent.c (original)
+++ team/oej/videosupport/channels/chan_agent.c Tue Jan 31 12:49:43 2006
@@ -438,7 +438,6 @@
{
struct agent_pvt *p = ast->tech_pvt;
struct ast_frame *f = NULL;
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
static struct ast_frame answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
const char *status;
ast_mutex_lock(&p->lock);
@@ -448,7 +447,7 @@
p->chan->fdno = (ast->fdno == AST_AGENT_FD) ? AST_TIMING_FD : ast->fdno;
f = ast_read(p->chan);
} else
- f = &null_frame;
+ f = &ast_null_frame;
if (!f) {
/* If there's a channel, hang it up (if it's on a callback) make it NULL */
if (p->chan) {
@@ -486,7 +485,7 @@
ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
/* Don't pass answer along */
ast_frfree(f);
- f = &null_frame;
+ f = &ast_null_frame;
} else {
p->acknowledged = 1;
/* Use the builtin answer frame for the
@@ -513,7 +512,7 @@
/* don't pass voice until the call is acknowledged */
if (!p->acknowledged) {
ast_frfree(f);
- f = &null_frame;
+ f = &ast_null_frame;
}
break;
}
@@ -899,7 +898,6 @@
static struct ast_channel *agent_new(struct agent_pvt *p, int state)
{
struct ast_channel *tmp;
- struct ast_frame null_frame = { AST_FRAME_NULL };
#if 0
if (!p->chan) {
ast_log(LOG_WARNING, "No channel? :(\n");
@@ -950,7 +948,7 @@
if( ast_mutex_trylock(&p->app_lock) )
{
if (p->chan) {
- ast_queue_frame(p->chan, &null_frame);
+ ast_queue_frame(p->chan, &ast_null_frame);
ast_mutex_unlock(&p->lock); /* For other thread to read the condition. */
ast_mutex_lock(&p->app_lock);
ast_mutex_lock(&p->lock);
Modified: team/oej/videosupport/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_features.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_features.c (original)
+++ team/oej/videosupport/channels/chan_features.c Tue Jan 31 12:49:43 2006
@@ -241,12 +241,11 @@
static struct ast_frame *features_read(struct ast_channel *ast)
{
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
struct feature_pvt *p = ast->tech_pvt;
struct ast_frame *f;
int x;
- f = &null_frame;
+ f = &ast_null_frame;
ast_mutex_lock(&p->lock);
x = indexof(p, ast, 0);
if (!x && p->subchan) {
Modified: team/oej/videosupport/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_h323.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_h323.c (original)
+++ team/oej/videosupport/channels/chan_h323.c Tue Jan 31 12:49:43 2006
@@ -543,7 +543,6 @@
{
/* Retrieve audio/etc from channel. Assumes pvt->lock is already held. */
struct ast_frame *f;
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
/* Only apply it for the first packet, we just need the correct ip/port */
if (pvt->options.nat) {
@@ -554,7 +553,7 @@
f = ast_rtp_read(pvt->rtp);
/* Don't send RFC2833 if we're not supposed to */
if (f && (f->frametype == AST_FRAME_DTMF) && !(pvt->options.dtmfmode & H323_DTMF_RFC2833)) {
- return &null_frame;
+ return &ast_null_frame;
}
if (pvt->owner) {
/* We already hold the channel lock */
@@ -563,7 +562,7 @@
/* Try to avoid deadlock */
if (ast_mutex_trylock(&pvt->owner->lock)) {
ast_log(LOG_NOTICE, "Format changed but channel is locked. Ignoring frame...\n");
- return &null_frame;
+ return &ast_null_frame;
}
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
pvt->owner->nativeformats = f->subclass;
Modified: team/oej/videosupport/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_iax2.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_iax2.c (original)
+++ team/oej/videosupport/channels/chan_iax2.c Tue Jan 31 12:49:43 2006
@@ -3103,9 +3103,8 @@
static struct ast_frame *iax2_read(struct ast_channel *c)
{
- static struct ast_frame f = { AST_FRAME_NULL, };
ast_log(LOG_NOTICE, "I should never be called!\n");
- return &f;
+ return &ast_null_frame;
}
static int iax2_start_transfer(unsigned short callno0, unsigned short callno1)
Modified: team/oej/videosupport/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_local.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_local.c (original)
+++ team/oej/videosupport/channels/chan_local.c Tue Jan 31 12:49:43 2006
@@ -224,9 +224,7 @@
static struct ast_frame *local_read(struct ast_channel *ast)
{
- static struct ast_frame null = { AST_FRAME_NULL, };
-
- return &null;
+ return &ast_null_frame;
}
static int local_write(struct ast_channel *ast, struct ast_frame *f)
Modified: team/oej/videosupport/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_mgcp.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_mgcp.c (original)
+++ team/oej/videosupport/channels/chan_mgcp.c Tue Jan 31 12:49:43 2006
@@ -1219,12 +1219,11 @@
{
/* Retrieve audio/etc from channel. Assumes sub->lock is already held. */
struct ast_frame *f;
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
f = ast_rtp_read(sub->rtp);
/* Don't send RFC2833 if we're not supposed to */
if (f && (f->frametype == AST_FRAME_DTMF) && !(sub->parent->dtmfmode & MGCP_DTMF_RFC2833))
- return &null_frame;
+ return &ast_null_frame;
if (sub->owner) {
/* We already hold the channel lock */
if (f->frametype == AST_FRAME_VOICE) {
Modified: team/oej/videosupport/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_sip.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_sip.c (original)
+++ team/oej/videosupport/channels/chan_sip.c Tue Jan 31 12:49:43 2006
@@ -34,6 +34,7 @@
* \todo Better support of forking
*
* \ingroup channel_drivers
+ *
*/
@@ -381,6 +382,7 @@
static char default_vmexten[AST_MAX_EXTENSION];
static char default_musicclass[MAX_MUSICCLASS]; /*!< Global music on hold class */
static int default_maxcallbitrate; /*!< Maximum bitrate for call */
+static struct ast_codec_pref default_prefs; /*!< Default codec prefs */
/* Global settings only apply to the channel */
static int global_rtautoclear = 120;
@@ -444,13 +446,12 @@
static int sip_reloading = FALSE; /*!< Flag for avoiding multiple reloads at the same time */
static enum channelreloadreason sip_reloadreason; /*!< Reason for last reload/load of configuration */
-static struct sched_context *sched;
-static struct io_context *io;
+static struct sched_context *sched; /*!< The scheduling context */
+static struct io_context *io; /*!< The IO context */
#define DEC_CALL_LIMIT 0
#define INC_CALL_LIMIT 1
-static struct ast_codec_pref prefs;
/*! \brief sip_request: The data grabbed from the UDP socket */
struct sip_request {
@@ -488,11 +489,13 @@
enum sip_auth_type auth_type; /*!< Authentication type */
};
+/*! \brief Structure to save routing information for a SIP session */
struct sip_route {
struct sip_route *next;
char hop[0];
};
+/*! \brief Modes for SIP domain handling in the PBX */
enum domain_mode {
SIP_DOMAIN_AUTO, /*!< This domain is auto-configured */
SIP_DOMAIN_CONFIG, /*!< This domain is from configuration */
@@ -525,7 +528,9 @@
struct sip_auth *next; /*!< Next auth structure in list */
};
-/*--- Various flags for the flags field in the pvt structure */
+/*--- Various flags for the flags field in the pvt structure
+ Peer only flags should be set in PAGE2 below
+*/
#define SIP_ALREADYGONE (1 << 0) /*!< Whether or not we've already been destroyed by our peer */
#define SIP_NEEDDESTROY (1 << 1) /*!< if we need to be destroyed */
#define SIP_NOVIDEO (1 << 2) /*!< Didn't get video in invite, don't offer */
@@ -540,14 +545,13 @@
#define SIP_REALTIME (1 << 11) /*!< Flag for realtime users */
#define SIP_USECLIENTCODE (1 << 12) /*!< Trust X-ClientCode info message */
#define SIP_OUTGOING (1 << 13) /*!< Is this an outgoing call? */
-#define SIP_SELFDESTRUCT (1 << 14)
-#define SIP_DYNAMIC (1 << 15) /*!< Is this a dynamic peer? */
-/* --- Choices for DTMF support in SIP channel */
-#define SIP_DTMF (3 << 16) /*!< three settings, uses two bits */
-#define SIP_DTMF_RFC2833 (0 << 16) /*!< RTP DTMF */
-#define SIP_DTMF_INBAND (1 << 16) /*!< Inband audio, only for ULAW/ALAW */
-#define SIP_DTMF_INFO (2 << 16) /*!< SIP Info messages */
-#define SIP_DTMF_AUTO (3 << 16) /*!< AUTO switch between rfc2833 and in-band DTMF */
+#define SIP_FREEBIT (1 << 14) /*!< Free for session-related use */
+#define SIP_FREEBIT3 (1 << 15) /*!< Free for session-related use */
+#define SIP_DTMF (3 << 16) /*!< DTMF Support: four settings, uses two bits */
+#define SIP_DTMF_RFC2833 (0 << 16) /*!< DTMF Support: RTP DTMF - "rfc2833" */
+#define SIP_DTMF_INBAND (1 << 16) /*!< DTMF Support: Inband audio, only for ULAW/ALAW - "inband" */
+#define SIP_DTMF_INFO (2 << 16) /*!< DTMF Support: SIP Info messages - "info" */
+#define SIP_DTMF_AUTO (3 << 16) /*!< DTMF Support: AUTO switch between rfc2833 and in-band DTMF */
/* NAT settings */
#define SIP_NAT (3 << 18) /*!< four settings, uses two bits */
#define SIP_NAT_NEVER (0 << 18) /*!< No nat support */
@@ -585,7 +589,7 @@
SIP_PROG_INBAND | SIP_OSPAUTH | SIP_USECLIENTCODE | SIP_NAT | \
SIP_INSECURE_PORT | SIP_INSECURE_INVITE)
-/* a new page of flags for peer */
+/* a new page of flags for peers */
#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0)
#define SIP_PAGE2_RTUPDATE (1 << 1)
#define SIP_PAGE2_RTAUTOCLEAR (1 << 2)
@@ -594,7 +598,9 @@
#define SIP_PAGE2_DEBUG (3 << 5)
#define SIP_PAGE2_DEBUG_CONFIG (1 << 5)
#define SIP_PAGE2_DEBUG_CONSOLE (1 << 6)
-#define SIP_PAGE2_VIDEOSUPPORT (1 << 7)
+#define SIP_PAGE2_DYNAMIC (1 << 7) /*!< Dynamic Peers register with Asterisk */
+#define SIP_PAGE2_SELFDESTRUCT (1 << 8) /*!< Automatic peers need to destruct themselves */
+#define SIP_PAGE2_VIDEOSUPPORT (1 << 9)
#define SIP_PAGE2_FLAGS_TO_COPY \
(SIP_PAGE2_VIDEOSUPPORT)
@@ -1322,7 +1328,9 @@
return 0;
}
-/*! \brief Transmit packet with retransmits */
+/*! \brief Transmit packet with retransmits
+ \return 0 on success, -1 on failure to allocate packet
+*/
static int __sip_reliable_xmit(struct sip_pvt *p, int seqno, int resp, char *data, int len, int fatal, int sipmethod)
{
struct sip_pkt *pkt;
@@ -1689,7 +1697,7 @@
ast_sched_del(sched, peer->pokeexpire);
register_peer_exten(peer, 0);
ast_free_ha(peer->ha);
- if (ast_test_flag(peer, SIP_SELFDESTRUCT))
+ if (ast_test_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT))
apeerobjs--;
else if (ast_test_flag(peer, SIP_REALTIME))
rpeerobjs--;
@@ -3059,11 +3067,10 @@
{
/* Retrieve audio/etc from channel. Assumes p->lock is already held. */
struct ast_frame *f;
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
if (!p->rtp) {
/* We have no RTP allocated for this channel */
- return &null_frame;
+ return &ast_null_frame;
}
switch(ast->fdno) {
@@ -3080,11 +3087,11 @@
f = ast_rtcp_read(p->vrtp); /* RTCP Control Channel for video */
break;
default:
- f = &null_frame;
+ f = &ast_null_frame;
}
/* Don't forward RFC2833 if we're not supposed to */
if (f && (f->frametype == AST_FRAME_DTMF) && (ast_test_flag(p, SIP_DTMF) != SIP_DTMF_RFC2833))
- return &null_frame;
+ return &ast_null_frame;
if (p->owner) {
/* We already hold the channel lock */
@@ -3183,7 +3190,8 @@
p->autokillid = -1;
p->subscribed = NONE;
p->stateid = -1;
- p->prefs = prefs;
+ p->prefs = default_prefs; /* Set default codecs for this call */
+
if (intended_method != SIP_OPTIONS) /* Peerpoke has it's own system */
p->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */
#ifdef OSP_SUPPORT
@@ -3769,12 +3777,11 @@
if ((bridgepeer=ast_bridged_channel(p->owner))) {
/* We have a bridge */
/* Turn on/off music on hold if we are holding/unholding */
- struct ast_frame af = { AST_FRAME_NULL, };
if (sin.sin_addr.s_addr && !sendonly) {
ast_moh_stop(bridgepeer);
/* Activate a re-invite */
- ast_queue_frame(p->owner, &af);
+ ast_queue_frame(p->owner, &ast_null_frame);
} else {
/* No address for RTP, we're on hold */
@@ -3782,7 +3789,7 @@
if (sendonly)
ast_rtp_stop(p->rtp);
/* Activate a re-invite */
- ast_queue_frame(p->owner, &af);
+ ast_queue_frame(p->owner, &ast_null_frame);
}
}
@@ -5781,7 +5788,7 @@
register_peer_exten(peer, 0);
peer->expire = -1;
ast_device_state_changed("SIP/%s", peer->name);
- if (ast_test_flag(peer, SIP_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
+ if (ast_test_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
ASTOBJ_UNREF(peer, sip_destroy_peer);
}
@@ -6513,7 +6520,7 @@
ASTOBJ_UNREF(peer, sip_destroy_peer);
}
if (peer) {
- if (!ast_test_flag(peer, SIP_DYNAMIC)) {
+ if (!ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC)) {
ast_log(LOG_ERROR, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name);
} else {
ast_copy_flags(p, peer, SIP_NAT);
@@ -7684,7 +7691,7 @@
snprintf(srch, sizeof(srch), FORMAT, name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
- ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
+ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */
iterator->ha ? " A " : " ", /* permit/deny */
ntohs(iterator->addr.sin_port), status);
@@ -7692,7 +7699,7 @@
if (!s) {/* Normal CLI list */
ast_cli(fd, FORMAT, name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
- ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
+ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : " ", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : " ", /* NAT=yes? */
iterator->ha ? " A " : " ", /* permit/deny */
@@ -7715,7 +7722,7 @@
iterator->name,
iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "-none-",
ntohs(iterator->addr.sin_port),
- ast_test_flag(iterator, SIP_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */
+ ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */
(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no", /* NAT=yes? */
ast_test_flag((&iterator->flags_page2), SIP_PAGE2_VIDEOSUPPORT) ? "yes" : "no", /* VIDEOSUPPORT=yes? */
iterator->ha ? "yes" : "no", /* permit/deny */
@@ -8089,7 +8096,7 @@
ast_cli(fd, " VM Extension : %s\n", peer->vmexten);
ast_cli(fd, " LastMsgsSent : %d\n", peer->lastmsgssent);
ast_cli(fd, " Call limit : %d\n", peer->call_limit);
- ast_cli(fd, " Dynamic : %s\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Yes":"No"));
+ ast_cli(fd, " Dynamic : %s\n", (ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC)?"Yes":"No"));
ast_cli(fd, " Callerid : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, "<unspecified>"));
ast_cli(fd, " MaxCallBR : %dkbps\n", peer->maxcallbitrate);
ast_cli(fd, " Expire : %d\n", peer->expire);
@@ -8168,7 +8175,7 @@
ast_cli(fd, "LastMsgsSent: %d\r\n", peer->lastmsgssent);
ast_cli(fd, "Call limit: %d\r\n", peer->call_limit);
ast_cli(fd, "MaxCallBR: %dkbps\r\n", peer->maxcallbitrate);
- ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Y":"N"));
+ ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC)?"Y":"N"));
ast_cli(fd, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
ast_cli(fd, "RegExpire: %ld seconds\r\n", ast_sched_when(sched,peer->expire));
ast_cli(fd, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(peer, SIP_INSECURE_PORT), ast_test_flag(peer, SIP_INSECURE_INVITE)));
@@ -8354,7 +8361,7 @@
ast_cli(fd, "\nGlobal Signalling Settings:\n");
ast_cli(fd, "---------------------------\n");
ast_cli(fd, " Codecs: ");
- print_codec_to_cli(fd, &prefs);
+ print_codec_to_cli(fd, &default_prefs);
ast_cli(fd, "\n");
ast_cli(fd, " T1 minimum: %d\n", global_t1min);
ast_cli(fd, " Relax DTMF: %s\n", global_relaxdtmf ? "Yes" : "No");
@@ -9409,7 +9416,7 @@
} else if (!strcasecmp(colname, "expire")) {
snprintf(buf, len, "%d", peer->expire);
} else if (!strcasecmp(colname, "dynamic")) {
- ast_copy_string(buf, (ast_test_flag(peer, SIP_DYNAMIC) ? "yes" : "no"), len);
+ ast_copy_string(buf, (ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) ? "yes" : "no"), len);
} else if (!strcasecmp(colname, "callerid_name")) {
ast_copy_string(buf, peer->cid_name, len);
} else if (!strcasecmp(colname, "callerid_num")) {
@@ -9652,8 +9659,7 @@
#endif
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
} else { /* RE-invite */
- struct ast_frame af = { AST_FRAME_NULL, };
- ast_queue_frame(p->owner, &af);
+ ast_queue_frame(p->owner, &ast_null_frame);
}
} else {
/* It's possible we're getting an ACK after we've tried to disconnect
@@ -10387,7 +10393,6 @@
int res = 1;
struct ast_channel *c=NULL;
int gotdest;
- struct ast_frame af = { AST_FRAME_NULL, };
char *supported;
char *required;
unsigned int required_profile = 0;
@@ -10479,7 +10484,7 @@
/* Queue NULL frame to prod ast_rtp_bridge if appropriate */
if (p->owner)
- ast_queue_frame(p->owner, &af);
+ ast_queue_frame(p->owner, &ast_null_frame);
/* Initialize the context if it hasn't been already */
if (ast_strlen_zero(p->context))
@@ -12017,7 +12022,7 @@
user->ha = NULL;
ast_copy_flags(user, &global_flags, SIP_FLAGS_TO_COPY);
user->capability = global_capability;
- user->prefs = prefs;
+ user->prefs = default_prefs;
/* set default context */
strcpy(user->context, default_context);
strcpy(user->language, default_language);
@@ -12122,9 +12127,9 @@
peer->rtptimeout = global_rtptimeout;
peer->rtpholdtimeout = global_rtpholdtimeout;
peer->rtpkeepalive = global_rtpkeepalive;
- ast_set_flag(peer, SIP_SELFDESTRUCT);
- ast_set_flag(peer, SIP_DYNAMIC);
- peer->prefs = prefs;
+ ast_set_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT);
+ ast_set_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC);
+ peer->prefs = default_prefs;
reg_source_db(peer);
return peer;
@@ -12201,7 +12206,7 @@
peer->pickupgroup = 0;
peer->rtpkeepalive = global_rtpkeepalive;
peer->maxms = default_qualify;
- peer->prefs = prefs;
+ peer->prefs = default_prefs;
oldha = peer->ha;
peer->ha = NULL;
peer->addr.sin_family = AF_INET;
@@ -12257,7 +12262,7 @@
ast_log(LOG_WARNING, "You can't have a dynamic outbound proxy, you big silly head at line %d.\n", v->lineno);
} else {
/* They'll register with us */
- ast_set_flag(peer, SIP_DYNAMIC);
+ ast_set_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC);
if (!found) {
/* Initialize stuff iff we're not found, otherwise
we keep going with what we had */
@@ -12274,7 +12279,7 @@
if (peer->expire > -1)
ast_sched_del(sched, peer->expire);
peer->expire = -1;
- ast_clear_flag(peer, SIP_DYNAMIC);
+ ast_clear_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC);
if (!obproxyfound || !strcasecmp(v->name, "outboundproxy")) {
if (ast_get_ip_or_srv(&peer->addr, v->value, "_sip._udp")) {
ASTOBJ_UNREF(peer, sip_destroy_peer);
@@ -12297,7 +12302,7 @@
} else if (!strcasecmp(v->name, "permit") || !strcasecmp(v->name, "deny")) {
peer->ha = ast_append_ha(v->name, v->value, peer->ha);
} else if (!strcasecmp(v->name, "port")) {
- if (!realtime && ast_test_flag(peer, SIP_DYNAMIC))
+ if (!realtime && ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC))
peer->defaddr.sin_port = htons(atoi(v->value));
else
peer->addr.sin_port = htons(atoi(v->value));
@@ -12383,7 +12388,7 @@
*/
v=v->next;
}
- if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag(peer, SIP_DYNAMIC) && realtime) {
+ if (!ast_test_flag((&global_flags_page2), SIP_PAGE2_IGNOREREGEXPIRE) && ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) && realtime) {
time_t nowtime;
time(&nowtime);
@@ -12395,7 +12400,7 @@
}
}
ast_copy_flags(peer, &peerflags, mask.flags);
- if (!found && ast_test_flag(peer, SIP_DYNAMIC) && !ast_test_flag(peer, SIP_REALTIME))
+ if (!found && ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) && !ast_test_flag(peer, SIP_REALTIME))
reg_source_db(peer);
ASTOBJ_UNMARK(peer);
ast_free_ha(oldha);
@@ -12439,7 +12444,7 @@
memset(&bindaddr, 0, sizeof(bindaddr));
memset(&localaddr, 0, sizeof(localaddr));
memset(&externip, 0, sizeof(externip));
- memset(&prefs, 0 , sizeof(prefs));
+ memset(&default_prefs, 0 , sizeof(default_prefs));
outboundproxyip.sin_port = htons(DEFAULT_SIP_PORT);
outboundproxyip.sin_family = AF_INET; /* Type of address: IPv4 */
ourport = DEFAULT_SIP_PORT;
@@ -12641,9 +12646,9 @@
externrefresh = 10;
}
} else if (!strcasecmp(v->name, "allow")) {
- ast_parse_allow_disallow(&prefs, &global_capability, v->value, 1);
+ ast_parse_allow_disallow(&default_prefs, &global_capability, v->value, 1);
} else if (!strcasecmp(v->name, "disallow")) {
- ast_parse_allow_disallow(&prefs, &global_capability, v->value, 0);
+ ast_parse_allow_disallow(&default_prefs, &global_capability, v->value, 0);
} else if (!strcasecmp(v->name, "allowexternaldomains")) {
allow_external_domains = ast_true(v->value);
} else if (!strcasecmp(v->name, "autodomain")) {
Modified: team/oej/videosupport/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_zap.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_zap.c (original)
+++ team/oej/videosupport/channels/chan_zap.c Tue Jan 31 12:49:43 2006
@@ -711,7 +711,7 @@
static const struct ast_channel_tech zap_tech = {
.type = type,
.description = tdesc,
- .capabilities = AST_FORMAT_SLINEAR | AST_FORMAT_ULAW,
+ .capabilities = AST_FORMAT_SLINEAR | AST_FORMAT_ULAW | AST_FORMAT_ALAW,
.requester = zt_request,
.send_digit = zt_digit,
.send_text = zt_sendtext,
@@ -808,7 +808,6 @@
static void wakeup_sub(struct zt_pvt *p, int a, void *pri)
#endif
{
- struct ast_frame null = { AST_FRAME_NULL, };
#ifdef ZAPATA_PRI
if (pri)
ast_mutex_unlock(&pri->lock);
@@ -820,7 +819,7 @@
usleep(1);
ast_mutex_lock(&p->lock);
} else {
- ast_queue_frame(p->subs[a].owner, &null);
+ ast_queue_frame(p->subs[a].owner, &ast_null_frame);
ast_mutex_unlock(&p->subs[a].owner->lock);
break;
}
Modified: team/oej/videosupport/frame.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/frame.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/frame.c (original)
+++ team/oej/videosupport/frame.c Tue Jan 31 12:49:43 2006
@@ -56,13 +56,6 @@
#define TYPE_DONTSEND 0x3
#define TYPE_MASK 0x3
-struct ast_format_list {
- int visible; /*!< Can we see this entry */
- int bits; /*!< bitmask value */
- char *name; /*!< short name */
- char *desc; /*!< Description */
-};
-
struct ast_smoother {
int size;
int format;
@@ -79,7 +72,12 @@
};
/*! \brief Definition of supported media formats (codecs) */
-static struct ast_format_list AST_FORMAT_LIST[] = {
+static struct ast_format_list {
+ int visible; /*!< Can we see this entry */
+ int bits; /*!< bitmask value */
+ char *name; /*!< short name */
+ char *desc; /*!< Description */
+} AST_FORMAT_LIST[] = {
{ 1, AST_FORMAT_G723_1 , "g723" , "G.723.1"}, /*!< codec_g723_1.c */
{ 1, AST_FORMAT_GSM, "gsm" , "GSM"}, /*!< codec_gsm.c */
{ 1, AST_FORMAT_ULAW, "ulaw", "G.711 u-law" }, /*!< codec_ulaw.c */
@@ -107,6 +105,8 @@
{ 0, 0, "nothing", "undefined" },
{ 0, AST_FORMAT_MAX_VIDEO, "maxvideo", "Maximum video format" },
};
+
+struct ast_frame ast_null_frame = { AST_FRAME_NULL, };
void ast_smoother_reset(struct ast_smoother *s, int size)
{
Modified: team/oej/videosupport/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/include/asterisk/channel.h?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/include/asterisk/channel.h (original)
+++ team/oej/videosupport/include/asterisk/channel.h Tue Jan 31 12:49:43 2006
@@ -261,6 +261,9 @@
/*! Main Channel structure associated with a channel.
* This is the side of it mostly used by the pbx and call management.
+ *
+ * \note XXX It is important to remember to increment .cleancount each time
+ * this structure is changed. XXX
*/
struct ast_channel {
/*! ASCII unique channel name */
Modified: team/oej/videosupport/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/include/asterisk/frame.h?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/include/asterisk/frame.h (original)
+++ team/oej/videosupport/include/asterisk/frame.h Tue Jan 31 12:49:43 2006
@@ -110,6 +110,10 @@
/*! Next/Prev for linking stand alone frames */
struct ast_frame *next;
};
+
+/*! Queueing a null frame is fairly common, so we declare a global null frame object
+ for this purpose instead of having to declare one on the stack */
+extern struct ast_frame ast_null_frame;
#define AST_FRIENDLY_OFFSET 64 /*! It's polite for a a new frame to
have this number of bytes for additional
Modified: team/oej/videosupport/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/rtp.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/rtp.c (original)
+++ team/oej/videosupport/rtp.c Tue Jan 31 12:49:43 2006
@@ -174,7 +174,6 @@
static struct ast_frame *send_dtmf(struct ast_rtp *rtp)
{
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
char iabuf[INET_ADDRSTRLEN];
if (ast_tvcmp(ast_tvnow(), rtp->dtmfmute) < 0) {
@@ -182,7 +181,7 @@
ast_log(LOG_DEBUG, "Ignore potential DTMF echo from '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr));
rtp->resp = 0;
rtp->dtmfduration = 0;
- return &null_frame;
+ return &ast_null_frame;
}
if (option_debug)
ast_log(LOG_DEBUG, "Sending dtmf: %d (%c), at %s\n", rtp->resp, rtp->resp, ast_inet_ntoa(iabuf, sizeof(iabuf), rtp->them.sin_addr));
@@ -364,7 +363,6 @@
struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp)
{
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
socklen_t len;
int hdrlen = 8;
int res;
@@ -373,7 +371,7 @@
char iabuf[INET_ADDRSTRLEN];
if (!rtp || !rtp->rtcp)
- return &null_frame;
+ return &ast_null_frame;
len = sizeof(sin);
@@ -385,12 +383,12 @@
ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
if (errno == EBADF)
CRASH;
- return &null_frame;
+ return &ast_null_frame;
}
if (res < hdrlen) {
ast_log(LOG_WARNING, "RTP Read too short\n");
- return &null_frame;
+ return &ast_null_frame;
}
if (rtp->nat) {
@@ -404,7 +402,7 @@
}
if (option_debug)
ast_log(LOG_DEBUG, "Got RTCP report of %d bytes\n", res);
- return &null_frame;
+ return &ast_null_frame;
}
static void calc_rxstamp(struct timeval *tv, struct ast_rtp *rtp, unsigned int timestamp, int mark)
@@ -434,7 +432,7 @@
char iabuf[INET_ADDRSTRLEN];
unsigned int timestamp;
unsigned int *rtpheader;
- static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
+ static struct ast_frame *f;
struct rtpPayloadType rtpPT;
len = sizeof(sin);
@@ -450,17 +448,17 @@
ast_log(LOG_WARNING, "RTP Read error: %s\n", strerror(errno));
if (errno == EBADF)
CRASH;
- return &null_frame;
+ return &ast_null_frame;
}
if (res < hdrlen) {
ast_log(LOG_WARNING, "RTP Read too short\n");
- return &null_frame;
+ return &ast_null_frame;
}
/* Ignore if the other side hasn't been given an address
yet. */
if (!rtp->them.sin_addr.s_addr || !rtp->them.sin_port)
- return &null_frame;
+ return &ast_null_frame;
if (rtp->nat) {
/* Send to whoever sent to us */
@@ -480,7 +478,7 @@
/* Check RTP version */
version = (seqno & 0xC0000000) >> 30;
if (version != 2)
- return &null_frame;
+ return &ast_null_frame;
payloadtype = (seqno & 0x7f0000) >> 16;
padding = seqno & (1 << 29);
@@ -502,7 +500,7 @@
if (res < hdrlen) {
ast_log(LOG_WARNING, "RTP Read too short (%d, expecting %d)\n", res, hdrlen);
- return &null_frame;
+ return &ast_null_frame;
}
if(rtp_debug_test_addr(&sin))
@@ -537,7 +535,7 @@
if (f)
return f;
else
- return &null_frame;
+ return &ast_null_frame;
} else if (rtpPT.code == AST_RTP_CISCO_DTMF) {
/* It's really special -- process it the Cisco way */
if (rtp->lasteventseqn <= seqno || rtp->resp == 0 || (rtp->lasteventseqn >= 65530 && seqno <= 6)) {
@@ -548,17 +546,17 @@
if (f)
return f;
else
- return &null_frame;
+ return &ast_null_frame;
} else if (rtpPT.code == AST_RTP_CN) {
/* Comfort Noise */
f = process_rfc3389(rtp, rtp->rawdata + AST_FRIENDLY_OFFSET + hdrlen, res - hdrlen);
if (f)
return f;
else
- return &null_frame;
+ return &ast_null_frame;
} else {
ast_log(LOG_NOTICE, "Unknown RTP codec %d received\n", payloadtype);
- return &null_frame;
+ return &ast_null_frame;
}
}
rtp->f.subclass = rtpPT.code;
Modified: team/oej/videosupport/udptl.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/udptl.c?rev=9014&r1=9013&r2=9014&view=diff
==============================================================================
--- team/oej/videosupport/udptl.c (original)
+++ team/oej/videosupport/udptl.c Tue Jan 31 12:49:43 2006
@@ -645,7 +645,6 @@
uint16_t seqno = 0;
char iabuf[INET_ADDRSTRLEN];
uint16_t *udptlheader;
- static struct ast_frame null_frame = { AST_FRAME_NULL, };
len = sizeof(sin);
@@ -662,12 +661,12 @@
ast_log(LOG_WARNING, "UDPTL read error: %s\n", strerror(errno));
if (errno == EBADF)
CRASH;
- return &null_frame;
+ return &ast_null_frame;
}
/* Ignore if the other side hasn't been given an address yet. */
if (!udptl->them.sin_addr.s_addr || !udptl->them.sin_port)
- return &null_frame;
+ return &ast_null_frame;
if (udptl->nat) {
/* Send to whoever sent to us */
More information about the asterisk-commits
mailing list