[svn-commits] file: branch group/stasis_cache_usage r392950 - /team/group/stasis_cache_usag...

2013-06-26 Thread SVN commits to the Digium repositories
Author: file
Date: Wed Jun 26 09:01:24 2013
New Revision: 392950

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392950
Log:
Incorporate review feedback.

Modified:
team/group/stasis_cache_usage/main/cli.c
team/group/stasis_cache_usage/main/manager.c
team/group/stasis_cache_usage/main/manager_bridging.c
team/group/stasis_cache_usage/main/manager_channels.c

Modified: team/group/stasis_cache_usage/main/cli.c
URL: 
http://svnview.digium.com/svn/asterisk/team/group/stasis_cache_usage/main/cli.c?view=diffrev=392950r1=392949r2=392950
==
--- team/group/stasis_cache_usage/main/cli.c (original)
+++ team/group/stasis_cache_usage/main/cli.c Wed Jun 26 09:01:24 2013
@@ -948,7 +948,7 @@
if (concise) {
ast_cli(a-fd, CONCISE_FORMAT_STRING, cs-name, 
cs-context, cs-exten, cs-priority, ast_state2str(cs-state),
S_OR(cs-appl, (None)),
-   cs-data,   
+   cs-data,
cs-caller_number,
cs-accountcode,
cs-peeraccount,
@@ -978,7 +978,7 @@
}
}
ao2_iterator_destroy(it_chans);
-   
+
if (!concise) {
numchans = ast_active_channels();
ast_cli(a-fd, %d active channel%s\n, numchans, 
ESS(numchans));
@@ -1987,7 +1987,7 @@
  * \param cmds
  * \param match_type has 3 possible values:
  *  0   returns if the search key is equal or longer than the entry.
- * note that trailing optional arguments are skipped.
+ * note that trailing optional arguments are skipped.
  *  -1  true if the mismatch is on the last word XXX not true!
  *  1   true only on complete, exact match.
  *

Modified: team/group/stasis_cache_usage/main/manager.c
URL: 
http://svnview.digium.com/svn/asterisk/team/group/stasis_cache_usage/main/manager.c?view=diffrev=392950r1=392949r2=392950
==
--- team/group/stasis_cache_usage/main/manager.c (original)
+++ team/group/stasis_cache_usage/main/manager.c Wed Jun 26 09:01:24 2013
@@ -219,21 +219,6 @@
description
paraWill return the status information of each 
channel along with the
value for the specified channel variables./para
-   /description
-   /manager
-   manager name=BridgeShow language=en_US
-   synopsis
-   List bridge information.
-   /synopsis
-   syntax
-   xi:include 
xpointer=xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])
 /
-   parameter name=Bridge required=false
-   paraOptional identifier of a specific 
bridge./para
-   /parameter
-   /syntax
-   description
-   paraWill return the bridge information of each 
bridge, or optionally
-   only information for a specific bridge./para
/description
/manager
manager name=Setvar language=en_US
@@ -3708,8 +3693,6 @@
char *variables = ast_strdupa(S_OR(cvariables, ));
RAII_VAR(struct ao2_container *, cached_channels, NULL, ao2_cleanup);
struct stasis_message *msg;
-   struct timeval now = ast_tvnow();
-   long elapsed_seconds = 0;
int channels = 0;
int all = ast_strlen_zero(name); /* set if we want all channels */
const char *id = astman_get_header(m, ActionID);
@@ -3757,6 +3740,7 @@
for (; msg; msg = ao2_iterator_next(it_chans)) {
struct ast_channel_snapshot *snapshot = 
stasis_message_data(msg);
struct ast_channel *c;
+   struct ast_str *built = 
ast_manager_build_channel_state_string_prefix(snapshot, );
 
if (!ast_strlen_zero(cvariables)  (c = 
ast_channel_get_by_name(snapshot-name))) {
int i;
@@ -3780,77 +3764,19 @@
 
channels++;
 
-   if (!ast_tvzero(snapshot-creationtime)) {
-   elapsed_seconds = now.tv_sec - 
snapshot-creationtime.tv_sec;
-   }
astman_append(s,
Event: Status\r\n
Privilege: Call\r\n
-   Channel: %s\r\n
-   Type: %s\r\n
-   DNID: %s\r\n
-   CallerIDNum: %s\r\n
-   CallerIDName: %s\r\n
-   ConnectedLineNum: %s\r\n
-   ConnectedLineName: %s\r\n
-   EffectiveConnectedLineNum: 

[svn-commits] mmichelson: branch mmichelson/atxfer_features r392951 - /team/mmichelson/atxf...

2013-06-26 Thread SVN commits to the Digium repositories
Author: mmichelson
Date: Wed Jun 26 09:19:39 2013
New Revision: 392951

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392951
Log:
Get rid of a XXX comment in the COMPLETE state.

There was a concern about sending an UNHOLD to a bridge
after a merge since either of the individual bridges may have
been simple bridges, but the merge may have resulted in the
bridge being a multimix bridge. If an UNHOLD is sent to a multimix
bridge, then the frame will not be passed to the channels.

This is corrected by performing the unhold before entering the
COMPLETE state. Since there are separate states depending on
what bridge the transferer is in prior to the COMPLETE state, this
makes things very simple.


Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: 
http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diffrev=392951r1=392950r2=392951
==
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun 26 09:19:39 
2013
@@ -712,15 +712,17 @@
return TRANSFER_FAIL;
case STIMULUS_TRANSFERER_HANGUP:
case STIMULUS_DTMF_ATXFER_COMPLETE:
-return TRANSFER_COMPLETE;
+   /* We know the transferer is in the target_bridge, so take the 
other bridge off hold */
+   bridge_unhold(props-transferee_bridge);
+   return TRANSFER_COMPLETE;
case STIMULUS_TARGET_HANGUP:
case STIMULUS_DTMF_ATXFER_ABORT:
-return TRANSFER_REBRIDGE;
+   return TRANSFER_REBRIDGE;
case STIMULUS_DTMF_ATXFER_THREEWAY:
-return TRANSFER_THREEWAY;
+   return TRANSFER_THREEWAY;
case STIMULUS_DTMF_ATXFER_SWAP:
 hold(props-transferer);
-return TRANSFER_DOUBLECHECKING;
+   return TRANSFER_DOUBLECHECKING;
}
 }
 
@@ -758,15 +760,17 @@
return TRANSFER_FAIL;
case STIMULUS_TRANSFERER_HANGUP:
case STIMULUS_DTMF_ATXFER_COMPLETE:
-return TRANSFER_COMPLETE;
+   /* We know the transferer is in the transferee, so take the 
other bridge off hold */
+   bridge_unhold(props-target_bridge);
+   return TRANSFER_COMPLETE;
case STIMULUS_TARGET_HANGUP:
case STIMULUS_DTMF_ATXFER_ABORT:
-return TRANSFER_RESUME;
+   return TRANSFER_RESUME;
case STIMULUS_DTMF_ATXFER_THREEWAY:
-return TRANSFER_THREEWAY;
+   return TRANSFER_THREEWAY;
case STIMULUS_DTMF_ATXFER_SWAP:
-hold(props-transferer);
-return TRANSFER_CONSULTING;
+   hold(props-transferer);
+   return TRANSFER_CONSULTING;
}
 }
 
@@ -776,13 +780,6 @@
bridge_merge(props-transferee_bridge, props-target_bridge, 
props-transferer, 1);
} else {
bridge_merge(props-transferee_bridge, props-target_bridge, 
NULL, 0);
-   }
-
-   /* XXX Same unhold concern here as in the threeway state. However, there
-* is no guarantee here that the resulting bridge's technology will be.
-*/
-   if (props-transferer) {
-   bridge_unhold(props-transferee_bridge);
}
 
return 0;


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] mmichelson: branch mmichelson/atxfer_features r392952 - /team/mmichelson/atxf...

2013-06-26 Thread SVN commits to the Digium repositories
Author: mmichelson
Date: Wed Jun 26 09:35:40 2013
New Revision: 392952

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392952
Log:
Fix hold/unhold issue for THREEWAY state.

This fix is similar to fix for the COMPLETE state made in the previous commit.


Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: 
http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diffrev=392952r1=392951r2=392952
==
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun 26 09:35:40 
2013
@@ -603,6 +603,7 @@
case STIMULUS_DTMF_ATXFER_ABORT:
return TRANSFER_REBRIDGE;
case STIMULUS_DTMF_ATXFER_THREEWAY:
+   bridge_unhold(props-transferee_bridge);
return TRANSFER_THREEWAY;
case STIMULUS_DTMF_ATXFER_SWAP:
return TRANSFER_HESITANT;
@@ -667,12 +668,6 @@
 {
bridge_merge(props-transferee_bridge, props-target_bridge, NULL, 0);
 
-   /* XXX After the bridge merge, the transferee_bridge will be a softmix
-* bridge. If one of the involved bridges was a simple bridge and the
-* participant was on hold, then will this unhold properly remove the 
hold
-* from the channel?
-*/
-   unhold(props-transferer);
return 0;
 }
 
@@ -719,9 +714,10 @@
case STIMULUS_DTMF_ATXFER_ABORT:
return TRANSFER_REBRIDGE;
case STIMULUS_DTMF_ATXFER_THREEWAY:
+   bridge_unhold(props-transferee_bridge);
return TRANSFER_THREEWAY;
case STIMULUS_DTMF_ATXFER_SWAP:
-hold(props-transferer);
+   hold(props-transferer);
return TRANSFER_DOUBLECHECKING;
}
 }
@@ -767,6 +763,7 @@
case STIMULUS_DTMF_ATXFER_ABORT:
return TRANSFER_RESUME;
case STIMULUS_DTMF_ATXFER_THREEWAY:
+   bridge_unhold(props-target_bridge);
return TRANSFER_THREEWAY;
case STIMULUS_DTMF_ATXFER_SWAP:
hold(props-transferer);


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] rmudgett: trunk r392953 - /trunk/main/bridging.c

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 09:38:57 2013
New Revision: 392953

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392953
Log:
Fix several problems with ast_bridge_add_channel().

* Fix locking problems.  ast_bridge_move() locks two bridges.  To do that,
deadlock avoidance must be done.  Called bridge_move_locked() instead.

* Fix inconsistency in the bridge dissolve check callers.  The original
caller has already removed the channel from the bridge.  The new caller
has not removed the channel from the bridge.  Reverted
bridge_dissolve_check() and added bridge_dissolve_check_stolen() to be
used by the new caller on the original bridge after the channel is moved
to the new bridge.

* Fix memory leak of features if the added channel was already in a
bridge.

* Fix incorrect call to ast_bridge_impart().

* Renamed bridge_chan to yanked_chan.

Modified:
trunk/main/bridging.c

