@@ -1455,15 +1455,17 @@ int ast_queue_answer(struct ast_channel *chan, const struct ast_stream_topology
1455
1455
/*!
1456
1456
* \brief Change channel name
1457
1457
*
1458
- * \pre Absolutely all channels _MUST_ be unlocked before calling this function.
1458
+ * \pre Absolutely all channels and the channel storage backend _MUST_ be
1459
+ * unlocked before calling this function.
1459
1460
*
1460
1461
* \param chan the channel to change the name of
1461
1462
* \param newname the name to change to
1462
1463
*
1463
- * \note this function must _NEVER_ be used when any channels are locked
1464
- * regardless if it is the channel who's name is being changed or not because
1465
- * it invalidates our channel container locking order... lock container first,
1466
- * then the individual channels, never the other way around.
1464
+ * \note this function must _NEVER_ be used when any channels or the channel
1465
+ * storage backend are locked regardless if it is the channel who's name is
1466
+ * being changed or not because it invalidates our channel container locking
1467
+ * order... lock container first, then the individual channels, never the
1468
+ * other way around.
1467
1469
*/
1468
1470
void ast_change_name (struct ast_channel * chan , const char * newname );
1469
1471
@@ -3119,48 +3121,64 @@ struct ast_channel *ast_channel_iterator_next(struct ast_channel_iterator *i);
3119
3121
3120
3122
/*! @} End channel iterator definitions. */
3121
3123
3124
+ /*! @{ Channel search functions */
3125
+
3126
+ /*!
3127
+ * \warning Absolutely _NO_ channel locks should be held while calling any of
3128
+ * these functions.
3129
+ */
3130
+
3122
3131
/*!
3123
3132
* \brief Call a function with every active channel
3124
3133
*
3125
3134
* \details
3126
3135
* This function executes a callback one time for each active channel on the
3127
3136
* system. The channel is provided as an argument to the function.
3128
3137
*
3129
- * \note Absolutely _NO_ channel locks should be held before calling this function.
3130
3138
* \since 1.8
3131
3139
*/
3132
3140
struct ast_channel * ast_channel_callback (ao2_callback_data_fn * cb_fn , void * arg ,
3133
3141
void * data , int ao2_flags );
3134
3142
3135
- /*! @{ Channel search functions */
3136
-
3137
3143
/*!
3138
- * \brief Find a channel by name
3144
+ * \brief Find a channel by name or uniqueid
3139
3145
*
3140
- * \param name the name or uniqueid of the channel to search for
3146
+ * \param search the name or uniqueid of the channel to search for
3141
3147
*
3142
3148
* \details
3143
- * Find a channel that has the same name as the provided argument.
3149
+ * First searches for a channel with a matching name. If not found
3150
+ * a search for a channel with a matching uniqueid is done.
3144
3151
*
3145
- * \retval a channel with the name specified by the argument
3152
+ * \retval a channel with a matching name or uniqueid
3146
3153
* \retval NULL if no channel was found
3147
3154
*
3155
+ *\note The fallback search by uniqueid is a historical thing. If you
3156
+ * know the search term is a uniqueid, use \ref ast_channel_get_by_uniqueid
3157
+ * instead.
3158
+ *
3148
3159
* \since 1.8
3149
3160
*/
3150
- struct ast_channel * ast_channel_get_by_name (const char * name );
3161
+ struct ast_channel * ast_channel_get_by_name (const char * search );
3151
3162
3152
3163
/*!
3153
3164
* \brief Find a channel by a name prefix
3154
3165
*
3155
- * \param name The channel name or uniqueid prefix to search for
3156
- * \param name_len Only search for up to this many characters from the name
3166
+ * \param search The channel name or uniqueid prefix to search for
3167
+ * \param len Only search for up to this many characters from the search term
3157
3168
*
3158
3169
* \details
3159
- * Find a channel that has the same name prefix as specified by the arguments.
3170
+ * Search for a channel that has the same name prefix as specified by the
3171
+ * search term. If not found, search for an exact match on the uniqueid.
3172
+ * Searching by partial uniqueid doesn't make any sense as it's usually
3173
+ * a system-name plus a timestamp and is not supported.
3160
3174
*
3161
- * \retval a channel with the name prefix specified by the arguments
3175
+ * \retval a channel with a matching name or uniqueid
3162
3176
* \retval NULL if no channel was found
3163
3177
*
3178
+ *\note The fallback search by uniqueid is a historical thing. If you
3179
+ * know the search term is a uniqueid, use \ref ast_channel_get_by_uniqueid
3180
+ * instead.
3181
+ *
3164
3182
* \since 1.8
3165
3183
*/
3166
3184
struct ast_channel * ast_channel_get_by_name_prefix (const char * name , size_t name_len );
@@ -3181,6 +3199,16 @@ struct ast_channel *ast_channel_get_by_name_prefix(const char *name, size_t name
3181
3199
*/
3182
3200
struct ast_channel * ast_channel_get_by_exten (const char * exten , const char * context );
3183
3201
3202
+ /*!
3203
+ * \brief Find a channel by a uniqueid
3204
+ *
3205
+ * \param uniqueid The uniqueid to search for
3206
+ *
3207
+ * \retval a channel with the uniqueid specified by the arguments
3208
+ * \retval NULL if no channel was found
3209
+ */
3210
+ struct ast_channel * ast_channel_get_by_uniqueid (const char * uniqueid );
3211
+
3184
3212
/*! @} End channel search functions. */
3185
3213
3186
3214
/*!
@@ -4998,5 +5026,27 @@ void *ast_channel_get_stream_topology_change_source(struct ast_channel *chan);
4998
5026
#define ast_channel_has_tech_function (chan , function ) \
4999
5027
(ast_channel_tech(chan) ? ast_channel_tech(chan)->function != NULL : 0)
5000
5028
5029
+ /*!
5030
+ * \brief Get the name of the current channel storage driver
5031
+ *
5032
+ * \return The name of the current channel storage driver
5033
+ */
5034
+ const char * ast_channel_get_current_storage_driver_name (void );
5035
+
5036
+ /*!
5037
+ * \internal
5038
+ * \brief Set the current channel storage driver
5039
+ *
5040
+ * \param driver_name The name of the driver to set as the current driver
5041
+ *
5042
+ * \return 0 on success, -1 on failure
5043
+ *
5044
+ * \warning Changing the channel storage driver while Asterisk is running is
5045
+ * not supported. This function will return an error if called while
5046
+ * the ast_fully_booted flag is set. The function is exposed only
5047
+ * because options.c needs it to set the driver when reading
5048
+ * asterisk.conf.
5049
+ */
5050
+ int internal_channel_set_current_storage_driver (const char * driver_name );
5001
5051
5002
5052
#endif /* _ASTERISK_CHANNEL_H */
0 commit comments