[asterisk-commits] oej: branch oej/jasmin-remote-hold-1.8 r401408 - in /team/oej/jasmin-remote-h...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Oct 21 21:59:30 CDT 2013
Author: oej
Date: Mon Oct 21 21:59:26 2013
New Revision: 401408
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401408
Log:
resetting life. And conflict. And more.
Modified:
team/oej/jasmin-remote-hold-1.8/ (props changed)
team/oej/jasmin-remote-hold-1.8/apps/app_queue.c
team/oej/jasmin-remote-hold-1.8/channels/chan_sip.c
team/oej/jasmin-remote-hold-1.8/channels/sig_analog.c
team/oej/jasmin-remote-hold-1.8/main/channel.c
team/oej/jasmin-remote-hold-1.8/main/editline/term.c
team/oej/jasmin-remote-hold-1.8/res/res_jabber.c
Propchange: team/oej/jasmin-remote-hold-1.8/
------------------------------------------------------------------------------
automerge = Is-there-life-off-net?
Propchange: team/oej/jasmin-remote-hold-1.8/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Oct 21 21:59:26 2013
@@ -1,1 +1,1 @@
-/branches/1.8:1-400930
+/branches/1.8:1-401407
Modified: team/oej/jasmin-remote-hold-1.8/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/apps/app_queue.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/apps/app_queue.c (original)
+++ team/oej/jasmin-remote-hold-1.8/apps/app_queue.c Mon Oct 21 21:59:26 2013
@@ -7261,9 +7261,10 @@
ao2_lock(q);
/* This check is to make sure we don't print information for realtime
* queues which have been deleted from realtime but which have not yet
- * been deleted from the in-core container
+ * been deleted from the in-core container. Only do this if we're not
+ * looking for a specific queue.
*/
- if (q->realtime) {
+ if (argc < 3 && q->realtime) {
realtime_queue = load_realtime_queue(q->name);
if (!realtime_queue) {
ao2_unlock(q);
Modified: team/oej/jasmin-remote-hold-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/channels/chan_sip.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/channels/chan_sip.c (original)
+++ team/oej/jasmin-remote-hold-1.8/channels/chan_sip.c Mon Oct 21 21:59:26 2013
@@ -21023,7 +21023,11 @@
/* This 200 OK's SDP is not acceptable, so we need to ack, then hangup */
/* For re-invites, we try to recover */
ast_set_flag(&p->flags[0], SIP_PENDINGBYE);
+ p->owner->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+ p->hangupcause = AST_CAUSE_BEARERCAPABILITY_NOTAVAIL;
+ sip_queue_hangup_cause(p, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
}
+ }
ast_rtp_instance_activate(p->rtp);
} else if (!reinvite) {
struct ast_sockaddr remote_address = {{0,}};
@@ -21089,7 +21093,7 @@
}
if (!req->ignore && p->owner) {
- if (!reinvite) {
+ if (!reinvite && !res) {
ast_queue_control(p->owner, AST_CONTROL_ANSWER);
if (sip_cfg.callevents)
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
Modified: team/oej/jasmin-remote-hold-1.8/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/channels/sig_analog.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/channels/sig_analog.c (original)
+++ team/oej/jasmin-remote-hold-1.8/channels/sig_analog.c Mon Oct 21 21:59:26 2013
@@ -679,13 +679,11 @@
* \param p Analog private structure.
* \param inthreeway TRUE if the 3-way call is conferenced.
*
- * \note
- * On entry these locks are held: real-call, private, 3-way call.
+ * \note On entry these locks are held: real-call, private, 3-way call.
+ * \note On exit these locks are held: real-call, private.
*
- * \retval 1 Transfer successful. 3-way call is unlocked and subchannel is unalloced.
- * Swapped real and 3-way subchannel.
- * \retval 0 Transfer successful. 3-way call is unlocked and subchannel is unalloced.
- * \retval -1 on error. Caller must unlock 3-way call.
+ * \retval 0 on success.
+ * \retval -1 on error.
*/
static int analog_attempt_transfer(struct analog_pvt *p, int inthreeway)
{
@@ -693,6 +691,7 @@
struct ast_channel *owner_3way;
struct ast_channel *bridge_real;
struct ast_channel *bridge_3way;
+ int ret = 0;
owner_real = p->subs[ANALOG_SUB_REAL].owner;
owner_3way = p->subs[ANALOG_SUB_THREEWAY].owner;
@@ -720,15 +719,8 @@
bridge_3way, &owner_3way->connected, !inthreeway)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
bridge_3way->name, owner_real->name);
- return -1;
- }
-
- /* Three-way is now the REAL */
- analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
- ast_channel_unlock(owner_3way);
- analog_unalloc_sub(p, ANALOG_SUB_THREEWAY);
- /* Tell the caller not to hangup */
- return 1;
+ ret = -1;
+ }
} else if (bridge_real) {
/* Try transferring the other way. */
ast_verb(3, "TRANSFERRING %s to %s\n", owner_real->name, owner_3way->name);
@@ -746,18 +738,19 @@
!inthreeway, bridge_real, &owner_real->connected, 0)) {
ast_log(LOG_WARNING, "Unable to masquerade %s as %s\n",
bridge_real->name, owner_3way->name);
- return -1;
- }
-
- /* Orphan the channel after releasing the lock */
- ast_channel_unlock(owner_3way);
- analog_unalloc_sub(p, ANALOG_SUB_THREEWAY);
- return 0;
+ ret = -1;
+ }
} else {
ast_debug(1, "Neither %s nor %s are in a bridge, nothing to transfer\n",
owner_real->name, owner_3way->name);
- return -1;
- }
+ ret = -1;
+ }
+
+ if (ret) {
+ ast_softhangup_nolock(owner_3way, AST_SOFTHANGUP_DEV);
+ }
+ ast_channel_unlock(owner_3way);
+ return ret;
}
static int analog_update_conf(struct analog_pvt *p)
@@ -2881,16 +2874,13 @@
analog_set_new_owner(p, NULL);
/* Ring the phone */
analog_ring(p);
- } else {
- res = analog_attempt_transfer(p, inthreeway);
- if (res < 0) {
- /* Transfer attempt failed. */
- ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
- ast_channel_unlock(p->subs[ANALOG_SUB_THREEWAY].owner);
- } else if (res) {
- /* Don't actually hang up at this point */
- break;
- }
+ } else if (!analog_attempt_transfer(p, inthreeway)) {
+ /*
+ * Transfer successful. Don't actually hang up at this point.
+ * Let our channel legs of the calls die off as the transfer
+ * percolates through the core.
+ */
+ break;
}
} else {
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
Modified: team/oej/jasmin-remote-hold-1.8/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/main/channel.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/main/channel.c (original)
+++ team/oej/jasmin-remote-hold-1.8/main/channel.c Mon Oct 21 21:59:26 2013
@@ -6504,6 +6504,8 @@
int x;
int i;
int origstate;
+ unsigned int orig_disablestatecache;
+ unsigned int clone_disablestatecache;
int visible_indication;
int clone_was_zombie = 0;/*!< TRUE if the clonechan was a zombie before the masquerade. */
struct ast_frame *current;
@@ -6727,6 +6729,20 @@
origstate = original->_state;
original->_state = clonechan->_state;
clonechan->_state = origstate;
+
+ /* And the swap the cachable state too. Otherwise we'd start caching
+ * Local channels and ignoring real ones. */
+ orig_disablestatecache = ast_test_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ clone_disablestatecache = ast_test_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ if (orig_disablestatecache != clone_disablestatecache) {
+ if (orig_disablestatecache) {
+ ast_clear_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ ast_set_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ } else {
+ ast_set_flag(original, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ ast_clear_flag(clonechan, AST_FLAG_DISABLE_DEVSTATE_CACHE);
+ }
+ }
/* Mangle the name of the clone channel */
snprintf(zombn, sizeof(zombn), "%s<ZOMBIE>", orig); /* quick, hide the brains! */
Modified: team/oej/jasmin-remote-hold-1.8/main/editline/term.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/main/editline/term.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/main/editline/term.c (original)
+++ team/oej/jasmin-remote-hold-1.8/main/editline/term.c Mon Oct 21 21:59:26 2013
@@ -65,15 +65,17 @@
#include <ncurses.h>
#endif
#if defined(HAVE_TERM_H)
+/* Can not use /usr/include/term.h because of a lot of incompatibilities, so just define some prototypes */
#include "term.h"
-/* Can not use /usr/include/term.h because of a lot of incompatibilities, so just define some prototypes */
+#endif /* defined(HAVE_TERM_H) */
+#if defined(HAVE_TERM_H) || !(defined(HAVE_TERMCAP_H) || defined(HAVE_CURSES_H) || defined(HAVE_NCURSES_H))
extern int tgetent(char *, const char *);
extern int tgetflag(const char *);
extern int tgetnum(const char *);
extern char *tgetstr(const char *, char **);
extern int tputs (const char *, int, int (*)(int));
extern char *tgoto (const char *, int, int);
-#endif /* defined(HAVE_TERM_H) */
+#endif /* defined(HAVE_TERM_H) or none_of_the_others */
#include <sys/types.h>
#include <sys/ioctl.h>
Modified: team/oej/jasmin-remote-hold-1.8/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/jasmin-remote-hold-1.8/res/res_jabber.c?view=diff&rev=401408&r1=401407&r2=401408
==============================================================================
--- team/oej/jasmin-remote-hold-1.8/res/res_jabber.c (original)
+++ team/oej/jasmin-remote-hold-1.8/res/res_jabber.c Mon Oct 21 21:59:26 2013
@@ -3508,7 +3508,7 @@
iks *orig_pubsub = iks_find(pak->x, "pubsub");
struct aji_client *client;
if (!orig_pubsub) {
- ast_log(LOG_ERROR, "Error isn't a PubSub error, why are we here?\n");
+ ast_debug(1, "Error isn't a PubSub error, why are we here?\n");
return IKS_FILTER_EAT;
}
orig_request = iks_child(orig_pubsub);
More information about the asterisk-commits
mailing list