Modified: trunk/main/bridging.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diffrev=392953r1=392952r2=392953
==
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Wed Jun 26 09:38:57 2013
@@ -528,65 +528,80 @@
 
 /*!
  * \internal
- * \brief Determine whether a bridge channel leaving the bridge will cause it 
to dissolve or not.
- * \since 12.0.0
- *
- * \param bridge_channel Channel causing the check
- * \param bridge The bridge we are concerned with
- *
- * \note the bridge should be locked prior to calling this function
- *
- * \retval 0 if the channel leaving shouldn't cause the bridge to dissolve
- * \retval non-zero if the channel should cause the bridge to dissolve
- */
-static int bridge_check_will_dissolve(struct ast_bridge_channel 
*bridge_channel, struct ast_bridge *bridge, int assume_end_state)
-{
+ * \brief Check if a bridge should dissolve and do it.
+ * \since 12.0.0
+ *
+ * \param bridge_channel Channel causing the check.
+ *
+ * \note On entry, bridge_channel-bridge is already locked.
+ *
+ * \return Nothing
+ */
+static void bridge_dissolve_check(struct ast_bridge_channel *bridge_channel)
+{
+   struct ast_bridge *bridge = bridge_channel-bridge;
+
if (bridge-dissolved) {
-   /* The bridge is already dissolved. Don't try to dissolve it 
again. */
-   return 0;
+   return;
}
 
if (!bridge-num_channels
 ast_test_flag(bridge-feature_flags, 
AST_BRIDGE_FLAG_DISSOLVE_EMPTY)) {
/* Last channel leaving the bridge turns off the lights. */
-   return 1;
-   }
-
-   switch (assume_end_state ? AST_BRIDGE_CHANNEL_STATE_END : 
bridge_channel-state) {
+   bridge_dissolve(bridge);
+   return;
+   }
+
+   switch (bridge_channel-state) {
case AST_BRIDGE_CHANNEL_STATE_END:
/* Do we need to dissolve the bridge because this channel hung 
up? */
if (ast_test_flag(bridge-feature_flags, 
AST_BRIDGE_FLAG_DISSOLVE_HANGUP)
|| (bridge_channel-features-usable
 
ast_test_flag(bridge_channel-features-feature_flags,

AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP))) {
-   return 1;
-   }
-
+   bridge_dissolve(bridge);
+   return;
+   }
break;
default:
break;
}
-   /* BUGBUG need to implement AST_BRIDGE_CHANNEL_FLAG_LONELY support here 
*/
-   return 0;
-}
-
-/*!
- * \internal
- * \brief Check if a bridge should dissolve and do it.
- * \since 12.0.0
- *
- * \param bridge_channel Channel causing the check.
- *
- * \note On entry, bridge_channel-bridge is already locked.
+/* BUGBUG need to implement AST_BRIDGE_CHANNEL_FLAG_LONELY support here */
+}
+
+/*!
+ * \internal
+ * \brief Check if a bridge should dissolve because of a stolen channel and do 
it.
+ * \since 12.0.0
+ *
+ * \param bridge Bridge to check.
+ * \param bridge_channel Stolen channel causing the check.  It is not in the 
bridge to check and may be in another bridge.
+ *
+ * \note On entry, bridge and bridge_channel-bridge are already locked.
  *
  * \return Nothing
  */
-static void bridge_dissolve_check(struct ast_bridge_channel *bridge_channel)
-{
-   struct ast_bridge *bridge = bridge_channel-bridge;
-
-   if (bridge_check_will_dissolve(bridge_channel, bridge, 0)) {
+static void bridge_dissolve_check_stolen(struct ast_bridge *bridge, struct 
ast_bridge_channel *bridge_channel)
+{
+   if (bridge-dissolved) {
+   return;
+   }
+
+   if (bridge_channel-features-usable
+ast_test_flag(bridge_channel-features-feature_flags,
+   AST_BRIDGE_CHANNEL_FLAG_DISSOLVE_HANGUP)) {
+   /* The stolen channel controlled the bridge it was stolen from. 
*/

[svn-commits] dlee: branch dlee/ari-authn r392954 - in /team/dlee/ari-authn: ./ include/ast...

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 09:51:10 2013
New Revision: 392954

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392954
Log:
Configure checking for crypt

Modified:
team/dlee/ari-authn/configure
team/dlee/ari-authn/configure.ac
team/dlee/ari-authn/include/asterisk/autoconfig.h.in
team/dlee/ari-authn/include/asterisk/utils.h
team/dlee/ari-authn/main/Makefile
team/dlee/ari-authn/main/utils.c
team/dlee/ari-authn/makeopts.in
team/dlee/ari-authn/res/stasis_http/config.c

Modified: team/dlee/ari-authn/configure.ac
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/configure.ac?view=diffrev=392954r1=392953r2=392954
==
--- team/dlee/ari-authn/configure.ac (original)
+++ team/dlee/ari-authn/configure.ac Wed Jun 26 09:51:10 2013
@@ -388,6 +388,7 @@
 AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
 AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in 
corosync 1.x], [COROSYNC], [cfg])
 AST_EXT_LIB_SETUP([CURSES], [curses], [curses])
+AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
 AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
 AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_SRTP], [OpenSSL SRTP Extension Support], 
[CRYPTO], [crypto])
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
@@ -2148,6 +2149,26 @@
exit 1
 fi
 
+# Find crypt support
+# * -lcrypt on *NIX
+# * in libsystem on OS X
+AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
+AC_CHECK_FUNCS([crypt], [SYSCRYPT=true], [SYSCRYPT=])
+
+if test x$LIBCRYPT != x ; then
+CRYPT_LIB=$LIBCRYPT_LIB
+elif test x$SYSCRYPT != x ; then
+CRYPT_LIB=
+fi
+
+AC_SUBST(CRYPT_LIB)
+
+# Check for crypt_r support
+save_LIBS=$LIBS
+LIBS=$CRYPT_LIB $LIBS
+AC_CHECK_FUNCS([crypt_r])
+LIBS=$save_LIBS
+
 AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
 
 if test $PBX_CRYPTO = 1;

Modified: team/dlee/ari-authn/include/asterisk/autoconfig.h.in
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/include/asterisk/autoconfig.h.in?view=diffrev=392954r1=392953r2=392954
==
--- team/dlee/ari-authn/include/asterisk/autoconfig.h.in (original)
+++ team/dlee/ari-authn/include/asterisk/autoconfig.h.in Wed Jun 26 09:51:10 
2013
@@ -149,8 +149,14 @@
 /* Define to 1 if you have the `cosl' function. */
 #undef HAVE_COSL
 
+/* Define to 1 if you have the `crypt' function. */
+#undef HAVE_CRYPT
+
 /* Define to 1 if you have the OpenSSL Cryptography library. */
 #undef HAVE_CRYPTO
+
+/* Define to 1 if you have the `crypt_r' function. */
+#undef HAVE_CRYPT_R
 
 /* Define to 1 if you have a functional curl library. */
 #undef HAVE_CURL

Modified: team/dlee/ari-authn/include/asterisk/utils.h
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/include/asterisk/utils.h?view=diffrev=392954r1=392953r2=392954
==
--- team/dlee/ari-authn/include/asterisk/utils.h (original)
+++ team/dlee/ari-authn/include/asterisk/utils.h Wed Jun 26 09:51:10 2013
@@ -938,4 +938,25 @@
 void _dtor_ ## varname (vartype * v) { dtor(*v); } \
 vartype varname __attribute__((cleanup(_dtor_ ## varname))) = (initval)
 
+/*
+ * \brief Asterisk wrapper around crypt(3) for encrypting passwords.
+ *
+ * This function will generate a random salt and encrypt the given password.
+ *
+ * \param key User's password to crypt.
+ * \return Crypted password.
+ * \return \c NULL on error.
+ */
+char *ast_crypt_encrypt(const char *key);
+
+/*
+ * \brief Asterisk wrapper around crypt(3) for validating passwords.
+ *
+ * \param key User's password to validate.
+ * \param expected Expected result from crypt.
+ * \return True (non-zero) if key matches crypted.
+ * \return False (zero) if key doesn't match.
+ */
+int ast_crypt_validate(const char *key, const char *expected);
+
 #endif /* _ASTERISK_UTILS_H */

Modified: team/dlee/ari-authn/main/Makefile
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/main/Makefile?view=diffrev=392954r1=392953r2=392954
==
--- team/dlee/ari-authn/main/Makefile (original)
+++ team/dlee/ari-authn/main/Makefile Wed Jun 26 09:51:10 2013
@@ -37,6 +37,7 @@
 AST_LIBS+=$(ASTSSL_LIBS)
 AST_LIBS+=$(JANSSON_LIB)
 AST_LIBS+=$(UUID_LIB)
+AST_LIBS+=$(CRYPT_LIB)
 
 ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),)
   ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)

Modified: team/dlee/ari-authn/main/utils.c
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/main/utils.c?view=diffrev=392954r1=392953r2=392954
==
--- team/dlee/ari-authn/main/utils.c (original)
+++ team/dlee/ari-authn/main/utils.c Wed Jun 26 09:51:10 2013
@@ 

[svn-commits] mmichelson: branch mmichelson/atxfer_features r392969 - /team/mmichelson/atxf...

2013-06-26 Thread SVN commits to the Digium repositories
Author: mmichelson
Date: Wed Jun 26 11:17:44 2013
New Revision: 392969

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392969
Log:
Get blond transfers working properly.

This change involves changing the BLOND state to a terminal
one. The idea originally was for this state to not be terminal
so that it could transition in case we need to re-call any of
the parties involved. However, I am instead going to create
a different state to be used for that scenario.


Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: 
http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diffrev=392969r1=392968r2=392969
==
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun 26 11:17:44 
2013
@@ -514,6 +514,19 @@
ast_bridge_channel_write_unhold(bridge_channel);
 }
 
+static void ringing(struct ast_channel *chan)
+{
+   RAII_VAR(struct ast_bridge_channel *, bridge_channel, NULL, 
ao2_cleanup);
+
+   ast_channel_lock(chan);
+   bridge_channel = ast_channel_get_bridge_channel(chan);
+   ast_channel_unlock(chan);
+   
+   ast_assert(bridge_channel != NULL);
+
+   ast_bridge_channel_write_control_data(bridge_channel, 
AST_CONTROL_RINGING, NULL, 0);
+}
+
 static void bridge_unhold(struct ast_bridge *bridge)
 {
struct ast_frame unhold = {
@@ -590,11 +603,7 @@
return TRANSFER_FAIL;
case STIMULUS_DTMF_ATXFER_COMPLETE:
case STIMULUS_TRANSFERER_HANGUP:
-   /* XXX For this state change, I need to take the
-* transferee off hold, but the transferer is not in the
-* bridge. Can I just write directly to the bridge?
-* Queue it on the bridge?
-*/
+   bridge_unhold(props-transferee_bridge);
return TRANSFER_BLOND;
case STIMULUS_TARGET_ANSWER:
return TRANSFER_CONSULTING;
@@ -773,49 +782,24 @@
 
 static int complete_enter(struct attended_transfer_properties *props)
 {
-   if (props-transferer) {
+   if (ast_check_hangup(props-transferer)) {
+   bridge_merge(props-transferee_bridge, props-target_bridge, 
NULL, 0);
+   } else {
bridge_merge(props-transferee_bridge, props-target_bridge, 
props-transferer, 1);
+   }
+
+   return 0;
+}
+
+static int blond_enter(struct attended_transfer_properties *props)
+{
+   if (ast_check_hangup(props-transferer)) {
+   bridge_merge(props-transferee_bridge, props-target_bridge, 
NULL, 0);
} else {
-   bridge_merge(props-transferee_bridge, props-target_bridge, 
NULL, 0);
-   }
-
-   return 0;
-}
-
-static int blond_enter(struct attended_transfer_properties *props)
-{
-   if (ast_check_hangup(props-transferer)) {
-   return 0;
-   }
-   ast_softhangup(props-transferer, AST_SOFTHANGUP_EXPLICIT);
-   props-transferer = ast_channel_unref(props-transferer);
-   return 0;
-}
-
-static enum attended_transfer_state blond_next(struct 
attended_transfer_properties *props,
-   enum attended_transfer_stimulus stimulus)
-{
-   switch (stimulus) {
-   default:
-   case STIMULUS_NONE:
-   case STIMULUS_DTMF_ATXFER_ABORT:
-   case STIMULUS_DTMF_ATXFER_COMPLETE:
-   case STIMULUS_DTMF_ATXFER_THREEWAY:
-   case STIMULUS_DTMF_ATXFER_SWAP:
-   case STIMULUS_TRANSFERER_HANGUP:
-   case STIMULUS_TRANSFERER_ANSWER:
-   ast_assert(0);
-   case STIMULUS_TRANSFEREE_HANGUP:
-   return TRANSFER_FAIL;
-   case STIMULUS_TARGET_ANSWER:
-   return TRANSFER_COMPLETE;
-   case STIMULUS_TARGET_HANGUP:
-   case STIMULUS_TIMEOUT:
-   if (props-atxferdropcall) {
-   return TRANSFER_FAIL;
-   }
-   return TRANSFER_RECALLING;
-   }
+   bridge_merge(props-transferee_bridge, props-target_bridge, 
props-transferer, 1);
+   }
+   ringing(props-transfer_target);
+   return 0;
 }
 
 static int recalling_enter(struct attended_transfer_properties *props)
@@ -871,6 +855,7 @@
 static enum attended_transfer_state retransfer_next(struct 
attended_transfer_properties *props,
enum attended_transfer_stimulus stimulus)
 {
+   /* XXX This is no longer correct */
return TRANSFER_BLOND;
 }
 
@@ -938,8 +923,7 @@
[TRANSFER_BLOND] = {
.state_name = Blond,
.enter = blond_enter,
-   .next = blond_next,
-   .flags = TRANSFER_STATE_IS_TIMED,
+   .flags = TRANSFER_STATE_IS_TERMINAL,
},
[TRANSFER_RECALLING] = {
.state_name = Recalling,


--

[svn-commits] dlee: branch dlee/ari-authn r392970 - in /team/dlee/ari-authn: ./ main/

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 11:38:50 2013
New Revision: 392970

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392970
Log:
Fixed configure script for Linux

Modified:
team/dlee/ari-authn/configure.ac
team/dlee/ari-authn/main/utils.c
team/dlee/ari-authn/makeopts.in

Modified: team/dlee/ari-authn/configure.ac
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/configure.ac?view=diffrev=392970r1=392969r2=392970
==
--- team/dlee/ari-authn/configure.ac (original)
+++ team/dlee/ari-authn/configure.ac Wed Jun 26 11:38:50 2013
@@ -2153,21 +2153,21 @@
 # * -lcrypt on *NIX
 # * in libsystem on OS X
 AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
-AC_CHECK_FUNCS([crypt], [SYSCRYPT=true], [SYSCRYPT=])
-
-if test x$LIBCRYPT != x ; then
+AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=])
+
+if test x$LIBCRYPT_LIB != x ; then
 CRYPT_LIB=$LIBCRYPT_LIB
+AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' 
function.])
 elif test x$SYSCRYPT != x ; then
 CRYPT_LIB=
+AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the `crypt' 
function.])
 fi
 
 AC_SUBST(CRYPT_LIB)
 
-# Check for crypt_r support
-save_LIBS=$LIBS
-LIBS=$CRYPT_LIB $LIBS
-AC_CHECK_FUNCS([crypt_r])
-LIBS=$save_LIBS
+# Find crypt_r support
+AC_CHECK_LIB([crypt], [crypt_r],
+[AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the `crypt_r' 
function.])])
 
 AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
 

Modified: team/dlee/ari-authn/main/utils.c
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/main/utils.c?view=diffrev=392970r1=392969r2=392970
==
--- team/dlee/ari-authn/main/utils.c (original)
+++ team/dlee/ari-authn/main/utils.c Wed Jun 26 11:38:50 2013
@@ -37,6 +37,9 @@
 #include sys/stat.h
 #include sys/syscall.h
 #include unistd.h
+#if defined(HAVE_CRYPT_R)
+#include crypt.h
+#endif
 #if defined(__APPLE__)
 #include mach/mach.h
 #elif defined(HAVE_SYS_THR_H)
@@ -2299,6 +2302,7 @@
 
 int ast_crypt_validate(const char *key, const char *expected)
 {
+   ast_log(LOG_WARNING, crypt() support not available; cannot validate 
password\n);
return 0;
 }
 

Modified: team/dlee/ari-authn/makeopts.in
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/makeopts.in?view=diffrev=392970r1=392969r2=392970
==
--- team/dlee/ari-authn/makeopts.in (original)
+++ team/dlee/ari-authn/makeopts.in Wed Jun 26 11:38:50 2013
@@ -281,7 +281,6 @@
 OPENSSL_INCLUDE=@OPENSSL_INCLUDE@
 OPENSSL_LIB=@OPENSSL_LIB@
 
-CRYPT_INCLUDE=@CRYPT_INCLUDE@
 CRYPT_LIB=@CRYPT_LIB@
 
 CRYPTO_INCLUDE=@CRYPTO_INCLUDE@


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] mmichelson: branch mmichelson/atxfer_features r392971 - /team/mmichelson/atxf...

2013-06-26 Thread SVN commits to the Digium repositories
Author: mmichelson
Date: Wed Jun 26 14:02:39 2013
New Revision: 392971

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392971
Log:
Add pull method for atxfer bridges.

This way, we can detect if the transfer target or the transferee
has hung up. With this in place, I tested the following scenarios:

1) Transfer target hangs up while ringing
2) Transfer target hangs up during consultation
3) Transferee hangs up during target ringing

I have not tested what happens when a transferee hangs up during
consultation because I'm not 100% sure how I'm going to handle it.


Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: 
http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diffrev=392971r1=392970r2=392971
==
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun 26 14:02:39 
2013
@@ -164,6 +164,19 @@
}
 
return ast_bridge_base_v_table.push(self, bridge_channel, swap);
+}
+
+static void bridge_basic_pull(struct ast_bridge *self, struct 
ast_bridge_channel *bridge_channel)
+{
+   struct bridge_basic_personality *personality = self-personality;
+
+   ast_assert(personality != NULL);
+
+   if (personality-v_table-pull) {
+   personality-v_table-pull(self, bridge_channel);
+   }
+
+   ast_bridge_base_v_table.pull(self, bridge_channel);
 }
 
 static void bridge_basic_destroy(struct ast_bridge *self)
@@ -638,6 +651,10 @@
case STIMULUS_TRANSFERER_ANSWER:
ast_assert(0);
case STIMULUS_TRANSFEREE_HANGUP:
+   /* We soft hangup the transferer to prevent him from sitting in
+* a bridge by himself after the transfer fails
+*/
+   ast_softhangup(props-transferer, AST_SOFTHANGUP_EXPLICIT);
return TRANSFER_FAIL;
case STIMULUS_DTMF_ATXFER_COMPLETE:
case STIMULUS_TRANSFERER_HANGUP:
@@ -669,8 +686,7 @@
 
 static int resume_enter(struct attended_transfer_properties *props)
 {
-   ast_bridge_basic_change_personality_normal(props-transferee_bridge);
-   return ast_bridge_destroy(props-target_bridge);
+   return 0;
 }
 
 static int threeway_enter(struct attended_transfer_properties *props)
@@ -762,6 +778,10 @@
case STIMULUS_TRANSFERER_ANSWER:
ast_assert(0);
case STIMULUS_TRANSFEREE_HANGUP:
+   /* We soft hangup the transferer to prevent him from sitting in
+* a bridge by himself after the transfer fails
+*/
+   ast_softhangup(props-transferer, AST_SOFTHANGUP_EXPLICIT);
return TRANSFER_FAIL;
case STIMULUS_TRANSFERER_HANGUP:
case STIMULUS_DTMF_ATXFER_COMPLETE:
@@ -1069,6 +1089,44 @@
return 0;
 }
 
+static void bridge_personality_atxfer_pull(struct ast_bridge *self, struct 
ast_bridge_channel *bridge_channel)
+{
+   struct bridge_basic_personality *personality = self-personality;
+   struct attended_transfer_properties *props = personality-pvt;
+
+   if (self-num_channels  1) {
+   return;
+   }
+
+   if (self-num_channels == 1) {
+   RAII_VAR(struct ast_bridge_channel *, 
transferer_bridge_channel, NULL, ao2_cleanup);
+
+   ast_channel_lock(props-transferer);
+   transferer_bridge_channel = 
ast_channel_get_bridge_channel(props-transferer);
+   ast_channel_unlock(props-transferer);
+
+   if (!transferer_bridge_channel) {
+   return;
+   }
+
+   if (AST_LIST_FIRST(self-channels) != 
transferer_bridge_channel) {
+   return;
+   }
+   }
+
+   /* Reaching this point means that either
+* 1) The bridge has no channels in it
+* 2) The bridge has one channel, and it's the transferer
+* In either case, it indicates that the non-transferer parties
+* are no longer in the bridge.
+*/
+   if (self == props-transferee_bridge) {
+   stimulate_attended_transfer(props, STIMULUS_TRANSFEREE_HANGUP);
+   } else {
+   stimulate_attended_transfer(props, STIMULUS_TARGET_HANGUP);
+   }
+}
+
 static enum attended_transfer_stimulus wait_for_stimulus(struct 
attended_transfer_properties *props)
 {
RAII_VAR(struct stimulus_list *, list, NULL, ast_free_ptr);
@@ -1338,6 +1396,7 @@
 
 void ast_bridge_basic_change_personality_normal(struct ast_bridge *bridge)
 {
+   struct ast_bridge_channel *bridge_channel;
struct bridge_basic_personality *personality;
SCOPED_LOCK(lock, bridge, ast_bridge_lock, ast_bridge_unlock);
 
@@ -1350,6 +1409,11 @@
ast_clear_flag(bridge-feature_flags, AST_FLAGS_ALL);
 

[svn-commits] rmudgett: trunk r392972 - /trunk/res/res_parking.c

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 14:15:23 2013
New Revision: 392972

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392972
Log:
Remove some redundant parking config error messages.

Modified:
trunk/res/res_parking.c

Modified: trunk/res/res_parking.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/res/res_parking.c?view=diffrev=392972r1=392971r2=392972
==
--- trunk/res/res_parking.c (original)
+++ trunk/res/res_parking.c Wed Jun 26 14:15:23 2013
@@ -527,13 +527,8 @@
break;
}
 
-   if (!parameter) {
-   ast_log(LOG_ERROR, Unable to handle option '%s'\n, var-name);
-   return -1;
-   }
-
-   if (parking_feature_flag_cfg(parameter, var-value)) {
-   ast_log(LOG_ERROR, '%s' is not a valid value for parking lot 
option '%s'\n, var-value, var-name);
+   ast_assert(parameter != NULL);
+   if (!parameter || parking_feature_flag_cfg(parameter, var-value)) {
return -1;
}
 


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] qwell: trunk r392987 - in /trunk: include/asterisk/ res/ res/stasis/ res/stas...

2013-06-26 Thread SVN commits to the Digium repositories
Author: qwell
Date: Wed Jun 26 14:29:57 2013
New Revision: 392987

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392987
Log:
ARI: Add support for continuing to a different location in dialplan.

This allows going elsewhere in the dialplan, so that the location can be
specified after exiting the Stasis application.

(closes issue ASTERISK-21870)

Review: https://reviewboard.asterisk.org/r/2644/

Modified:
trunk/include/asterisk/stasis_app.h
trunk/res/res_stasis_http_channels.c
trunk/res/stasis/control.c
trunk/res/stasis_http/resource_channels.c
trunk/res/stasis_http/resource_channels.h
trunk/rest-api/api-docs/channels.json

Modified: trunk/include/asterisk/stasis_app.h
URL: 
http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/stasis_app.h?view=diffrev=392987r1=392986r2=392987
==
--- trunk/include/asterisk/stasis_app.h (original)
+++ trunk/include/asterisk/stasis_app.h Wed Jun 26 14:29:57 2013
@@ -142,8 +142,14 @@
  * If the channel is no longer in \c res_stasis, this function does nothing.
  *
  * \param control Control for \c res_stasis
- */
-void stasis_app_control_continue(struct stasis_app_control *control);
+ * \param context An optional context to continue to
+ * \param extension An optional extension to continue to
+ * \param priority An optional priority to continue to
+ *
+ * \return 0 for success
+ * \return -1 for error.
+ */
+int stasis_app_control_continue(struct stasis_app_control *control, const char 
*context, const char *extension, int priority);
 
 /*!
  * \brief Answer the channel associated with this control.

Modified: trunk/res/res_stasis_http_channels.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/res/res_stasis_http_channels.c?view=diffrev=392987r1=392986r2=392987
==
--- trunk/res/res_stasis_http_channels.c (original)
+++ trunk/res/res_stasis_http_channels.c Wed Jun 26 14:29:57 2013
@@ -191,6 +191,18 @@
struct ast_continue_in_dialplan_args args = {};
struct ast_variable *i;
 
+   for (i = get_params; i; i = i-next) {
+   if (strcmp(i-name, context) == 0) {
+   args.context = (i-value);
+   } else
+   if (strcmp(i-name, extension) == 0) {
+   args.extension = (i-value);
+   } else
+   if (strcmp(i-name, priority) == 0) {
+   args.priority = atoi(i-value);
+   } else
+   {}
+   }
for (i = path_vars; i; i = i-next) {
if (strcmp(i-name, channelId) == 0) {
args.channel_id = (i-value);

Modified: trunk/res/stasis/control.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/res/stasis/control.c?view=diffrev=392987r1=392986r2=392987
==
--- trunk/res/stasis/control.c (original)
+++ trunk/res/stasis/control.c Wed Jun 26 14:29:57 2013
@@ -33,6 +33,7 @@
 #include control.h
 #include asterisk/bridging.h
 #include asterisk/bridging_features.h
+#include asterisk/pbx.h
 
 struct stasis_app_control {
/*! Queue of commands to dispatch on the channel */
@@ -91,17 +92,43 @@
return control-is_done;
 }
 
