]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
- update documentation for some of the goto functions to note that they
authorRussell Bryant <russell@russellbryant.com>
Wed, 28 Nov 2007 00:20:13 +0000 (00:20 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 28 Nov 2007 00:20:13 +0000 (00:20 +0000)
   handle locking the channel as needed
 - update ast_explicit_goto() to lock the channel as needed

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89893 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/pbx.h
main/pbx.c

index 699aa50826f9ce1171f3ca481d4f1443ce103123..1e8bf56d699919ea202e934c5a9e0f16eb89d3dd 100644 (file)
@@ -804,10 +804,29 @@ int ast_extension_patmatch(const char *pattern, const char *data);
   set to 1, sets to auto fall through.  If newval set to 0, sets to no auto
   fall through (reads extension instead).  Returns previous value. */
 int pbx_set_autofallthrough(int newval);
+
+/*!
+ * \note This function will handle locking the channel as needed.
+ */
 int ast_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority);
-/* I can find neither parsable nor parseable at dictionary.com, but google gives me 169000 hits for parseable and only 49,800 for parsable */
+
+/*!
+ * \note I can find neither parsable nor parseable at dictionary.com, 
+ *       but google gives me 169000 hits for parseable and only 49,800 
+ *       for parsable 
+ *
+ * \note This function will handle locking the channel as needed.
+ */
 int ast_parseable_goto(struct ast_channel *chan, const char *goto_string);
+
+/*!
+ * \note This function will handle locking the channel as needed.
+ */
 int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
+
+/*!
+ * \note This function will handle locking the channel as needed.
+ */
 int ast_async_goto_if_exists(struct ast_channel *chan, const char *context, const char *exten, int priority);
 
 struct ast_custom_function* ast_custom_function_find(const char *name);
index 025bcef21eb329c437eb68f31afdbe07172c3864..fc3ccb15ee010cca335ba0a208aa68c401acc15c 100644 (file)
@@ -4581,6 +4581,8 @@ int ast_explicit_goto(struct ast_channel *chan, const char *context, const char
        if (!chan)
                return -1;
 
+       ast_channel_lock(chan);
+
        if (!ast_strlen_zero(context))
                ast_copy_string(chan->context, context, sizeof(chan->context));
        if (!ast_strlen_zero(exten))
@@ -4592,6 +4594,8 @@ int ast_explicit_goto(struct ast_channel *chan, const char *context, const char
                        chan->priority--;
        }
 
+       ast_channel_unlock(chan);
+
        return 0;
 }