[asterisk-commits] oej: branch oej/pinedanish-copybridgeflags-1.8 r363313 - in /team/oej/pinedan...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 24 03:00:59 CDT 2012
Author: oej
Date: Tue Apr 24 03:00:53 2012
New Revision: 363313
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=363313
Log:
Resolve conflicts after merging to HEAD
Modified:
team/oej/pinedanish-copybridgeflags-1.8/ (props changed)
team/oej/pinedanish-copybridgeflags-1.8/apps/app_echo.c
team/oej/pinedanish-copybridgeflags-1.8/apps/app_queue.c
team/oej/pinedanish-copybridgeflags-1.8/channels/chan_sip.c
team/oej/pinedanish-copybridgeflags-1.8/channels/chan_skinny.c
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/audiohook.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/autoconfig.h.in
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/calendar.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/devicestate.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/indications.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/jabber.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/logger.h
team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/tcptls.h
team/oej/pinedanish-copybridgeflags-1.8/main/acl.c
team/oej/pinedanish-copybridgeflags-1.8/main/app.c
team/oej/pinedanish-copybridgeflags-1.8/main/ast_expr2f.c
team/oej/pinedanish-copybridgeflags-1.8/main/cdr.c
team/oej/pinedanish-copybridgeflags-1.8/main/channel.c
team/oej/pinedanish-copybridgeflags-1.8/main/config.c
team/oej/pinedanish-copybridgeflags-1.8/main/db.c
team/oej/pinedanish-copybridgeflags-1.8/main/features.c
team/oej/pinedanish-copybridgeflags-1.8/main/http.c
team/oej/pinedanish-copybridgeflags-1.8/main/jitterbuf.c
team/oej/pinedanish-copybridgeflags-1.8/main/loader.c
team/oej/pinedanish-copybridgeflags-1.8/main/manager.c
team/oej/pinedanish-copybridgeflags-1.8/main/md5.c
team/oej/pinedanish-copybridgeflags-1.8/main/stdtime/localtime.c
team/oej/pinedanish-copybridgeflags-1.8/main/tdd.c
team/oej/pinedanish-copybridgeflags-1.8/main/translate.c
team/oej/pinedanish-copybridgeflags-1.8/main/utils.c
Propchange: team/oej/pinedanish-copybridgeflags-1.8/
------------------------------------------------------------------------------
automerge = Is-there-life-off-net?
Propchange: team/oej/pinedanish-copybridgeflags-1.8/
('svnmerge-integrated' removed)
Modified: team/oej/pinedanish-copybridgeflags-1.8/apps/app_echo.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/apps/app_echo.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/apps/app_echo.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/apps/app_echo.c Tue Apr 24 03:00:53 2012
@@ -47,8 +47,6 @@
<para>Echos back any media or DTMF frames read from the calling
channel back to itself. This will not echo CONTROL, MODEM, or NULL
frames. Note: If '#' detected application exits.</para>
- <para>This application does not automatically answer and should be
- preceeded by an application such as Answer() or Progress().</para>
<para>This application does not automatically answer and should be
preceeded by an application such as Answer() or Progress().</para>
</description>
Modified: team/oej/pinedanish-copybridgeflags-1.8/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/apps/app_queue.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/apps/app_queue.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/apps/app_queue.c Tue Apr 24 03:00:53 2012
@@ -4977,6 +4977,7 @@
qe->handled++;
ast_queue_log(queuename, qe->chan->uniqueid, member->membername, "CONNECT", "%ld|%s|%ld", (long) time(NULL) - qe->start, peer->uniqueid,
(long)(orig - to > 0 ? (orig - to) / 1000 : 0));
+
if (qe->chan->cdr) {
struct ast_cdr *cdr;
struct ast_cdr *newcdr;
Modified: team/oej/pinedanish-copybridgeflags-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/channels/chan_sip.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/channels/chan_sip.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/channels/chan_sip.c Tue Apr 24 03:00:53 2012
@@ -22167,6 +22167,10 @@
transmit_response(p, "501 Method Not Implemented", req);
return 0;
}
+ if (!p->owner) {
+ transmit_response(p, "481 Call/Transaction Does Not Exist", req);
+ return 0;
+ }
if (get_rpid(p, req)) {
struct ast_party_connected_line connected;
struct ast_set_party_connected_line update_connected;
@@ -25710,8 +25714,8 @@
/* the following will decrement the refcount on p as it finishes */
transmit_notify_with_mwi(p, newmsgs, oldmsgs, vmexten);
sip_pvt_unlock(p);
- sip_pvt_unlock(p);
dialog_unref(p, "unref dialog ptr p just before it goes out of scope at the end of sip_send_mwi_to_peer.");
+
return 0;
}
@@ -28013,6 +28017,7 @@
}
ast_mutex_unlock(&authl_lock);
+
cleanup_all_regs();
/* Then, actually destroy users and registry */
ASTOBJ_CONTAINER_DESTROYALL(®l, sip_registry_destroy);
Modified: team/oej/pinedanish-copybridgeflags-1.8/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/channels/chan_skinny.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/channels/chan_skinny.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/channels/chan_skinny.c Tue Apr 24 03:00:53 2012
@@ -6141,7 +6141,8 @@
struct skinny_speeddial *sd;
struct skinny_line *l;
struct skinny_device *d = s->device;
-
+ size_t len;
+
if ((!s->device) && (letohl(req->e) != REGISTER_MESSAGE && letohl(req->e) != ALARM_MESSAGE)) {
ast_log(LOG_WARNING, "Client sent message #%d without first registering.\n", req->e);
ast_free(req);
@@ -6206,8 +6207,13 @@
ast_log(LOG_WARNING, "Unsupported digit %d\n", digit);
}
- d->exten[strlen(d->exten)] = dgt;
- d->exten[strlen(d->exten)+1] = '\0';
+ len = strlen(d->exten);
+ if (len < sizeof(d->exten) - 1) {
+ d->exten[len] = dgt;
+ d->exten[len + 1] = '\0';
+ } else {
+ ast_log(AST_LOG_WARNING, "Dropping digit with value %d because digit queue is full\n", dgt);
+ }
} else
res = handle_keypad_button_message(req, s);
}
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/audiohook.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/audiohook.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/audiohook.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/audiohook.h Tue Apr 24 03:00:53 2012
@@ -52,10 +52,15 @@
AST_AUDIOHOOK_DIRECTION_BOTH, /*!< Both reading audio in and writing audio out */
};
+/*
+ * The flags here have been shifted around due to an unintended overlap between
+ * AST_AUDIOHOOK_TRIGGER_WRITE and AST_AUDIOHOOK_WANTS_DTMF. In future Asterisk
+ * releases (Asterisk 11+), these have been reorganized to make more sense.
+ */
enum ast_audiohook_flags {
- AST_AUDIOHOOK_TRIGGER_MODE = (3 << 0), /*!< When audiohook should be triggered to do something */
+ AST_AUDIOHOOK_TRIGGER_MODE = ((1 << 6) | (1 << 0)), /*!< When audiohook should be triggered to do something */
AST_AUDIOHOOK_TRIGGER_READ = (1 << 0), /*!< Audiohook wants to be triggered when reading audio in */
- AST_AUDIOHOOK_TRIGGER_WRITE = (2 << 0), /*!< Audiohook wants to be triggered when writing audio out */
+ AST_AUDIOHOOK_TRIGGER_WRITE = (1 << 6), /*!< Audiohook wants to be triggered when writing audio out */
AST_AUDIOHOOK_WANTS_DTMF = (1 << 1), /*!< Audiohook also wants to receive DTMF frames */
AST_AUDIOHOOK_TRIGGER_SYNC = (1 << 2), /*!< Audiohook wants to be triggered when both sides have combined audio available */
/*! Audiohooks with this flag set will not allow for a large amount of samples to build up on its
@@ -64,6 +69,8 @@
AST_AUDIOHOOK_SMALL_QUEUE = (1 << 3),
AST_AUDIOHOOK_MUTE_READ = (1 << 4), /*!< audiohook should be mute frames read */
AST_AUDIOHOOK_MUTE_WRITE = (1 << 5), /*!< audiohook should be mute frames written */
+
+ /* IMPORTANT: When adding new flags, start with (1 << 7) */
};
#define AST_AUDIOHOOK_SYNC_TOLERANCE 100 /*< Tolerance in milliseconds for audiohooks synchronization */
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/autoconfig.h.in?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/autoconfig.h.in (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/autoconfig.h.in Tue Apr 24 03:00:53 2012
@@ -828,7 +828,10 @@
/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
+#undef HAVE_STRUCT_SOCKPEERCRED_UID
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
/* Define to 1 if `cr_uid' is member of `struct ucred'. */
@@ -975,9 +978,6 @@
/* Define to 1 if you have the `unsetenv' function. */
#undef HAVE_UNSETENV
-/* Define to 1 if you have the usb library. */
-#undef HAVE_USB
-
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME
@@ -1005,6 +1005,9 @@
/* Define to 1 if you have the Vorbis library. */
#undef HAVE_VORBIS
+
+/* Define if your system has OV_CALLBACKS_NOCLOSE declared. */
+#undef HAVE_VORBIS_OPEN_CALLBACKS
/* Define if your system has the VoiceTronix API libraries. */
#undef HAVE_VPB
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/calendar.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/calendar.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/calendar.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/calendar.h Tue Apr 24 03:00:53 2012
@@ -25,6 +25,7 @@
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
#include "asterisk/dial.h"
+#include "asterisk/module.h"
/*! \file calendar.h
* \brief A general API for managing calendar events with Asterisk
@@ -69,6 +70,7 @@
const char *type;
const char *description;
const char *module;
+ struct ast_module_user *user;
int (* is_busy)(struct ast_calendar *calendar); /*!< Override default busy determination */
void *(* load_calendar)(void *data); /*!< Create private structure, add calendar events, etc. */
void *(* unref_calendar)(void *obj); /*!< Function to be called to free the private structure */
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/devicestate.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/devicestate.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/devicestate.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/devicestate.h Tue Apr 24 03:00:53 2012
@@ -254,14 +254,9 @@
* This struct is only here so that it can be easily declared on the stack.
*/
struct ast_devstate_aggregate {
- unsigned int all_unknown:1;
- unsigned int all_unavail:1;
- unsigned int all_busy:1;
- unsigned int all_free:1;
- unsigned int on_hold:1;
- unsigned int busy:1;
- unsigned int in_use:1;
- unsigned int ring:1;
+ unsigned int ringing:1;
+ unsigned int inuse:1;
+ enum ast_device_state state;
};
/*!
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/indications.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/indications.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/indications.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/indications.h Tue Apr 24 03:00:53 2012
@@ -174,7 +174,8 @@
/*!
* \brief Get an iterator for the available tone zones
*
- * Use ao2_iterator_next() to iterate the tone zones.
+ * \note Use ao2_iterator_next() to iterate the tone zones.
+ * \note Use ao2_iterator_destroy() to clean up.
*
* \return an initialized iterator
*/
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/jabber.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/jabber.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/jabber.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/jabber.h Tue Apr 24 03:00:53 2012
@@ -211,7 +211,12 @@
/*! Join/leave existing Chat session */
int ast_aji_join_chat(struct aji_client *client, char *room, char *nick);
int ast_aji_leave_chat(struct aji_client *client, char *room, char *nick);
+/*! Get a client via its name. Increases refcount of client by 1 */
struct aji_client *ast_aji_get_client(const char *name);
struct aji_client_container *ast_aji_get_clients(void);
+/*! Destructor function for buddies to be used with ASTOBJ_UNREF */
+void ast_aji_buddy_destroy(struct aji_buddy *obj);
+/*! Destructor function for clients to be used with ASTOBJ_UNREF after calls to ast_aji_get_client */
+void ast_aji_client_destroy(struct aji_client *obj);
#endif
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/logger.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/logger.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/logger.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/logger.h Tue Apr 24 03:00:53 2012
@@ -107,8 +107,8 @@
/* Note: The AST_LOG_* macros below are the same as
* the LOG_* macros and are intended to eventually replace
- * the LOG_* macros to avoid name collisions as has been
- * seen in app_voicemail. However, please do NOT remove
+ * the LOG_* macros to avoid name collisions with the syslog(3)
+ * log levels. However, please do NOT remove
* the LOG_* macros from the source since these may be still
* needed for third-party modules
*/
@@ -181,7 +181,7 @@
#endif
#define AST_LOG_DTMF __LOG_DTMF, _A_
-#define NUMLOGLEVELS 7
+#define NUMLOGLEVELS 32
/*!
* \brief Get the debug level for a module
Modified: team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/tcptls.h
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/tcptls.h?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/tcptls.h (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/include/asterisk/tcptls.h Tue Apr 24 03:00:53 2012
@@ -128,6 +128,7 @@
struct ast_tls_config *tls_cfg; /*!< points to the SSL configuration if any */
int accept_fd;
int poll_timeout;
+ /*! Server accept_fn thread ID used for external shutdown requests. */
pthread_t master;
void *(*accept_fn)(void *); /*!< the function in charge of doing the accept */
void (*periodic_fn)(void *);/*!< something we may want to run before after select on the accept socket */
@@ -146,6 +147,7 @@
int client;
struct ast_sockaddr remote_address;
struct ast_tcptls_session_args *parent;
+ /*! XXX Why do we still use this lock when this struct is allocated as an ao2 object which has its own lock? */
ast_mutex_t lock;
};
@@ -169,6 +171,13 @@
void *ast_tcptls_server_root(void *);
/*!
+ * \brief Closes a tcptls session instance's file and/or file descriptor.
+ * The tcptls_session will be set to NULL and it's file descriptor will be set to -1
+ * by this function.
+ */
+void ast_tcptls_close_session_file(struct ast_tcptls_session_instance *tcptls_session);
+
+/*!
* \brief This is a generic (re)start routine for a TCP server,
* which does the socket/bind/listen and starts a thread for handling
* accept().
Modified: team/oej/pinedanish-copybridgeflags-1.8/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/acl.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/acl.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/acl.c Tue Apr 24 03:00:53 2012
@@ -408,6 +408,9 @@
}
if (!(ha = ast_calloc(1, sizeof(*ha)))) {
+ if (error) {
+ *error = 1;
+ }
return ret;
}
@@ -583,7 +586,7 @@
return 0;
}
-int ast_get_ip_or_srv(struct ast_sockaddr *addr, const char *value, const char *service)
+int ast_get_ip_or_srv(struct ast_sockaddr *addr, const char *hostname, const char *service)
{
char srv[256];
char host[256];
@@ -591,13 +594,13 @@
int tportno;
if (service) {
- snprintf(srv, sizeof(srv), "%s.%s", service, value);
+ snprintf(srv, sizeof(srv), "%s.%s", service, hostname);
if ((srv_ret = ast_get_srv(NULL, host, sizeof(host), &tportno, srv)) > 0) {
- value = host;
- }
- }
-
- if (resolve_first(addr, value, PARSE_PORT_FORBID, addr->ss.ss_family) != 0) {
+ hostname = host;
+ }
+ }
+
+ if (resolve_first(addr, hostname, PARSE_PORT_FORBID, addr->ss.ss_family) != 0) {
return -1;
}
@@ -686,9 +689,9 @@
return "unknown";
}
-int ast_get_ip(struct ast_sockaddr *addr, const char *value)
-{
- return ast_get_ip_or_srv(addr, value, NULL);
+int ast_get_ip(struct ast_sockaddr *addr, const char *hostname)
+{
+ return ast_get_ip_or_srv(addr, hostname, NULL);
}
int ast_ouraddrfor(const struct ast_sockaddr *them, struct ast_sockaddr *us)
@@ -734,6 +737,7 @@
{
char ourhost[MAXHOSTNAMELEN] = "";
struct ast_sockaddr root;
+ int res, port = ast_sockaddr_port(ourip);
/* just use the bind address if it is nonzero */
if (!ast_sockaddr_is_any(bindaddr)) {
@@ -746,6 +750,8 @@
ast_log(LOG_WARNING, "Unable to get hostname\n");
} else {
if (resolve_first(ourip, ourhost, PARSE_PORT_FORBID, family) == 0) {
+ /* reset port since resolve_first wipes this out */
+ ast_sockaddr_set_port(ourip, port);
return 0;
}
}
@@ -753,8 +759,12 @@
/* A.ROOT-SERVERS.NET. */
if (!resolve_first(&root, "A.ROOT-SERVERS.NET", PARSE_PORT_FORBID, 0) &&
!ast_ouraddrfor(&root, ourip)) {
+ /* reset port since resolve_first wipes this out */
+ ast_sockaddr_set_port(ourip, port);
return 0;
}
- return get_local_address(ourip);
-}
-
+ res = get_local_address(ourip);
+ ast_sockaddr_set_port(ourip, port);
+ return res;
+}
+
Modified: team/oej/pinedanish-copybridgeflags-1.8/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/app.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/app.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/app.c Tue Apr 24 03:00:53 2012
@@ -108,7 +108,7 @@
* \param collect
* \param size
* \param maxlen
- * \param timeout timeout in seconds
+ * \param timeout timeout in milliseconds
*
* \return 0 if extension does not exist, 1 if extension exists
*/
@@ -121,10 +121,12 @@
maxlen = size;
}
- if (!timeout && chan->pbx) {
- timeout = chan->pbx->dtimeoutms / 1000.0;
- } else if (!timeout) {
- timeout = 5;
+ if (!timeout) {
+ if (chan->pbx && chan->pbx->dtimeoutms) {
+ timeout = chan->pbx->dtimeoutms;
+ } else {
+ timeout = 5000;
+ }
}
if ((ts = ast_get_indication_tone(chan->zone, "dial"))) {
@@ -521,9 +523,9 @@
static struct ast_generator linearstream =
{
- alloc: linear_alloc,
- release: linear_release,
- generate: linear_generator,
+ .alloc = linear_alloc,
+ .release = linear_release,
+ .generate = linear_generator,
};
int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride)
Modified: team/oej/pinedanish-copybridgeflags-1.8/main/ast_expr2f.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/ast_expr2f.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/ast_expr2f.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/ast_expr2f.c Tue Apr 24 03:00:53 2012
@@ -56,6 +56,7 @@
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -85,8 +86,6 @@
#ifndef UINT32_MAX
#define UINT32_MAX (4294967295U)
#endif
-
-#endif /* ! C99 */
#endif /* ! FLEXINT_H */
@@ -161,15 +160,7 @@
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#define YY_BUF_SIZE 32768
-#else
#define YY_BUF_SIZE 16384
-#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -609,7 +600,7 @@
static int curlycount = 0;
static char *expr2_token_subst(const char *mess);
-#line 611 "ast_expr2f.c"
+#line 602 "ast_expr2f.c"
#define INITIAL 0
#define var 1
@@ -706,6 +697,10 @@
void ast_yyset_lineno (int line_number ,yyscan_t yyscanner );
+int ast_yyget_column (yyscan_t yyscanner );
+
+void ast_yyset_column (int column_no ,yyscan_t yyscanner );
+
YYSTYPE * ast_yyget_lval (yyscan_t yyscanner );
void ast_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
@@ -748,12 +743,7 @@
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
-#ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#define YY_READ_BUF_SIZE 16384
-#else
#define YY_READ_BUF_SIZE 8192
-#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -772,7 +762,7 @@
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ unsigned n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -860,7 +850,7 @@
#line 130 "ast_expr2.fl"
-#line 862 "ast_expr2f.c"
+#line 852 "ast_expr2f.c"
yylval = yylval_param;
@@ -1206,7 +1196,7 @@
#line 238 "ast_expr2.fl"
ECHO;
YY_BREAK
-#line 1208 "ast_expr2f.c"
+#line 1198 "ast_expr2f.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(var):
yyterminate();
@@ -1980,8 +1970,8 @@
/** Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will
* scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
Modified: team/oej/pinedanish-copybridgeflags-1.8/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/cdr.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/cdr.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/cdr.c Tue Apr 24 03:00:53 2012
@@ -554,7 +554,7 @@
}
if (ast_test_flag(to, AST_CDR_FLAG_LOCKED)) {
- ast_log(LOG_WARNING, "Merging into locked CDR... no choice.");
+ ast_log(LOG_WARNING, "Merging into locked CDR... no choice.\n");
to = zcdr; /* safety-- if all there are is locked CDR's, then.... ?? */
lto = NULL;
}
Modified: team/oej/pinedanish-copybridgeflags-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/pinedanish-copybridgeflags-1.8/main/channel.c?view=diff&rev=363313&r1=363312&r2=363313
==============================================================================
--- team/oej/pinedanish-copybridgeflags-1.8/main/channel.c (original)
+++ team/oej/pinedanish-copybridgeflags-1.8/main/channel.c Tue Apr 24 03:00:53 2012
@@ -1400,7 +1400,6 @@
{
struct ast_frame *f;
struct ast_frame *cur;
- int blah = 1;
unsigned int new_frames = 0;
unsigned int new_voice_frames = 0;
unsigned int queued_frames = 0;
@@ -1499,7 +1498,10 @@
}
if (chan->alertpipe[1] > -1) {
- if (write(chan->alertpipe[1], &blah, new_frames * sizeof(blah)) != (new_frames * sizeof(blah))) {
+ int blah[new_frames];
+
+ memset(blah, 1, sizeof(blah));
+ if (write(chan->alertpipe[1], &blah, sizeof(blah)) != (sizeof(blah))) {
ast_log(LOG_WARNING, "Unable to write to alert pipe on %s (qlen = %d): %s!\n",
chan->name, queued_frames, strerror(errno));
}
@@ -2164,6 +2166,9 @@
if (name_priority < number_priority) {
number_value = name_value;
}
+ if (number_value == AST_PRES_UNAVAILABLE) {
+ return AST_PRES_NUMBER_NOT_AVAILABLE;
+ }
return number_value | number_screening;
}
@@ -2727,21 +2732,25 @@
}
}
-/*! \brief Hangup a channel */
-int ast_hangup(struct ast_channel *chan)
-{
- char extra_str[64]; /* used for cel logging below */
-
- ast_autoservice_stop(chan);
-
- ao2_lock(channels);
- ast_channel_lock(chan);
-
+static void destroy_hooks(struct ast_channel *chan)
+{
if (chan->audiohooks) {
ast_audiohook_detach_list(chan->audiohooks);
chan->audiohooks = NULL;
}
+
ast_framehook_list_destroy(chan);
+}
+
+/*! \brief Hangup a channel */
+int ast_hangup(struct ast_channel *chan)
+{
+ char extra_str[64]; /* used for cel logging below */
+ int was_zombie;
+
+ ast_autoservice_stop(chan);
+
+ ast_channel_lock(chan);
/*
* Do the masquerade if someone is setup to masquerade into us.
@@ -2753,16 +2762,13 @@
*/
while (chan->masq) {
ast_channel_unlock(chan);
- ao2_unlock(channels);
if (ast_do_masquerade(chan)) {
ast_log(LOG_WARNING, "Failed to perform masquerade\n");
/* Abort the loop or we might never leave. */
- ao2_lock(channels);
ast_channel_lock(chan);
break;
}
- ao2_lock(channels);
ast_channel_lock(chan);
}
@@ -2773,13 +2779,20 @@
* to free it later.
*/
ast_set_flag(chan, AST_FLAG_ZOMBIE);
+ destroy_hooks(chan);
ast_channel_unlock(chan);
- ao2_unlock(channels);
return 0;
}
+ if (!(was_zombie = ast_test_flag(chan, AST_FLAG_ZOMBIE))) {
+ ast_set_flag(chan, AST_FLAG_ZOMBIE);
+ }
+
+ ast_channel_unlock(chan);
ao2_unlink(channels, chan);
- ao2_unlock(channels);
+ ast_channel_lock(chan);
+
+ destroy_hooks(chan);
free_translation(chan);
/* Close audio stream */
@@ -2814,14 +2827,9 @@
(long) pthread_self(), chan->name, (long)chan->blocker, chan->blockproc);
ast_assert(ast_test_flag(chan, AST_FLAG_BLOCKING) == 0);
}
- if (!ast_test_flag(chan, AST_FLAG_ZOMBIE)) {
+ if (!was_zombie) {
ast_debug(1, "Hanging up channel '%s'\n", chan->name);
- /*
- * This channel is now dead so mark it as a zombie so anyone
- * left holding a reference to this channel will not use it.
- */
- ast_set_flag(chan, AST_FLAG_ZOMBIE);
if (chan->tech->hangup) {
chan->tech->hangup(chan);
}
@@ -3502,6 +3510,16 @@
c->timingfunc = func;
c->timingdata = data;
+ if (func == NULL && rate == 0 && c->fdno == AST_TIMING_FD) {
+ /* Clearing the timing func and setting the rate to 0
+ * means that we don't want to be reading from the timingfd
+ * any more. Setting c->fdno to -1 means we won't have any
+ * errant reads from the timingfd, meaning we won't potentially
+ * miss any important frames.
+ */
+ c->fdno = -1;
+ }
+
ast_channel_unlock(c);
return res;
@@ -3558,12 +3576,14 @@
return -1;
case AST_CONTROL_RINGING:
case AST_CONTROL_ANSWER:
- case AST_CONTROL_BRIDGEPARAM:
case AST_CONTROL_SRCUPDATE:
case AST_CONTROL_SRCCHANGE:
case AST_CONTROL_CONNECTED_LINE:
case AST_CONTROL_REDIRECTING:
case AST_CONTROL_UPDATE_RTP_PEER:
+ case AST_CONTROL_HOLD:
+ case AST_CONTROL_UNHOLD:
+ case AST_CONTROL_BRIDGEPARAM:
case -1:
/* Unimportant */
break;
@@ -3775,6 +3795,53 @@
}
prestate = chan->_state;
+ if (chan->timingfd > -1 && chan->fdno == AST_TIMING_FD) {
+ enum ast_timer_event res;
+
+ ast_clear_flag(chan, AST_FLAG_EXCEPTION);
+
+ res = ast_timer_get_event(chan->timer);
+
+ switch (res) {
+ case AST_TIMING_EVENT_EXPIRED:
+ ast_timer_ack(chan->timer, 1);
+
+ if (chan->timingfunc) {
+ /* save a copy of func/data before unlocking the channel */
+ int (*func)(const void *) = chan->timingfunc;
+ void *data = chan->timingdata;
+ chan->fdno = -1;
+ ast_channel_unlock(chan);
+ func(data);
+ } else {
+ ast_timer_set_rate(chan->timer, 0);
+ chan->fdno = -1;
+ ast_channel_unlock(chan);
+ }
+
+ /* cannot 'goto done' because the channel is already unlocked */
+ return &ast_null_frame;
+
+ case AST_TIMING_EVENT_CONTINUOUS:
+ if (AST_LIST_EMPTY(&chan->readq) ||
+ !AST_LIST_NEXT(AST_LIST_FIRST(&chan->readq), frame_list)) {
+ ast_timer_disable_continuous(chan->timer);
+ }
+ break;
+ }
+
+ } else if (chan->fds[AST_GENERATOR_FD] > -1 && chan->fdno == AST_GENERATOR_FD) {
+ /* if the AST_GENERATOR_FD is set, call the generator with args
+ * set to -1 so it can do whatever it needs to.
+ */
+ void *tmp = chan->generatordata;
+ chan->generatordata = NULL; /* reset to let ast_write get through */
+ chan->generator->generate(chan, tmp, -1, -1);
+ chan->generatordata = tmp;
+ f = &ast_null_frame;
+ chan->fdno = -1;
+ goto done;
+ }
/* Read and ignore anything on the alertpipe, but read only
one sizeof(blah) per frame that we send from it */
@@ -3796,53 +3863,6 @@
}
}
- if (chan->timingfd > -1 && chan->fdno == AST_TIMING_FD) {
- enum ast_timer_event res;
-
- ast_clear_flag(chan, AST_FLAG_EXCEPTION);
-
- res = ast_timer_get_event(chan->timer);
-
- switch (res) {
- case AST_TIMING_EVENT_EXPIRED:
- ast_timer_ack(chan->timer, 1);
-
- if (chan->timingfunc) {
- /* save a copy of func/data before unlocking the channel */
- int (*func)(const void *) = chan->timingfunc;
- void *data = chan->timingdata;
- chan->fdno = -1;
- ast_channel_unlock(chan);
- func(data);
- } else {
- ast_timer_set_rate(chan->timer, 0);
- chan->fdno = -1;
- ast_channel_unlock(chan);
- }
-
- /* cannot 'goto done' because the channel is already unlocked */
- return &ast_null_frame;
-
- case AST_TIMING_EVENT_CONTINUOUS:
- if (AST_LIST_EMPTY(&chan->readq) ||
- !AST_LIST_NEXT(AST_LIST_FIRST(&chan->readq), frame_list)) {
- ast_timer_disable_continuous(chan->timer);
- }
- break;
- }
-
- } else if (chan->fds[AST_GENERATOR_FD] > -1 && chan->fdno == AST_GENERATOR_FD) {
- /* if the AST_GENERATOR_FD is set, call the generator with args
- * set to -1 so it can do whatever it needs to.
- */
- void *tmp = chan->generatordata;
- chan->generatordata = NULL; /* reset to let ast_write get through */
- chan->generator->generate(chan, tmp, -1, -1);
- chan->generatordata = tmp;
- f = &ast_null_frame;
- chan->fdno = -1;
- goto done;
- }
/* Check for pending read queue */
if (!AST_LIST_EMPTY(&chan->readq)) {
@@ -3960,12 +3980,14 @@
ast_party_connected_line_free(&connected);
break;
}
+ ast_channel_unlock(chan);
if (ast_channel_connected_line_macro(NULL, chan, &connected, 1, 0)) {
ast_indicate_data(chan, AST_CONTROL_CONNECTED_LINE,
read_action_payload->payload,
read_action_payload->payload_size);
}
ast_party_connected_line_free(&connected);
+ ast_channel_lock(chan);
break;
}
ast_frfree(f);
@@ -4282,7 +4304,6 @@
case AST_CONTROL_OFFHOOK:
case AST_CONTROL_TAKEOFFHOOK:
case AST_CONTROL_ANSWER:
- case AST_CONTROL_BRIDGEPARAM:
case AST_CONTROL_HANGUP:
case AST_CONTROL_CONNECTED_LINE:
case AST_CONTROL_REDIRECTING:
@@ -4294,6 +4315,7 @@
case AST_CONTROL_AOC:
case AST_CONTROL_END_OF_Q:
case AST_CONTROL_UPDATE_RTP_PEER:
+ case AST_CONTROL_BRIDGEPARAM:
break;
case AST_CONTROL_INCOMPLETE:
@@ -4460,7 +4482,6 @@
case AST_CONTROL_PROGRESS:
case AST_CONTROL_PROCEEDING:
case AST_CONTROL_VIDUPDATE:
- case AST_CONTROL_BRIDGEPARAM:
case AST_CONTROL_SRCUPDATE:
case AST_CONTROL_SRCCHANGE:
case AST_CONTROL_RADIO_KEY:
@@ -4483,6 +4504,7 @@
case AST_CONTROL_AOC:
case AST_CONTROL_END_OF_Q:
case AST_CONTROL_UPDATE_RTP_PEER:
+ case AST_CONTROL_BRIDGEPARAM:
/* Nothing left to do for these. */
res = 0;
break;
@@ -4900,14 +4922,18 @@
if (fr->subclass.codec == chan->rawwriteformat) {
f = fr;
} else {
- /* XXX Something is not right we are not compatible with this frame bad things can happen
- * problems range from no/one-way audio to unexplained line hangups as a last resort try adjust the format
- * ideally we do not want to do this and this indicates a deeper problem for now we log these events to
- * eliminate user impact and help identify the problem areas
- * JIRA issues related to this :-
- * ASTERISK-14384, ASTERISK-17502, ASTERISK-17541, ASTERISK-18063, ASTERISK-18325, ASTERISK-18422*/
if ((!(fr->subclass.codec & chan->nativeformats)) && (chan->writeformat != fr->subclass.codec)) {
char nf[512];
+
+ /*
+ * XXX Something is not right. We are not compatible with this
+ * frame. Bad things can happen. Problems range from no audio,
+ * one-way audio, to unexplained line hangups. As a last resort
+ * try to adjust the format. Ideally, we do not want to do this
+ * because it indicates a deeper problem. For now, we log these
+ * events to reduce user impact and help identify the problem
+ * areas.
+ */
ast_log(LOG_WARNING, "Codec mismatch on channel %s setting write format to %s from %s native formats %s\n",
chan->name, ast_getformatname(fr->subclass.codec), ast_getformatname(chan->writeformat),
ast_getformatname_multiple(nf, sizeof(nf), chan->nativeformats & AST_FORMAT_AUDIO_MASK));
@@ -5197,11 +5223,47 @@
}
}
+/*!
+ * \internal
+ * \brief Helper function to inherit info from parent channel.
+ *
+ * \param new_chan Channel inheriting information.
+ * \param parent Channel new_chan inherits information.
+ * \param orig Channel being replaced by the call forward channel.
+ *
+ * \return Nothing
+ */
+static void call_forward_inherit(struct ast_channel *new_chan, struct ast_channel *parent, struct ast_channel *orig)
+{
+ if (!ast_test_flag(parent, AST_FLAG_ZOMBIE) && !ast_check_hangup(parent)) {
+ struct ast_party_redirecting redirecting;
+
+ /*
+ * The parent is not a ZOMBIE or hungup so update it with the
+ * original channel's redirecting information.
+ */
+ ast_party_redirecting_init(&redirecting);
+ ast_channel_lock(orig);
+ ast_party_redirecting_copy(&redirecting, &orig->redirecting);
+ ast_channel_unlock(orig);
+ if (ast_channel_redirecting_macro(orig, parent, &redirecting, 1, 0)) {
+ ast_channel_update_redirecting(parent, &redirecting, NULL);
+ }
+ ast_party_redirecting_free(&redirecting);
+ }
+
+ /* Safely inherit variables and datastores from the parent channel. */
+ ast_channel_lock_both(parent, new_chan);
+ ast_channel_inherit_variables(parent, new_chan);
+ ast_channel_datastore_inherit(parent, new_chan);
+ ast_channel_unlock(new_chan);
+ ast_channel_unlock(parent);
+}
+
struct ast_channel *ast_call_forward(struct ast_channel *caller, struct ast_channel *orig, int *timeout, format_t format, struct outgoing_helper *oh, int *outstate)
{
char tmpchan[256];
- struct ast_channel *new = NULL;
- struct ast_party_redirecting *apr = &orig->redirecting;
+ struct ast_channel *new_chan = NULL;
char *data, *type;
int cause = 0;
int res;
@@ -5220,62 +5282,52 @@
data = tmpchan;
type = "Local";
}
- if (!(new = ast_request(type, format, orig, data, &cause))) {
+ if (!(new_chan = ast_request(type, format, orig, data, &cause))) {
ast_log(LOG_NOTICE, "Unable to create channel for call forward to '%s/%s' (cause = %d)\n", type, data, cause);
handle_cause(cause, outstate);
ast_hangup(orig);
return NULL;
}
- ast_channel_set_redirecting(new, apr, NULL);
-
/* Copy/inherit important information into new channel */
if (oh) {
if (oh->vars) {
- ast_set_variables(new, oh->vars);
- }
- if (!ast_strlen_zero(oh->cid_num) && !ast_strlen_zero(oh->cid_name)) {
- ast_set_callerid(new, oh->cid_num, oh->cid_name, oh->cid_num);
+ ast_set_variables(new_chan, oh->vars);
}
if (oh->parent_channel) {
- ast_channel_update_redirecting(oh->parent_channel, apr, NULL);
- ast_channel_inherit_variables(oh->parent_channel, new);
- ast_channel_datastore_inherit(oh->parent_channel, new);
+ call_forward_inherit(new_chan, oh->parent_channel, orig);
}
if (oh->account) {
- ast_cdr_setaccount(new, oh->account);
+ ast_channel_lock(new_chan);
+ ast_cdr_setaccount(new_chan, oh->account);
+ ast_channel_unlock(new_chan);
}
} else if (caller) { /* no outgoing helper so use caller if avaliable */
- ast_channel_update_redirecting(caller, apr, NULL);
- ast_channel_inherit_variables(caller, new);
- ast_channel_datastore_inherit(caller, new);
- }
-
- ast_channel_lock(orig);
- while (ast_channel_trylock(new)) {
- CHANNEL_DEADLOCK_AVOIDANCE(orig);
- }
- ast_copy_flags(new->cdr, orig->cdr, AST_CDR_FLAG_ORIGINATED);
- ast_string_field_set(new, accountcode, orig->accountcode);
- ast_party_caller_copy(&new->caller, &orig->caller);
- ast_party_connected_line_copy(&new->connected, &orig->connected);
- ast_channel_unlock(new);
+ call_forward_inherit(new_chan, caller, orig);
+ }
+
+ ast_channel_lock_both(orig, new_chan);
+ ast_copy_flags(new_chan->cdr, orig->cdr, AST_CDR_FLAG_ORIGINATED);
+ ast_string_field_set(new_chan, accountcode, orig->accountcode);
+ ast_party_connected_line_copy(&new_chan->connected, &orig->connected);
+ ast_party_redirecting_copy(&new_chan->redirecting, &orig->redirecting);
+ ast_channel_unlock(new_chan);
ast_channel_unlock(orig);
/* call new channel */
- res = ast_call(new, data, 0);
+ res = ast_call(new_chan, data, 0);
if (timeout) {
*timeout = res;
}
if (res) {
ast_log(LOG_NOTICE, "Unable to call forward to channel %s/%s\n", type, (char *)data);
ast_hangup(orig);
- ast_hangup(new);
+ ast_hangup(new_chan);
return NULL;
}
ast_hangup(orig);
- return new;
+ return new_chan;
}
struct ast_channel *__ast_request_and_dial(const char *type, format_t format, const struct ast_channel *requestor, void *data, int timeout, int *outstate, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
@@ -5300,20 +5352,42 @@
}
if (oh) {
- if (oh->vars)
+ if (oh->vars) {
[... 1992 lines stripped ...]
More information about the asterisk-commits
mailing list