+struct stasis_app_control_continue_data {
+   char context[AST_MAX_CONTEXT];
+   char extension[AST_MAX_EXTENSION];
+   int priority;
+};
+
 static void *app_control_continue(struct stasis_app_control *control,
struct ast_channel *chan, void *data)
 {
+   RAII_VAR(struct stasis_app_control_continue_data *, continue_data, 
data, ast_free);
+
/* Called from stasis_app_exec thread; no lock needed */
+   ast_explicit_goto(control-channel, continue_data-context, 
continue_data-extension, continue_data-priority);
+
control-is_done = 1;
+
return NULL;
 }
 
-void stasis_app_control_continue(struct stasis_app_control *control)
-{
-   stasis_app_send_command_async(control, app_control_continue, NULL);
+int stasis_app_control_continue(struct stasis_app_control *control, const char 
*context, const char *extension, int priority)
+{
+   struct stasis_app_control_continue_data *continue_data;
+
+   if (!(continue_data = ast_calloc(1, sizeof(*continue_data {
+   return -1;
+   }
+   ast_copy_string(continue_data-context, S_OR(context, ), 
sizeof(continue_data-context));
+   ast_copy_string(continue_data-extension, S_OR(extension, ), 
sizeof(continue_data-extension));
+   if (priority  0) {
+   continue_data-priority = priority;
+   } else {
+   continue_data-priority = -1;
+   }
+
+   stasis_app_send_command_async(control, app_control_continue, 
continue_data);
+
+   return 0;
 }
 
 struct ast_channel_snapshot *stasis_app_control_get_snapshot(

Modified: 

[svn-commits] dlee: branch dlee/ari-authn r392988 - /team/dlee/ari-authn/configure

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 15:01:45 2013
New Revision: 392988

URL: http://svnview.digium.com/svn/asterisk?view=revrev=392988
Log:
Regen configure script

Modified:
team/dlee/ari-authn/configure


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] qwell: branch qwell/ari_channel_hold r393003 - /team/qwell/ari_channel_hold/

2013-06-26 Thread SVN commits to the Digium repositories
Author: qwell
Date: Wed Jun 26 15:57:27 2013
New Revision: 393003

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393003
Log:
Create branch to implement hold/unhold over ARI.

Added:
team/qwell/ari_channel_hold/
  - copied from r393002, trunk/


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] qwell: branch qwell/ari_channel_hold r393004 - /team/qwell/ari_channel_hold/

2013-06-26 Thread SVN commits to the Digium repositories
Author: qwell
Date: Wed Jun 26 15:58:03 2013
New Revision: 393004

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393004
Log:
init merge, automerge

Modified:
team/qwell/ari_channel_hold/   (props changed)

Propchange: team/qwell/ari_channel_hold/
--
automerge = *

Propchange: team/qwell/ari_channel_hold/
--
automerge-email = jpar...@digium.com

Propchange: team/qwell/ari_channel_hold/
--
svnmerge-integrated = /trunk:1-393002


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] jrose: trunk r393005 - in /trunk: funcs/ include/asterisk/ main/

2013-06-26 Thread SVN commits to the Digium repositories
Author: jrose
Date: Wed Jun 26 15:59:14 2013
New Revision: 393005

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393005
Log:
func_channel: Read/Write after_bridge_goto option

Allows reading and setting of a channel's after_bridge_goto datastore

(closes issue ASTERISK-21875)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2628/

Modified:
trunk/funcs/func_channel.c
trunk/include/asterisk/bridging.h
trunk/main/bridging.c

Modified: trunk/funcs/func_channel.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/funcs/func_channel.c?view=diffrev=393005r1=393004r2=393005
==
--- trunk/funcs/func_channel.c (original)
+++ trunk/funcs/func_channel.c Wed Jun 26 15:59:14 2013
@@ -37,6 +37,7 @@
 
 #include asterisk/module.h
 #include asterisk/channel.h
+#include asterisk/bridging.h
 #include asterisk/pbx.h
 #include asterisk/utils.h
 #include asterisk/app.h
@@ -118,6 +119,12 @@
enum name=checkhangup
paraR/O Whether the channel 
is hanging up (1/0)/para
/enum
+   enum name=after_bridge_goto
+   paraR/W the parseable goto 
string indicating where the channel is
+   expected to return to in the 
PBX after exiting the next bridge it joins
+   on the condition that it 
doesn't hang up. The parseable goto string uses
+   the same syntax as the 
literalGoto/literal application./para
+   /enum
enum name=hangup_handler_pop
paraW/O Replace the most 
recently added hangup handler
with a new hangup handler on 
the channel if supplied.  The
@@ -475,6 +482,8 @@
struct ast_str *tmp_str = ast_str_alloca(1024);
 
locked_copy_string(chan, buf,  ast_print_namedgroups(tmp_str, 
ast_channel_named_pickupgroups(chan)), len);
+   } else if (!strcasecmp(data, after_bridge_goto)) {
+   ast_after_bridge_goto_read(chan, buf, len);
} else if (!strcasecmp(data, amaflags)) {
ast_channel_lock(chan);
snprintf(buf, len, %d, ast_channel_amaflags(chan));
@@ -516,7 +525,13 @@
locked_string_field_set(chan, accountcode, value);
else if (!strcasecmp(data, userfield))
locked_string_field_set(chan, userfield, value);
-   else if (!strcasecmp(data, amaflags)) {
+   else if (!strcasecmp(data, after_bridge_goto)) {
+   if (ast_strlen_zero(value)) {
+   ast_after_bridge_goto_discard(chan);
+   } else {
+   ast_after_bridge_set_go_on(chan, 
ast_channel_context(chan), ast_channel_exten(chan), ast_channel_priority(chan), 
value);
+   }
+   } else if (!strcasecmp(data, amaflags)) {
ast_channel_lock(chan);
if (isdigit(*value)) {
int amaflags;

Modified: trunk/include/asterisk/bridging.h
URL: 
http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/bridging.h?view=diffrev=393005r1=393004r2=393005
==
--- trunk/include/asterisk/bridging.h (original)
+++ trunk/include/asterisk/bridging.h Wed Jun 26 15:59:14 2013
@@ -1634,6 +1634,16 @@
  */
 void ast_after_bridge_goto_discard(struct ast_channel *chan);
 
+/*!
+ * \brief Read after bridge goto if it exists
+ * \since 12.0.0
+ *
+ * \param chan Channel to read the after bridge goto parseable goto string from
+ * \param buffer Buffer to write the after bridge goto data to
+ * \param buf_size size of the buffer being written to
+ */
+void ast_after_bridge_goto_read(struct ast_channel *chan, char *buffer, size_t 
buf_size);
+
 /*! Reason the the after bridge callback will not be called. */
 enum ast_after_bridge_cb_reason {
/*! The datastore is being destroyed.  Likely due to hangup. */

Modified: trunk/main/bridging.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/main/bridging.c?view=diffrev=393005r1=393004r2=393005
==
--- trunk/main/bridging.c (original)
+++ trunk/main/bridging.c Wed Jun 26 15:59:14 2013
@@ -3414,6 +3414,47 @@
}
 }
 
+void ast_after_bridge_goto_read(struct ast_channel *chan, char *buffer, size_t 
buf_size)
+{
+   struct ast_datastore *datastore;
+   struct after_bridge_goto_ds *after_bridge;
+   char *current_pos = buffer;
+   size_t remaining_size = buf_size;
+
+   SCOPED_CHANNELLOCK(lock, chan);
+
+   datastore = 

[svn-commits] qwell: branch qwell/ari_channel_hold r393011 - in /team/qwell/ari_channel_hol...

2013-06-26 Thread SVN commits to the Digium repositories
Author: qwell
Date: Wed Jun 26 16:19:34 2013
New Revision: 393011

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393011
Log:
Add hold/unhold support.  Maybe.  I suspect something is missing.

Modified:
team/qwell/ari_channel_hold/include/asterisk/stasis_app.h
team/qwell/ari_channel_hold/res/stasis/control.c
team/qwell/ari_channel_hold/res/stasis_http/resource_channels.c

Modified: team/qwell/ari_channel_hold/include/asterisk/stasis_app.h
URL: 
http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_hold/include/asterisk/stasis_app.h?view=diffrev=393011r1=393010r2=393011
==
--- team/qwell/ari_channel_hold/include/asterisk/stasis_app.h (original)
+++ team/qwell/ari_channel_hold/include/asterisk/stasis_app.h Wed Jun 26 
16:19:34 2013
@@ -160,6 +160,18 @@
 int stasis_app_control_answer(struct stasis_app_control *control);
 
 /*!
+ * \brief Place the channel associated with the control on hold.
+ * \param control Control for \c res_stasis.
+ */
+void stasis_app_control_hold(struct stasis_app_control *control);
+
+/*!
+ * \brief Remove the channel associated with the control from hold.
+ * \param control Control for \c res_stasis.
+ */
+void stasis_app_control_unhold(struct stasis_app_control *control);
+
+/*!
  * \brief Returns the most recent snapshot for the associated channel.
  *
  * The returned pointer is AO2 managed, so ao2_cleanup() when you're done.

Modified: team/qwell/ari_channel_hold/res/stasis/control.c
URL: 
http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_hold/res/stasis/control.c?view=diffrev=393011r1=393010r2=393011
==
--- team/qwell/ari_channel_hold/res/stasis/control.c (original)
+++ team/qwell/ari_channel_hold/res/stasis/control.c Wed Jun 26 16:19:34 2013
@@ -131,6 +131,32 @@
return 0;
 }
 
+static void *app_control_hold(struct stasis_app_control *control,
+   struct ast_channel *chan, void *data)
+{
+   ast_indicate(control-channel, AST_CONTROL_HOLD);
+
+   return NULL;
+}
+
+void stasis_app_control_hold(struct stasis_app_control *control)
+{
+   stasis_app_send_command_async(control, app_control_hold, NULL);
+}
+
+static void *app_control_unhold(struct stasis_app_control *control,
+   struct ast_channel *chan, void *data)
+{
+   ast_indicate(control-channel, AST_CONTROL_UNHOLD);
+
+   return NULL;
+}
+
+void stasis_app_control_unhold(struct stasis_app_control *control)
+{
+   stasis_app_send_command_async(control, app_control_unhold, NULL);
+}
+
 struct ast_channel_snapshot *stasis_app_control_get_snapshot(
const struct stasis_app_control *control)
 {

Modified: team/qwell/ari_channel_hold/res/stasis_http/resource_channels.c
URL: 
http://svnview.digium.com/svn/asterisk/team/qwell/ari_channel_hold/res/stasis_http/resource_channels.c?view=diffrev=393011r1=393010r2=393011
==
--- team/qwell/ari_channel_hold/res/stasis_http/resource_channels.c (original)
+++ team/qwell/ari_channel_hold/res/stasis_http/resource_channels.c Wed Jun 26 
16:19:34 2013
@@ -136,11 +136,32 @@
 }
 void stasis_http_hold_channel(struct ast_variable *headers, struct 
ast_hold_channel_args *args, struct stasis_http_response *response)
 {
-   ast_log(LOG_ERROR, TODO: stasis_http_hold_channel\n);
-}
+   RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+   control = find_control(response, args-channel_id);
+   if (control == NULL) {
+   /* Response filled in by find_control */
+   return;
+   }
+
+   stasis_app_control_hold(control);
+
+   stasis_http_response_no_content(response);
+}
+
 void stasis_http_unhold_channel(struct ast_variable *headers, struct 
ast_unhold_channel_args *args, struct stasis_http_response *response)
 {
-   ast_log(LOG_ERROR, TODO: stasis_http_unhold_channel\n);
+   RAII_VAR(struct stasis_app_control *, control, NULL, ao2_cleanup);
+
+   control = find_control(response, args-channel_id);
+   if (control == NULL) {
+   /* Response filled in by find_control */
+   return;
+   }
+
+   stasis_app_control_unhold(control);
+
+   stasis_http_response_no_content(response);
 }
 
 void stasis_http_play_on_channel(struct ast_variable *headers,


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] kmoore: branch kmoore/cel_cleanup r393022 - in /team/kmoore/cel_cleanup: main...

2013-06-26 Thread SVN commits to the Digium repositories
Author: kmoore
Date: Wed Jun 26 16:39:32 2013
New Revision: 393022

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393022
Log:
Add CEL unit tests and cleanup CEL inner workings

Added:
team/kmoore/cel_cleanup/tests/test_cel.c   (with props)
Modified:
team/kmoore/cel_cleanup/main/cel.c

Modified: team/kmoore/cel_cleanup/main/cel.c
URL: 
http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/main/cel.c?view=diffrev=393022r1=393021r2=393022
==
--- team/kmoore/cel_cleanup/main/cel.c (original)
+++ team/kmoore/cel_cleanup/main/cel.c Wed Jun 26 16:39:32 2013
@@ -637,7 +637,6 @@
const char *extra, const char *peer_name)
 {
struct timeval eventtime = ast_tvnow();
-   ast_log(LOG_ERROR, Creating %d event with extra: %s\n, event_type, 
S_OR(extra, ));
return ast_event_new(AST_EVENT_CEL,
AST_EVENT_IE_CEL_EVENT_TYPE, AST_EVENT_IE_PLTYPE_UINT, 
event_type,
AST_EVENT_IE_CEL_EVENT_TIME, AST_EVENT_IE_PLTYPE_UINT, 
eventtime.tv_sec,
@@ -1211,12 +1210,9 @@
cel_channel_monitors[i](old_snapshot, new_snapshot);
}
} else if (ast_bridge_snapshot_type() == update-type) {
-   RAII_VAR(struct bridge_assoc *, assoc, NULL, ao2_cleanup);
struct ast_bridge_snapshot *old_snapshot;
struct ast_bridge_snapshot *new_snapshot;
 
-   update = stasis_message_data(message);
-
old_snapshot = stasis_message_data(update-old_snapshot);
new_snapshot = stasis_message_data(update-new_snapshot);
 
@@ -1226,62 +1222,6 @@
 
if (!new_snapshot) {
clear_bridge_primary(old_snapshot-uniqueid);
-   return;
-   }
-
-   if (old_snapshot-capabilities == new_snapshot-capabilities) {
-   return;
-   }
-
-   /* handle 1:1/native - multimix */
-   if ((old_snapshot-capabilities  
(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE))
-(new_snapshot-capabilities  
AST_BRIDGE_CAPABILITY_MULTIMIX)) {
-   assoc = 
find_bridge_primary_by_bridge_id(new_snapshot-uniqueid);
-   if (!assoc) {
-   ast_log(LOG_ERROR, No association found for 
bridge %s\n, new_snapshot-uniqueid);
-   return;
-   }
-
-   /* this bridge will no longer be treated like a bridge, 
so mark the bridge_assoc as such */
-   assoc-track_as_conf = 1;
-   report_event_snapshot(assoc-primary_snapshot, 
AST_CEL_BRIDGE_TO_CONF, NULL, NULL, assoc-secondary_name);
-   return;
-   }
-
-   /* handle multimix - 1:1/native */
-   if ((old_snapshot-capabilities  
AST_BRIDGE_CAPABILITY_MULTIMIX)
-(new_snapshot-capabilities  
(AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE))) {
-   struct ao2_iterator i;
-   RAII_VAR(char *, channel_id, NULL, ao2_cleanup);
-   RAII_VAR(struct ast_channel_snapshot *, chan_snapshot, 
NULL, ao2_cleanup);
-
-   assoc = 
find_bridge_primary_by_bridge_id(new_snapshot-uniqueid);
-   if (assoc) {
-   assoc-track_as_conf = 1;
-   return;
-   }
-
-   /* get the first item in the container */
-   i = ao2_iterator_init(new_snapshot-channels, 0);
-   while ((channel_id = ao2_iterator_next(i))) {
-   break;
-   }
-   ao2_iterator_destroy(i);
-
-   /* create a bridge_assoc for this bridge and mark it as 
being tracked appropriately */
-   chan_snapshot = 
ast_channel_snapshot_get_latest(channel_id);
-   if (!chan_snapshot) {
-   return;
-   }
-
-   ast_assert(chan_snapshot != NULL);
-   assoc = bridge_assoc_alloc(chan_snapshot, 
new_snapshot-uniqueid, chan_snapshot-name);
-   if (!assoc) {
-   return;
-   }
-   assoc-track_as_conf = 1;
-
-   ao2_link(bridge_primaries, assoc);
return;
}
}
@@ -1295,9 +1235,9 @@
struct ast_bridge_blob *blob = stasis_message_data(message);
struct ast_bridge_snapshot *snapshot = blob-bridge;
struct ast_channel_snapshot *chan_snapshot = blob-channel;
+   RAII_VAR(struct bridge_assoc *, assoc, 

[svn-commits] rmudgett: branch rmudgett/bridge_phase r393023 - /team/rmudgett/bridge_phase/...

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 16:57:43 2013
New Revision: 393023

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393023
Log:
Fill in AgentRequest and more.

Modified:
team/rmudgett/bridge_phase/apps/app_agent_pool.c

Modified: team/rmudgett/bridge_phase/apps/app_agent_pool.c
URL: 
http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_agent_pool.c?view=diffrev=393023r1=393022r2=393023
==
--- team/rmudgett/bridge_phase/apps/app_agent_pool.c (original)
+++ team/rmudgett/bridge_phase/apps/app_agent_pool.c Wed Jun 26 16:57:43 2013
@@ -66,12 +66,20 @@
/parameter
/syntax
description
-   paraLogin an agent to the system.  Any agent 
authentication is assumed to
-   already be done by dialplan.  If the agent is already 
logged in, the
-   application will continue in the dialplan with 
variableAGENT_STATUS/variable set
-   to literalALREADY_LOGGED_IN/literal.
-   While logged in, the agent can receive calls and will 
hear a literalbeep/literal
-   when a new call comes in./para
+   para
+   Login an agent to the system.  Any agent 
authentication is assumed to
+   already be done by dialplan.  While logged in, 
the agent can receive calls
+   and will hear a configurable 
literalbeep/literal sound when a new call
+   comes in for the agent.  Login failures will 
continue in the dialplan
+   with AGENT_STATUS set.
+   /para
+   para
+   AGENT_STATUS enumeration values:
+   /para
+   enumlist
+   enum name = NOT_EXISTparaThe specified 
agent is invalid./para/enum
+   enum name = ALREADY_LOGGED_INparaThe 
agent is already logged in./para/enum
+   /enumlist
/description
see-also
ref type=applicationAuthenticate/ref
@@ -92,10 +100,21 @@
/synopsis
syntax argsep=,
parameter name=AgentId required=true /
-   parameter name=timeout
-   paraSpecifies the number of seconds to wait 
for an available agent./para
-   /parameter
/syntax
+   description
+   para
+   Request an agent to connect with the channel.
+   /para
+   para
+   AGENT_STATUS enumeration values for this 
application when it continues
+   in the dialplan:
+   /para
+   enumlist
+   enum name = NOT_EXISTparaThe specified 
agent is invalid./para/enum
+   enum name = NOT_LOGGED_INparaThe agent is 
not available./para/enum
+   enum name = BUSYparaThe agent is on 
another call./para/enum
+   /enumlist
+   /description
see-also
ref type=applicationAgentLogin/ref
/see-also
@@ -195,6 +214,9 @@
 
 #define AST_MAX_BUF256
 
+/*! Maximum wait time (in ms) for the custom_beep file to play announcing the 
caller. */
+#define CALLER_SAFETY_TIMEOUT_TIME (2 * 60 * 1000)
+
 static const char app_agent_login[] = AgentLogin;
 static const char app_agent_request[] = AgentRequest;
 
@@ -447,7 +469,7 @@
return -1;
}
 
-   ast_string_field_set(cfg, beep_sound, );
+   ast_string_field_set(cfg, beep_sound, var-value);
return 0;
 }
 
@@ -473,7 +495,7 @@
aco_option_register(cfg_info, recordformat, ACO_EXACT, agent_types, 
wav, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, record_format));
aco_option_register_custom(cfg_info, savecallsin, ACO_EXACT, 
agent_types, , agent_savecallsin_handler, 0);
aco_option_register_custom(cfg_info, custom_beep, ACO_EXACT, 
agent_types, beep, agent_custom_beep_handler, 0);
-   aco_option_register(cfg_info, fullname, ACO_EXACT, agent_types, , 
OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, full_name));
+   aco_option_register(cfg_info, fullname, ACO_EXACT, agent_types, 
NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, full_name));
 
if (aco_process_config(cfg_info, 0) == ACO_PROCESS_ERROR) {
goto error;
@@ -910,6 +932,7 @@
 {
 // struct agent_pvt *agent = hook_pvt;
 
+   /* Connect to caller now. */
/*! \todo BUGBUG bridge_agent_hold_ack() not written 

[svn-commits] kmoore: branch kmoore/cel_cleanup r393024 - in /team/kmoore/cel_cleanup: incl...

2013-06-26 Thread SVN commits to the Digium repositories
Author: kmoore
Date: Wed Jun 26 16:57:59 2013
New Revision: 393024

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393024
Log:
Do some naming cleanup

Modified:
team/kmoore/cel_cleanup/include/asterisk/cel.h
team/kmoore/cel_cleanup/main/cel.c
team/kmoore/cel_cleanup/tests/test_cel.c

Modified: team/kmoore/cel_cleanup/include/asterisk/cel.h
URL: 
http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/include/asterisk/cel.h?view=diffrev=393024r1=393023r2=393024
==
--- team/kmoore/cel_cleanup/include/asterisk/cel.h (original)
+++ team/kmoore/cel_cleanup/include/asterisk/cel.h Wed Jun 26 16:57:59 2013
@@ -264,7 +264,7 @@
 struct stasis_topic *ast_cel_topic(void);
 
 /*! \brief A structure to hold CEL global configuration options */
-struct ast_cel_config {
+struct ast_cel_general_config {
AST_DECLARE_STRING_FIELDS(
AST_STRING_FIELD(date_format); /*! The desired date format for 
logging */
);
@@ -279,7 +279,7 @@
  * \retval NULL on error
  * \retval The new CEL configuration object
  */
-void *ast_cel_config_alloc(void);
+void *ast_cel_general_config_alloc(void);
 
 /*!
  * \since 12
@@ -291,7 +291,7 @@
  * \retval NULL on error
  * \retval The current CEL configuration
  */
-struct ast_cel_config *ast_cel_get_config(void);
+struct ast_cel_general_config *ast_cel_get_config(void);
 
 /*!
  * \since 12
@@ -299,7 +299,7 @@
  *
  * \param config The new CEL configuration
  */
-void ast_cel_set_config(struct ast_cel_config *config);
+void ast_cel_set_config(struct ast_cel_general_config *config);
 
 struct ast_channel_snapshot;
 /*!

Modified: team/kmoore/cel_cleanup/main/cel.c
URL: 
http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/main/cel.c?view=diffrev=393024r1=393023r2=393024
==
--- team/kmoore/cel_cleanup/main/cel.c (original)
+++ team/kmoore/cel_cleanup/main/cel.c Wed Jun 26 16:57:59 2013
@@ -181,19 +181,19 @@
 static struct ao2_container *linkedids;
 
 /*! \brief Destructor for cel_config */
-static void ast_cel_config_dtor(void *obj)
-{
-   struct ast_cel_config *cfg = obj;
+static void cel_general_config_dtor(void *obj)
+{
+   struct ast_cel_general_config *cfg = obj;
ast_string_field_free_memory(cfg);
ao2_cleanup(cfg-apps);
cfg-apps = NULL;
 }
 
-void *ast_cel_config_alloc(void)
-{
-   RAII_VAR(struct ast_cel_config *, cfg, NULL, ao2_cleanup);
-
-   if (!(cfg = ao2_alloc(sizeof(*cfg), ast_cel_config_dtor))) {
+void *ast_cel_general_config_alloc(void)
+{
+   RAII_VAR(struct ast_cel_general_config *, cfg, NULL, ao2_cleanup);
+
+   if (!(cfg = ao2_alloc(sizeof(*cfg), cel_general_config_dtor))) {
return NULL;
}
 
@@ -211,7 +211,7 @@
 
 /*! \brief A container that holds all config-related information */
 struct cel_config {
-   struct ast_cel_config *general;
+   struct ast_cel_general_config *general;
 };
 
 
@@ -233,7 +233,7 @@
return NULL;
}
 
-   if (!(cfg-general = ast_cel_config_alloc())) {
+   if (!(cfg-general = ast_cel_general_config_alloc())) {
return NULL;
}
 
@@ -241,7 +241,7 @@
return cfg;
 }
 
-/*! \brief An aco_type structure to link the general category to the 
ast_cel_config type */
+/*! \brief An aco_type structure to link the general category to the 
ast_cel_general_config type */
 static struct aco_type general_option = {
.type = ACO_GLOBAL,
.name = general,
@@ -549,7 +549,7 @@
 
 static int events_handler(const struct aco_option *opt, struct ast_variable 
*var, void *obj)
 {
-   struct ast_cel_config *cfg = obj;
+   struct ast_cel_general_config *cfg = obj;
char *events = ast_strdupa(var-value);
char *cur_event;
 
@@ -579,7 +579,7 @@
 
 static int apps_handler(const struct aco_option *opt, struct ast_variable 
*var, void *obj)
 {
-   struct ast_cel_config *cfg = obj;
+   struct ast_cel_general_config *cfg = obj;
char *apps = ast_strdupa(var-value);
char *cur_app;
 
@@ -1537,8 +1537,8 @@
return -1;
}
 
-   aco_option_register(cel_cfg_info, enable, ACO_EXACT, 
general_options, no, OPT_BOOL_T, 1, FLDSET(struct ast_cel_config, enable));
-   aco_option_register(cel_cfg_info, dateformat, ACO_EXACT, 
general_options, , OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_cel_config, 
date_format));
+   aco_option_register(cel_cfg_info, enable, ACO_EXACT, 
general_options, no, OPT_BOOL_T, 1, FLDSET(struct ast_cel_general_config, 
enable));
+   aco_option_register(cel_cfg_info, dateformat, ACO_EXACT, 
general_options, , OPT_STRINGFIELD_T, 0, STRFLDSET(struct 
ast_cel_general_config, date_format));
aco_option_register_custom(cel_cfg_info, apps, ACO_EXACT, 
general_options, , apps_handler, 0);

[svn-commits] dlee: branch dlee/ari-authn r393025 - in /team/dlee/ari-authn: include/asteri...

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 17:02:18 2013
New Revision: 393025

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393025
Log:
Added mkpasswd command

Modified:
team/dlee/ari-authn/include/asterisk/utils.h
team/dlee/ari-authn/main/utils.c
team/dlee/ari-authn/res/stasis_http/cli.c
team/dlee/ari-authn/tests/test_utils.c

Modified: team/dlee/ari-authn/include/asterisk/utils.h
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/include/asterisk/utils.h?view=diffrev=393025r1=393024r2=393025
==
--- team/dlee/ari-authn/include/asterisk/utils.h (original)
+++ team/dlee/ari-authn/include/asterisk/utils.h Wed Jun 26 17:02:18 2013
@@ -938,10 +938,28 @@
 void _dtor_ ## varname (vartype * v) { dtor(*v); } \
 vartype varname __attribute__((cleanup(_dtor_ ## varname))) = (initval)
 
+/*!
+ * \brief Asterisk wrapper around crypt(3).
+ *
+ * The interpretation of the salt (which determines the password hashing
+ * algorithm) is system specific. Application code should prefer to use
+ * ast_crypt_encrypt() or ast_crypt_validate().
+ *
+ * The returned string is heap allocated, and should be freed with ast_free().
+ *
+ * \param key User's password to crypt.
+ * \param salt Salt to crypt with.
+ * \return Crypted password.
+ * \return \c NULL on error.
+ */
+char *ast_crypt(const char *key, const char *salt);
+
 /*
  * \brief Asterisk wrapper around crypt(3) for encrypting passwords.
  *
  * This function will generate a random salt and encrypt the given password.
+ *
+ * The returned string is heap allocated, and should be freed with ast_free().
  *
  * \param key User's password to crypt.
  * \return Crypted password.
@@ -954,8 +972,8 @@
  *
  * \param key User's password to validate.
  * \param expected Expected result from crypt.
- * \return True (non-zero) if key matches crypted.
- * \return False (zero) if key doesn't match.
+ * \return True (non-zero) if \a key matches \a expected.
+ * \return False (zero) if \a key doesn't match.
  */
 int ast_crypt_validate(const char *key, const char *expected);
 

Modified: team/dlee/ari-authn/main/utils.c
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/main/utils.c?view=diffrev=393025r1=393024r2=393025
==
--- team/dlee/ari-authn/main/utils.c (original)
+++ team/dlee/ari-authn/main/utils.c Wed Jun 26 17:02:18 2013
@@ -2273,12 +2273,101 @@
return ret;
 }
 
-char *ast_crypt_encrypt(const char *key)
-{
-   return NULL;
+/*!
+ * \brief Max length of a salt string.
+ *
+ * $[1,5,6]$[a–zA–Z0–9./]{1,16}$, plus null terminator
+ */
+#define MAX_SALT_LEN 21
+
+static char salt_chars[] =
+   abcdefghijklmnopqrstuvwxyz
+   ABCDEFGHIJKLMNOPQRSTUVWXYZ
+   0123456789
+   ./;
+
+/*! Randomly select a character for a salt string */
+static char gen_salt_char(void)
+{
+   return salt_chars[ast_random() % ARRAY_LEN(salt_chars)];
+}
+
+/*!
+ * \brief Generates a salt to try with crypt.
+ *
+ * If given an empty string, will generate a salt for the most secure algorithm
+ * to try with crypt(). If given a previously generated salt, the algorithm 
will
+ * be lowered by one level of security.
+ *
+ * \param[out] current_salt Output string in which to generate the salt.
+ *  This can be an empty string, or the results of a
+ *  prior gen_salt call.
+ * \param max_len Length of \a current_salt.
+ * \return 0 on success.
+ * \return Non-zero on error.
+ */
+static int gen_salt(char *current_salt, size_t maxlen)
+{
+   int i;
+   if (maxlen  MAX_SALT_LEN || current_salt == NULL) {
+   return -1;
+   }
+
+   switch (current_salt[0]) {
+   case '\0':
+   /* Initial generation; $6$ = SHA-512 */
+   *current_salt++ = '$';
+   *current_salt++ = '6';
+   *current_salt++ = '$';
+   for (i = 0; i  16; ++i) {
+   *current_salt++ = gen_salt_char();
+   }
+   *current_salt++ = '$';
+   *current_salt++ = '\0';
+   return 0;
+   case '$':
+   switch (current_salt[1]) {
+   case '6':
+   /* Downgrade to SHA-256 */
+   current_salt[1] = '5';
+   return 0;
+   case '5':
+   /* Downgrade to MD5 */
+   current_salt[1] = '1';
+   return 0;
+   case '1':
+   /* Downgrade to traditional crypt */
+   *current_salt++ = gen_salt_char();
+   *current_salt++ = gen_salt_char();
+   *current_salt++ = '\0';
+   return 0;
+   default:
+   /* Unrecognized algorithm */
+  

[svn-commits] kmoore: branch kmoore/cel_cleanup r393026 - /team/kmoore/cel_cleanup/tests/

2013-06-26 Thread SVN commits to the Digium repositories
Author: kmoore
Date: Wed Jun 26 17:08:28 2013
New Revision: 393026

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393026
Log:
Clean up some white space

Modified:
team/kmoore/cel_cleanup/tests/test_cel.c

Modified: team/kmoore/cel_cleanup/tests/test_cel.c
URL: 
http://svnview.digium.com/svn/asterisk/team/kmoore/cel_cleanup/tests/test_cel.c?view=diffrev=393026r1=393025r2=393026
==
--- team/kmoore/cel_cleanup/tests/test_cel.c (original)
+++ team/kmoore/cel_cleanup/tests/test_cel.c Wed Jun 26 17:08:28 2013
@@ -1323,7 +1323,7 @@
.tv_sec = start.tv_sec + 30,
.tv_nsec = start.tv_usec * 1000
};
-   
+
SCOPED_MUTEX(lock, sync_lock);
ast_cond_timedwait(sync_out, sync_lock, end);
}


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] rmudgett: branch rmudgett/bridge_phase r393028 - /team/rmudgett/bridge_phase/...

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 17:33:21 2013
New Revision: 393028

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393028
Log:
Update agent documentation some more.

Modified:
team/rmudgett/bridge_phase/apps/app_agent_pool.c

Modified: team/rmudgett/bridge_phase/apps/app_agent_pool.c
URL: 
http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_agent_pool.c?view=diffrev=393028r1=393027r2=393028
==
--- team/rmudgett/bridge_phase/apps/app_agent_pool.c (original)
+++ team/rmudgett/bridge_phase/apps/app_agent_pool.c Wed Jun 26 17:33:21 2013
@@ -49,6 +49,7 @@
 #include asterisk/stringfields.h
 #include asterisk/stasis_channels.h
 
+/* BUGBUG Need config framework option documentation. */
 /*** DOCUMENTATION
application name=AgentLogin language=en_US
synopsis
@@ -66,18 +67,14 @@
/parameter
/syntax
description
-   para
-   Login an agent to the system.  Any agent 
authentication is assumed to
-   already be done by dialplan.  While logged in, 
the agent can receive calls
-   and will hear a configurable 
literalbeep/literal sound when a new call
-   comes in for the agent.  Login failures will 
continue in the dialplan
-   with AGENT_STATUS set.
-   /para
-   para
-   AGENT_STATUS enumeration values:
-   /para
+   paraLogin an agent to the system.  Any agent 
authentication is assumed to
+   already be done by dialplan.  While logged in, the 
agent can receive calls
+   and will hear a configurable literalbeep/literal 
sound when a new call
+   comes in for the agent.  Login failures will continue 
in the dialplan
+   with AGENT_STATUS set./para
+   paraAGENT_STATUS enumeration values:/para
enumlist
-   enum name = NOT_EXISTparaThe specified 
agent is invalid./para/enum
+   enum name = INVALIDparaThe specified 
agent is invalid./para/enum
enum name = ALREADY_LOGGED_INparaThe 
agent is already logged in./para/enum
/enumlist
/description
@@ -102,17 +99,14 @@
parameter name=AgentId required=true /
/syntax
description
-   para
-   Request an agent to connect with the channel.
-   /para
-   para
-   AGENT_STATUS enumeration values for this 
application when it continues
-   in the dialplan:
-   /para
+   paraRequest an agent to connect with the channel.  
Failure to find and
+   alert an agent will continue in the dialplan with 
AGENT_STATUS set./para
+   paraAGENT_STATUS enumeration values:/para
enumlist
-   enum name = NOT_EXISTparaThe specified 
agent is invalid./para/enum
+   enum name = INVALIDparaThe specified 
agent is invalid./para/enum
enum name = NOT_LOGGED_INparaThe agent is 
not available./para/enum
enum name = BUSYparaThe agent is on 
another call./para/enum
+   enum name = ERRORparaAlerting the agent 
failed./para/enum
/enumlist
/description
see-also
@@ -1607,7 +1601,7 @@
agent = ao2_find(agents, args.agent_id, OBJ_KEY);
if (!agent) {
ast_verb(3, Agent '%s' does not exist.\n, args.agent_id);
-   pbx_builtin_setvar_helper(chan, AGENT_STATUS, NOT_EXIST);
+   pbx_builtin_setvar_helper(chan, AGENT_STATUS, INVALID);
return 0;
}
 
@@ -1808,7 +1802,7 @@
agent = ao2_find(agents, args.agent_id, OBJ_KEY);
if (!agent) {
ast_verb(3, Agent '%s' does not exist.\n, args.agent_id);
-   pbx_builtin_setvar_helper(chan, AGENT_STATUS, NOT_EXIST);
+   pbx_builtin_setvar_helper(chan, AGENT_STATUS, INVALID);
return 0;
}
 


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] mmichelson: branch mmichelson/atxfer_features r393029 - /team/mmichelson/atxf...

2013-06-26 Thread SVN commits to the Digium repositories
Author: mmichelson
Date: Wed Jun 26 18:14:37 2013
New Revision: 393029

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393029
Log:
Progress on the recall logic for atxferdropcall=no.

Here's what works so far:
* Blond Transfer
* Recalling Transferer if call to target times out

Here's what doesn't work as well:
* Detecting target hangup during blond transfer
* Recalling target if transferer times out or rejects call

I've encountered a bizarre race condition a couple of times during
testing where when I attempt a blond transfer, the hangup hook on
the transferer channel triggers twice and a crash occurs in bridge_softmix.
This is strange for two reasons:

1) I only hung up once
2) There should never have been any involvement from bridge_softmix at all.


Modified:
team/mmichelson/atxfer_features/main/bridging_basic.c

Modified: team/mmichelson/atxfer_features/main/bridging_basic.c
URL: 
http://svnview.digium.com/svn/asterisk/team/mmichelson/atxfer_features/main/bridging_basic.c?view=diffrev=393029r1=393028r2=393029
==
--- team/mmichelson/atxfer_features/main/bridging_basic.c (original)
+++ team/mmichelson/atxfer_features/main/bridging_basic.c Wed Jun 26 18:14:37 
2013
@@ -43,6 +43,7 @@
 #include asterisk/file.h
 #include asterisk/app.h
 #include asterisk/bridging_private.h
+#include asterisk/dial.h
 
 #define NORMAL_FLAGS   AST_BRIDGE_FLAG_DISSOLVE_HANGUP | 
AST_BRIDGE_FLAG_DISSOLVE_EMPTY \
| AST_BRIDGE_FLAG_SMART
@@ -345,8 +346,10 @@
TRANSFER_DOUBLECHECKING,
/* The transfer has reached a successful conclusion */
TRANSFER_COMPLETE,
-   /* Transfer target is ringing, Transferer has hung up */
+   /* Transfer target is ringing, Transferer has hung up. 
atxferdropcall=yes */
TRANSFER_BLOND,
+   /* Transfer target is ringing, Transferer has hung up. 
atxferdropcall=no */
+   TRANSFER_BLOND_NONFINAL,
/* Transfer target did not answer, re-call transferer */
TRANSFER_RECALLING,
/* Transferer did not answer re-call, re-call transfer target */
@@ -406,6 +409,9 @@
char exten[AST_MAX_EXTENSION];
char context[AST_MAX_CONTEXT];
char failsound[PATH_MAX];
+   char transferer_type[AST_CHANNEL_NAME];
+   char transferer_addr[AST_CHANNEL_NAME];
+   struct ast_dial *dial;
 };
 
 static void attended_transfer_properties_destructor(void *obj)
@@ -429,6 +435,9 @@
const char *context)
 {
struct attended_transfer_properties *props;
+   char *tech;
+   char *addr;
+   char *serial;
RAII_VAR(struct ast_features_xfer_config *, xfer_cfg, NULL, 
ao2_cleanup);
 
props = ao2_alloc(sizeof(*props), 
attended_transfer_properties_destructor);
@@ -455,6 +464,21 @@
props-timeout = ast_samp2tv(xfer_cfg-atxfernoanswertimeout, 1000);
ast_copy_string(props-context, get_transfer_context(transferer, 
context), sizeof(props-context));
ast_copy_string(props-failsound, xfer_cfg-xferfailsound, 
sizeof(props-failsound));
+
+   tech = ast_strdupa(ast_channel_name(props-transferer));
+   addr = strchr(tech, '/');
+   if (!addr) {
+   ast_channel_unref(props-transferer);
+   return NULL;
+   }
+   *addr++ = '\0';
+   serial = strrchr(addr, '-');
+   if (serial) {
+   *serial = '\0';
+   }
+   ast_copy_string(props-transferer_type, tech, 
sizeof(props-transferer_type));
+   ast_copy_string(props-transferer_addr, addr, 
sizeof(props-transferer_addr));
+
ast_channel_unlock(props-transferer);
 
return props;
@@ -617,7 +641,7 @@
case STIMULUS_DTMF_ATXFER_COMPLETE:
case STIMULUS_TRANSFERER_HANGUP:
bridge_unhold(props-transferee_bridge);
-   return TRANSFER_BLOND;
+   return props-atxferdropcall ? TRANSFER_BLOND : 
TRANSFER_BLOND_NONFINAL;
case STIMULUS_TARGET_ANSWER:
return TRANSFER_CONSULTING;
case STIMULUS_TARGET_HANGUP:
@@ -658,7 +682,7 @@
return TRANSFER_FAIL;
case STIMULUS_DTMF_ATXFER_COMPLETE:
case STIMULUS_TRANSFERER_HANGUP:
-   return TRANSFER_BLOND;
+   return props-atxferdropcall ? TRANSFER_BLOND : 
TRANSFER_BLOND_NONFINAL;
case STIMULUS_TARGET_ANSWER:
return TRANSFER_CONSULTING;
case STIMULUS_TARGET_HANGUP:
@@ -822,20 +846,88 @@
return 0;
 }
 
+static enum attended_transfer_state blond_nonfinal_next(struct 
attended_transfer_properties *props,
+   enum attended_transfer_stimulus stimulus)
+{
+   switch (stimulus) {
+   default:
+   case STIMULUS_NONE:
+   case STIMULUS_DTMF_ATXFER_ABORT:
+   case STIMULUS_DTMF_ATXFER_COMPLETE:
+   case STIMULUS_DTMF_ATXFER_THREEWAY:
+   case STIMULUS_DTMF_ATXFER_SWAP:
+   case STIMULUS_TRANSFERER_HANGUP:
+   

[svn-commits] rmudgett: branch rmudgett/bridge_phase r393031 - /team/rmudgett/bridge_phase/...

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 20:15:05 2013
New Revision: 393031

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393031
Log:
Complete connecting the agent to the caller.

Modified:
team/rmudgett/bridge_phase/apps/app_agent_pool.c

Modified: team/rmudgett/bridge_phase/apps/app_agent_pool.c
URL: 
http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_agent_pool.c?view=diffrev=393031r1=393030r2=393031
==
--- team/rmudgett/bridge_phase/apps/app_agent_pool.c (original)
+++ team/rmudgett/bridge_phase/apps/app_agent_pool.c Wed Jun 26 20:15:05 2013
@@ -236,6 +236,7 @@
AST_STRING_FIELD(save_calls_in);
/*! Recording format filename extension. */
AST_STRING_FIELD(record_format);
+/* BUGBUG Add an agent waiting COLP to differentiate between an incomming 
caller's COLP and so the caller's COLP does not hang around after the call. */
);
/*!
 * \brief Number of seconds for agent to ack a call before being logged 
off.
@@ -922,12 +923,60 @@
 /*! Agent holding bridge deferred creation lock. */
 AST_MUTEX_DEFINE_STATIC(agent_holding_lock);
 
+/*!
+ * \internal
+ * \brief Connect the agent with the waiting caller.
+ * \since 12.0.0
+ *
+ * \param bridge_channel Agent channel connecting to the caller.
+ * \param agent Which agent is connecting to the caller.
+ *
+ * \note The agent is locked on entry and not locked on exit.
+ *
+ * \return Nothing
+ */
+static void agent_connect_caller(struct ast_bridge_channel *bridge_channel, 
struct agent_pvt *agent)
+{
+   struct ast_bridge *caller_bridge;
+   int res;
+
+   caller_bridge = agent-caller_bridge;
+   agent-caller_bridge = NULL;
+   agent-state = AGENT_STATE_ON_CALL;
+   time(agent-call_start);
+   agent_unlock(agent);
+
+   if (!caller_bridge) {
+   /* Reset agent. */
+   ast_bridge_change_state(bridge_channel, 
AST_BRIDGE_CHANNEL_STATE_END);
+   return;
+   }
+   res = ast_bridge_move(caller_bridge, bridge_channel-bridge, 
bridge_channel-chan,
+   NULL, 0);
+   if (res) {
+   /* Reset agent. */
+   ast_bridge_destroy(caller_bridge);
+   ast_bridge_change_state(bridge_channel, 
AST_BRIDGE_CHANNEL_STATE_END);
+   return;
+   }
+   ast_bridge_channel_write_control_data(bridge_channel, 
AST_CONTROL_ANSWER, NULL, 0);
+}
+
 static int bridge_agent_hold_ack(struct ast_bridge *bridge, struct 
ast_bridge_channel *bridge_channel, void *hook_pvt)
 {
-// struct agent_pvt *agent = hook_pvt;
-
-   /* Connect to caller now. */
-   /*! \todo BUGBUG bridge_agent_hold_ack() not written */
+   struct agent_pvt *agent = hook_pvt;
+
+   agent_lock(agent);
+   switch (agent-state) {
+   case AGENT_STATE_CALL_WAIT_ACK:
+   /* Connect to caller now. */
+   ast_debug(1, Agent %s: Acked call.\n, agent-username);
+   agent_connect_caller(bridge_channel, agent);
+   return 0;
+   default:
+   break;
+   }
+   agent_unlock(agent);
return 0;
 }
 
@@ -1523,17 +1572,17 @@
? agent-override_ack_call : agent-cfg-ack_call) {
agent-state = AGENT_STATE_CALL_WAIT_ACK;
agent-ack_time = ast_tvnow();
-   } else {
-   /* Connect to caller now. */
-/* BUGBUG need to finish here. */
-   }
-   break;
+   break;
+   }
+
+   /* Connect to caller now. */
+   ast_debug(1, Agent %s: Immediately connecting to call.\n, 
agent-username);
+   agent_connect_caller(bridge_channel, agent);
+   return;
default:
break;
}
agent_unlock(agent);
-
-   /*! \todo BUGBUG agent_alert() not written */
 }
 
 static int send_alert_to_agent(struct ast_bridge_channel *bridge_channel, 
const char *agent_id)
@@ -1666,6 +1715,7 @@
ast_bridge_features_cleanup(caller_features);
ast_verb(3, Agent '%s' not logged in.\n, agent-username);
pbx_builtin_setvar_helper(chan, AGENT_STATUS, 
NOT_LOGGED_IN);
+   caller_abort_agent(agent);
return 0;
}
 
@@ -1684,7 +1734,7 @@
return 0;
}
 
-   ast_queue_control(chan, AST_CONTROL_RINGING);
+   ast_indicate(chan, AST_CONTROL_RINGING);
ast_bridge_join(caller_bridge, chan, NULL, caller_features, NULL, 1);
ast_bridge_features_cleanup(caller_features);
 


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   

[svn-commits] rmudgett: branch rmudgett/bridge_phase r393033 - /team/rmudgett/bridge_phase/...

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 21:24:40 2013
New Revision: 393033

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393033
Log:
Tweak some debug messages.

Modified:
team/rmudgett/bridge_phase/apps/app_agent_pool.c

Modified: team/rmudgett/bridge_phase/apps/app_agent_pool.c
URL: 
http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_agent_pool.c?view=diffrev=393033r1=393032r2=393033
==
--- team/rmudgett/bridge_phase/apps/app_agent_pool.c (original)
+++ team/rmudgett/bridge_phase/apps/app_agent_pool.c Wed Jun 26 21:24:40 2013
@@ -1034,7 +1034,7 @@
ast_debug(1, Agent %s: Ack call timeout.\n, agent-username);
ast_bridge_change_state(bridge_channel, 
AST_BRIDGE_CHANNEL_STATE_END);
} else if (wrapup_timedout) {
-   ast_debug(1, Agent %s: Wrapup timeout.\n, agent-username);
+   ast_debug(1, Agent %s: Wrapup timeout. Ready for new call.\n, 
agent-username);
agent_devstate_changed(agent-username);
}
 
@@ -1173,6 +1173,7 @@
agent_unlock(agent);
if (!wrapup_time) {
/* No wrapup time. */
+   ast_debug(1, Agent %s: Ready for new call.\n, 
agent-username);
agent_devstate_changed(agent-username);
}
break;


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] rmudgett: trunk r393034 - in /trunk: include/asterisk/ main/

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 21:55:16 2013
New Revision: 393034

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393034
Log:
Add config framework non-empty string validation requirement option.

Add config framework OPT_CHAR_ARRAY_T and OPT_STRINGFIELD_T non-empty
requirement option.  There are cases were you don't want a config option
string to be empty.  To require the option string to be non-empty, just
set the aco_option_register() flags parameter to non-zero.

* Updated some config framework enum aco_option_type comments.

Modified:
trunk/include/asterisk/config_options.h
trunk/main/config_options.c

Modified: trunk/include/asterisk/config_options.h
URL: 
http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/config_options.h?view=diffrev=393034r1=393033r2=393034
==
--- trunk/include/asterisk/config_options.h (original)
+++ trunk/include/asterisk/config_options.h Wed Jun 26 21:55:16 2013
@@ -265,7 +265,7 @@
 * struct test_item {
 * int enabled;
 * };
-   aco_option_register(cfg_info, enabled, ACO_EXACT, my_types, 
no, OPT_BOOL_T, 1, FLDSET(struct test_item, enabled));
+* aco_option_register(cfg_info, enabled, ACO_EXACT, my_types, no, 
OPT_BOOL_T, 1, FLDSET(struct test_item, enabled));
 * {endcode}
 */
OPT_BOOL_T,
@@ -284,13 +284,15 @@
 * struct test_item {
 * unsigned int flags;
 * };
-   aco_option_register(cfg_info, quiet, ACO_EXACT, my_types, 
no, OPT_BOOLFLAG_T, 1, FLDSET(struct test_item, flags), MY_TYPE_ISQUIET);
-* {endcode}
-*/
-
+* aco_option_register(cfg_info, quiet, ACO_EXACT, my_types, no, 
OPT_BOOLFLAG_T, 1, FLDSET(struct test_item, flags), MY_TYPE_ISQUIET);
+* {endcode}
+*/
OPT_BOOLFLAG_T,
 
-   /*! \brief Type for default option handler for character arrays
+   /*! \brief Type for default option handler for character array strings
+* \note aco_option_register flags:
+*   non-zero : String cannot be empty.
+*   0: String can be empty.
 * \note aco_option_register varargs:
 *   CHARFLDSET macro with a field of type char[]
 *
@@ -299,7 +301,7 @@
 * struct test_item {
 * char description[128];
 * };
-* aco_option_register(cfg_info, description, ACO_EXACT, my_types, 
none, OPT_CHAR_ARRAY_T, CHARFLDSET(struct test_item, description));
+* aco_option_register(cfg_info, description, ACO_EXACT, my_types, 
none, OPT_CHAR_ARRAY_T, 0, CHARFLDSET(struct test_item, description));
 * {endcode}
 */
OPT_CHAR_ARRAY_T,
@@ -338,7 +340,7 @@
 * double dub;
 * };
 * {code}
-* aco_option_register(cfg_info, doubleopt, ACO_EXACT, my_types, 
3, OPT_DOUBLE_T, FLDSET(struct test_item, dub));
+* aco_option_register(cfg_info, doubleopt, ACO_EXACT, my_types, 
3, OPT_DOUBLE_T, 0, FLDSET(struct test_item, dub));
 * {endcode}
 */
OPT_DOUBLE_T,
@@ -393,7 +395,8 @@
 
/*! \brief Type for default option handler for stringfields
 * \note aco_option_register flags:
-*   none
+*   non-zero : String cannot be empty.
+*   0: String can be empty.
 * aco_option_register varargs:
 *   STRFLDSET macro with the field being the field created by 
AST_STRING_FIELD
 *

Modified: trunk/main/config_options.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/main/config_options.c?view=diffrev=393034r1=393033r2=393034
==
--- trunk/main/config_options.c (original)
+++ trunk/main/config_options.c Wed Jun 26 21:55:16 2013
@@ -1342,6 +1342,10 @@
ast_string_field *field = (const char **)(obj + opt-args[0]);
struct ast_string_field_pool **pool = (struct ast_string_field_pool 
**)(obj + opt-args[1]);
struct ast_string_field_mgr *mgr = (struct ast_string_field_mgr *)(obj 
+ opt-args[2]);
+
+   if (opt-flags  ast_strlen_zero(var-value)) {
+   return -1;
+   }
ast_string_field_ptr_set_by_fields(*pool, *mgr, field, var-value);
return 0;
 }
@@ -1384,7 +1388,7 @@
return ast_parse_arg(var-value, PARSE_ADDR | opt-flags, field);
 }
 
-/*! \brief Default handler for doing noithing
+/*! \brief Default handler for doing nothing
  */
 static int noop_handler_fn(const struct aco_option *opt, struct ast_variable 
*var, void *obj)
 {
@@ -1400,6 +1404,9 @@
char *field = (char *)(obj + opt-args[0]);
size_t len = opt-args[1];
 
+   if (opt-flags  ast_strlen_zero(var-value)) {
+   return -1;
+   }
ast_copy_string(field, var-value, len);
return 0;
 }


--
_
-- Bandwidth and Colocation 

[svn-commits] dlee: branch dlee/ari-authn r393039 - /team/dlee/ari-authn/main/utils.c

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 22:18:34 2013
New Revision: 393039

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393039
Log:
Fixed salt generation

Modified:
team/dlee/ari-authn/main/utils.c

Modified: team/dlee/ari-authn/main/utils.c
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/main/utils.c?view=diffrev=393039r1=393038r2=393039
==
--- team/dlee/ari-authn/main/utils.c (original)
+++ team/dlee/ari-authn/main/utils.c Wed Jun 26 22:18:34 2013
@@ -2289,7 +2289,8 @@
 /*! Randomly select a character for a salt string */
 static char gen_salt_char(void)
 {
-   return salt_chars[ast_random() % ARRAY_LEN(salt_chars)];
+   int which = ast_random_double() * 64;
+   return salt_chars[which];
 }
 
 /*!
@@ -2309,6 +2310,7 @@
 static int gen_salt(char *current_salt, size_t maxlen)
 {
int i;
+
if (maxlen  MAX_SALT_LEN || current_salt == NULL) {
return -1;
}
@@ -2426,7 +2428,6 @@
 char *ast_crypt_encrypt(const char *key)
 {
char salt[MAX_SALT_LEN] = {};
-   SCOPED_MUTEX(lock, crypt_mutex);
while (gen_salt(salt, sizeof(salt)) == 0) {
char *crypted = ast_crypt(key, salt);
if (crypted) {


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] dlee: branch dlee/ari-authn r393041 - /team/dlee/ari-authn/res/stasis_http/

2013-06-26 Thread SVN commits to the Digium repositories
Author: dlee
Date: Wed Jun 26 22:19:00 2013
New Revision: 393041

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393041
Log:
Comment fixing

Modified:
team/dlee/ari-authn/res/stasis_http/internal.h

Modified: team/dlee/ari-authn/res/stasis_http/internal.h
URL: 
http://svnview.digium.com/svn/asterisk/team/dlee/ari-authn/res/stasis_http/internal.h?view=diffrev=393041r1=393040r2=393041
==
--- team/dlee/ari-authn/res/stasis_http/internal.h (original)
+++ team/dlee/ari-authn/res/stasis_http/internal.h Wed Jun 26 22:19:00 2013
@@ -77,14 +77,18 @@
ARI_PASSWORD_FORMAT_CRYPT,
 };
 
+/*!
+ * \brief User's password mx length.
+ *
+ * If 256 seems like a lot, a crypt SHA-512 has over 106 characters.
+ */
 #define ARI_PASSWORD_LEN 256
 
 /*! \brief Per-user configuration options */
 struct ari_conf_user {
/*! Username for authentication */
char *username;
-   /*! User's password. If 256 seems like a lot, a crypt SHA-512 has over
-*  100 characters */
+   /*! User's password. */
char password[ARI_PASSWORD_LEN];
/*! Format for the password field */
enum ari_password_format password_format;


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits


[svn-commits] rmudgett: branch rmudgett/bridge_phase r393052 - /team/rmudgett/bridge_phase/...

2013-06-26 Thread SVN commits to the Digium repositories
Author: rmudgett
Date: Wed Jun 26 22:24:46 2013
New Revision: 393052

URL: http://svnview.digium.com/svn/asterisk?view=revrev=393052
Log:
Take advantage of non-empty string validation option.

Modified:
team/rmudgett/bridge_phase/apps/app_agent_pool.c

Modified: team/rmudgett/bridge_phase/apps/app_agent_pool.c
URL: 
http://svnview.digium.com/svn/asterisk/team/rmudgett/bridge_phase/apps/app_agent_pool.c?view=diffrev=393052r1=393051r2=393052
==
--- team/rmudgett/bridge_phase/apps/app_agent_pool.c (original)
+++ team/rmudgett/bridge_phase/apps/app_agent_pool.c Wed Jun 26 22:24:46 2013
@@ -444,30 +444,6 @@
return 0;
 }
 
-/*!
- * \internal
- * \brief Handle the agent custom_beep option.
- * \since 12.0.0
- *
- * \param opt The option being configured
- * \param var The config variable to use to configure \a obj
- * \param obj The object to be configured
- *
- * \retval 0 on success.
- * \retval -1 on error.
- */
-static int agent_custom_beep_handler(const struct aco_option *opt, struct 
ast_variable *var, void *obj)
-{
-   struct agent_cfg *cfg = obj;
-
-   if (ast_strlen_zero(var-value)) {
-   return -1;
-   }
-
-   ast_string_field_set(cfg, beep_sound, var-value);
-   return 0;
-}
-
 static void destroy_config(void)
 {
ao2_global_obj_release(cfg_handle);
@@ -483,13 +459,13 @@
/* Agent options */
aco_option_register(cfg_info, autologoff, ACO_EXACT, agent_types, 
0, OPT_UINT_T, 0, FLDSET(struct agent_cfg, auto_logoff));
aco_option_register(cfg_info, ackcall, ACO_EXACT, agent_types, no, 
OPT_BOOL_T, 1, FLDSET(struct agent_cfg, ack_call));
-   aco_option_register(cfg_info, acceptdtmf, ACO_EXACT, agent_types, 
#, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, dtmf_accept));
+   aco_option_register(cfg_info, acceptdtmf, ACO_EXACT, agent_types, 
#, OPT_STRINGFIELD_T, 1, STRFLDSET(struct agent_cfg, dtmf_accept));
aco_option_register(cfg_info, wrapuptime, ACO_EXACT, agent_types, 
0, OPT_UINT_T, 0, FLDSET(struct agent_cfg, wrapup_time));
aco_option_register(cfg_info, musiconhold, ACO_EXACT, agent_types, 
default, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, moh));
aco_option_register(cfg_info, recordagentcalls, ACO_EXACT, 
agent_types, no, OPT_BOOL_T, 1, FLDSET(struct agent_cfg, record_agent_calls));
-   aco_option_register(cfg_info, recordformat, ACO_EXACT, agent_types, 
wav, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, record_format));
+   aco_option_register(cfg_info, recordformat, ACO_EXACT, agent_types, 
wav, OPT_STRINGFIELD_T, 1, STRFLDSET(struct agent_cfg, record_format));
aco_option_register_custom(cfg_info, savecallsin, ACO_EXACT, 
agent_types, , agent_savecallsin_handler, 0);
-   aco_option_register_custom(cfg_info, custom_beep, ACO_EXACT, 
agent_types, beep, agent_custom_beep_handler, 0);
+   aco_option_register(cfg_info, custom_beep, ACO_EXACT, agent_types, 
beep, OPT_STRINGFIELD_T, 1, STRFLDSET(struct agent_cfg, beep_sound));
aco_option_register(cfg_info, fullname, ACO_EXACT, agent_types, 
NULL, OPT_STRINGFIELD_T, 0, STRFLDSET(struct agent_cfg, full_name));
 
if (aco_process_config(cfg_info, 0) == ACO_PROCESS_ERROR) {
@@ -971,7 +947,7 @@
case AGENT_STATE_CALL_WAIT_ACK:
/* Connect to caller now. */
ast_debug(1, Agent %s: Acked call.\n, agent-username);
-   agent_connect_caller(bridge_channel, agent);
+   agent_connect_caller(bridge_channel, agent);/* Will unlock 
agent. */
return 0;
default:
break;
@@ -1578,7 +1554,7 @@
 
/* Connect to caller now. */
ast_debug(1, Agent %s: Immediately connecting to call.\n, 
agent-username);
-   agent_connect_caller(bridge_channel, agent);
+   agent_connect_caller(bridge_channel, agent);/* Will unlock 
agent. */
return;
default:
break;


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits