diff options
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/ari.h | 2 | ||||
-rw-r--r-- | include/asterisk/autoconfig.h.in | 3 | ||||
-rw-r--r-- | include/asterisk/datastore.h | 58 | ||||
-rw-r--r-- | include/asterisk/logger.h | 18 | ||||
-rw-r--r-- | include/asterisk/multicast_rtp.h | 58 | ||||
-rw-r--r-- | include/asterisk/parking.h | 11 | ||||
-rw-r--r-- | include/asterisk/res_hep.h | 14 | ||||
-rw-r--r-- | include/asterisk/res_pjsip.h | 12 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_body_generator_types.h | 5 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_outbound_publish.h | 52 | ||||
-rw-r--r-- | include/asterisk/res_pjsip_pubsub.h | 28 | ||||
-rw-r--r-- | include/asterisk/stasis_app_playback.h | 17 | ||||
-rw-r--r-- | include/asterisk/stasis_app_recording.h | 24 | ||||
-rw-r--r-- | include/asterisk/strings.h | 2 |
14 files changed, 296 insertions, 8 deletions
diff --git a/include/asterisk/ari.h b/include/asterisk/ari.h index c9f47a6e5..79b9516eb 100644 --- a/include/asterisk/ari.h +++ b/include/asterisk/ari.h @@ -95,6 +95,8 @@ struct ast_ari_response { /*! HTTP response code. * See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html */ int response_code; + /*! File descriptor for whatever file we want to respond with */ + int fd; /*! Corresponding text for the response code */ const char *response_text; /* Shouldn't http.c handle this? */ /*! Flag to indicate that no further response is needed */ diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index b5fe655d7..722421228 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -730,6 +730,9 @@ /* Define if your system has the PWLib libraries. */ #undef HAVE_PWLIB +/* Define if your system has the PYTHONDEV libraries. */ +#undef HAVE_PYTHONDEV + /* Define to 1 if you have the Radius Client library. */ #undef HAVE_RADIUS diff --git a/include/asterisk/datastore.h b/include/asterisk/datastore.h index 8f59fd3cf..85e9c6890 100644 --- a/include/asterisk/datastore.h +++ b/include/asterisk/datastore.h @@ -92,6 +92,64 @@ struct ast_datastore * attribute_malloc __ast_datastore_alloc(const struct ast_d */ int ast_datastore_free(struct ast_datastore *datastore); +/*! + * \brief Allocate a specialized data stores container + * + * \return a container for storing data stores + * + * \since 14.0.0 + */ +struct ao2_container *ast_datastores_alloc(void); + +/*! + * \brief Add a data store to a container + * + * \param[in] datastores container to store datastore in + * \param[in] datastore datastore to add + * + * \retval 0 success + * \retval -1 failure + * + * \since 14.0.0 + */ +int ast_datastores_add(struct ao2_container *datastores, struct ast_datastore *datastore); + +/*! + * \brief Remove a data store from a container + * + * \param[in] datastores container to remove datastore from + * \param[in] name name of the data store to remove + * + * \since 14.0.0 + */ +void ast_datastores_remove(struct ao2_container *datastores, const char *name); + +/*! + * \brief Find a data store in a container + * + * \param[in] datastores container to find datastore in + * \param[in] name name of the data store to find + * + * \retval non-NULL success + * \retval NULL failure + * + * \since 14.0.0 + */ +struct ast_datastore *ast_datastores_find(struct ao2_container *datastores, const char *name); + +/*! + * \brief Allocate a datastore for use with the datastores container + * + * \param[in] info information about the datastore + * \param[in] uid unique identifier for the datastore + * + * \retval non-NULL success + * \retval NULL failure + * + * \since 14.0.0 + */ +struct ast_datastore *ast_datastores_alloc_datastore(const struct ast_datastore_info *info, const char *uid); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/include/asterisk/logger.h b/include/asterisk/logger.h index bf8ce6acf..9f9f671c0 100644 --- a/include/asterisk/logger.h +++ b/include/asterisk/logger.h @@ -195,11 +195,25 @@ int ast_unregister_verbose(void (*verboser)(const char *string)) attribute_warn_ void ast_console_puts(const char *string); /*! - * \brief log the string to the console, and all attached - * console clients + * \brief log the string to the console, and all attached console clients + * + * \param string The message to write to the console + * \param level The log level of the message + * * \version 1.6.1 added level parameter */ void ast_console_puts_mutable(const char *string, int level); + +/*! + * \brief log the string to the console, and all attached console clients + * \since 14.0.0 + * + * \param message The message to write to the console + * \param sublevel If the log level supports it, the sub-level of the message + * \param level The log level of the message + */ +void ast_console_puts_mutable_full(const char *message, int level, int sublevel); + void ast_console_toggle_mute(int fd, int silent); /*! diff --git a/include/asterisk/multicast_rtp.h b/include/asterisk/multicast_rtp.h new file mode 100644 index 000000000..c286c1f96 --- /dev/null +++ b/include/asterisk/multicast_rtp.h @@ -0,0 +1,58 @@ +/* + * Asterisk -- An open source telephony toolkit. + * + * Copyright (C) 2016, Digium, Inc. + * + * Mark Michelson <mmichelson@digium.com> + * + * See http://www.asterisk.org for more information about + * the Asterisk project. Please do not directly contact + * any of the maintainers of this project for assistance; + * the project provides a web site, mailing lists and IRC + * channels for your use. + * + * This program is free software, distributed under the terms of + * the GNU General Public License Version 2. See the LICENSE file + * at the top of the source tree. + */ + +#ifndef MULTICAST_RTP_H_ +#define MULTICAST_RTP_H_ +struct ast_multicast_rtp_options; + +/*! + * \brief Create multicast RTP options. + * + * These are passed to the multicast RTP engine on its creation. + * + * \param type The type of multicast RTP, either "basic" or "linksys" + * \param options Miscellaneous options + * \retval NULL Failure + * \retval non-NULL success + */ +struct ast_multicast_rtp_options *ast_multicast_rtp_create_options(const char *type, + const char *options); + +/*! + * \brief Free multicast RTP options + * + * This function is NULL-tolerant + * + * \param mcast_options Options to free + */ +void ast_multicast_rtp_free_options(struct ast_multicast_rtp_options *mcast_options); + +/*! + * \brief Get format specified in multicast options + * + * Multicast options allow for a format to be selected. + * This function accesses the selected format and creates + * an ast_format structure for it. + * + * \param mcast_options The options where a codec was specified + * \retval NULL No format specified in the options + * \revval non-NULL The format to use for communication + */ +struct ast_format *ast_multicast_rtp_options_get_format(struct ast_multicast_rtp_options *mcast_options); + +#endif /* MULTICAST_RTP_H_ */ diff --git a/include/asterisk/parking.h b/include/asterisk/parking.h index 4c93c3b45..53dfe9320 100644 --- a/include/asterisk/parking.h +++ b/include/asterisk/parking.h @@ -211,12 +211,19 @@ int ast_parking_is_exten_park(const char *context, const char *exten); * \brief Park the bridge and/or callers that this channel is in * * \param parker The bridge_channel parking the bridge - * \param exten Optional. The extension the channel or bridge was parked at if the - * call succeeds. + * \param[out] exten Optional. The parking exten to access the parking lot. * \param length Optional. If \c exten is specified, the size of the buffer. * * \note This is safe to be called outside of the \ref AstBridging Bridging API. * + * \note The exten parameter was intended to return the extension the channel or + * bridge was parked at if the call succeeds. However, accessing that information + * is very difficult to do with the new asynchronous design. That information may + * not be available anywhere by the time this function currently returns. + * + * Only, chan_skinny is known to call this function and use the exten parameter + * for the phone display. + * * \retval 0 on success * \retval non-zero on error */ diff --git a/include/asterisk/res_hep.h b/include/asterisk/res_hep.h index 8839fd60a..bd0129eea 100644 --- a/include/asterisk/res_hep.h +++ b/include/asterisk/res_hep.h @@ -49,6 +49,11 @@ enum hepv3_capture_type { HEPV3_CAPTURE_TYPE_IAX = 0x10, }; +enum hep_uuid_type { + HEP_UUID_TYPE_CALL_ID = 0, + HEP_UUID_TYPE_CHANNEL, +}; + /*! \brief HEPv3 Capture Info */ struct hepv3_capture_info { /*! The source address of the packet */ @@ -104,6 +109,15 @@ struct hepv3_capture_info *hepv3_create_capture_info(const void *payload, size_t */ int hepv3_send_packet(struct hepv3_capture_info *capture_info); +/*! + * \brief Get the preferred UUID type + * + * \since 13.10.0 + * + * \retval The type of UUID the packet should use + */ +enum hep_uuid_type hepv3_get_uuid_type(void); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index 05f8100cf..50d02d980 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -250,6 +250,12 @@ struct ast_sip_contact { struct ast_sip_endpoint *endpoint; /*! Asterisk Server name */ AST_STRING_FIELD_EXTENDED(reg_server); + /*! IP-address of the Via header in REGISTER request */ + AST_STRING_FIELD_EXTENDED(via_addr); + /* Port of the Via header in REGISTER request */ + int via_port; + /*! Content of the Call-ID header in REGISTER request */ + AST_STRING_FIELD_EXTENDED(call_id); }; #define CONTACT_STATUS "contact_status" @@ -738,6 +744,10 @@ struct ast_sip_endpoint { unsigned int usereqphone; /*! Whether to pass through hold and unhold using re-invites with recvonly and sendrecv */ unsigned int moh_passthrough; + /* Access control list */ + struct ast_acl_list *acl; + /* Restrict what IPs are allowed in the Contact header (for registration) */ + struct ast_acl_list *contact_acl; }; /*! @@ -1089,6 +1099,7 @@ struct ast_sip_contact *ast_sip_location_retrieve_contact(const char *contact_na */ int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, + const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint); /*! @@ -1110,6 +1121,7 @@ int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri, */ int ast_sip_location_add_contact_nolock(struct ast_sip_aor *aor, const char *uri, struct timeval expiration_time, const char *path_info, const char *user_agent, + const char *via_addr, int via_port, const char *call_id, struct ast_sip_endpoint *endpoint); /*! diff --git a/include/asterisk/res_pjsip_body_generator_types.h b/include/asterisk/res_pjsip_body_generator_types.h index aab147238..f61534b10 100644 --- a/include/asterisk/res_pjsip_body_generator_types.h +++ b/include/asterisk/res_pjsip_body_generator_types.h @@ -21,6 +21,9 @@ #include "asterisk/pbx.h" +/*! \brief Forward declaration for ao2_container so full astobj2.h is not required */ +struct ao2_container; + /*! * \brief structure used for presence XML bodies * @@ -51,6 +54,8 @@ struct ast_sip_exten_state_data { char remote[PJSIP_MAX_URL_SIZE]; /*! Optional subscription */ struct ast_sip_subscription *sub; + /*! A datastores container to persist datastores */ + struct ao2_container *datastores; /*! Allocation pool */ pj_pool_t *pool; }; diff --git a/include/asterisk/res_pjsip_outbound_publish.h b/include/asterisk/res_pjsip_outbound_publish.h index b2038f58b..a578b5aec 100644 --- a/include/asterisk/res_pjsip_outbound_publish.h +++ b/include/asterisk/res_pjsip_outbound_publish.h @@ -104,6 +104,21 @@ struct ast_sip_outbound_publish_client *ast_sip_publish_client_get(const char *n const char *ast_sip_publish_client_get_from_uri(struct ast_sip_outbound_publish_client *client); /*! + * \brief Get the From URI the client will use for a specific user. + * \since 14.0.0 + * + * \param client The publication client to get the From URI of a user + * \param user The user to retrieve the From URI for + * \param uri A buffer to place the URI into + * \param size The size of the buffer + * + * \retval From-uri on success + * \retval Empty-string on failure + */ +const char *ast_sip_publish_client_get_user_from_uri(struct ast_sip_outbound_publish_client *client, const char *user, + char *uri, size_t size); + +/*! * \brief Get the To URI the client will use. * \since 14.0.0 * @@ -115,6 +130,21 @@ const char *ast_sip_publish_client_get_from_uri(struct ast_sip_outbound_publish_ const char *ast_sip_publish_client_get_to_uri(struct ast_sip_outbound_publish_client *client); /*! + * \brief Get the To URI the client will use for a specific user. + * \since 14.0.0 + * + * \param client The publication client to get the To URI of a user + * \param user The user to retrieve the To URI for + * \param uri A buffer to place the URI into + * \param size The size of the buffer + * + * \retval To-uri on success + * \retval Empty-string on failure + */ +const char *ast_sip_publish_client_get_user_to_uri(struct ast_sip_outbound_publish_client *client, const char *user, + char *uri, size_t size); + +/*! * \brief Alternative for ast_datastore_alloc() * * There are two major differences between this and ast_datastore_alloc() @@ -184,4 +214,26 @@ void ast_sip_publish_client_remove_datastore(struct ast_sip_outbound_publish_cli int ast_sip_publish_client_send(struct ast_sip_outbound_publish_client *client, const struct ast_sip_body *body); +/*! +* \brief Send an outgoing PUBLISH message based on the user +* +* \param client The publication client to send from +* \param user The user to send to +* \param body An optional body to add to the PUBLISH +* +* \retval -1 failure +* \retval 0 success +*/ +int ast_sip_publish_client_user_send(struct ast_sip_outbound_publish_client *client, + const char *user, const struct ast_sip_body *body); + +/*! +* \brief Remove the user from the client (stopping it from publishing) +* +* \param client The publication client +* \param user The user to remove +*/ +void ast_sip_publish_client_remove(struct ast_sip_outbound_publish_client *client, + const char *user); + #endif /* RES_PJSIP_OUTBOUND_PUBLISH_H */ diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h index 4f9a7633a..cb51db31f 100644 --- a/include/asterisk/res_pjsip_pubsub.h +++ b/include/asterisk/res_pjsip_pubsub.h @@ -166,6 +166,20 @@ struct ast_datastore *ast_sip_publication_get_datastore(struct ast_sip_publicati void ast_sip_publication_remove_datastore(struct ast_sip_publication *publication, const char *name); /*! + * \brief Get the datastores container for a publication + * + * \param publication The publication to get the datastores container from + * + * \retval NULL datastores container not present + * \retval non-NULL datastores container + * + * \note The container is NOT returned with reference count bumped + * + * \since 14.0.0 + */ +struct ao2_container *ast_sip_publication_get_datastores(const struct ast_sip_publication *publication); + +/*! * \brief Opaque structure representing an RFC 3265 SIP subscription */ struct ast_sip_subscription; @@ -518,6 +532,20 @@ struct ast_datastore *ast_sip_subscription_get_datastore(struct ast_sip_subscrip void ast_sip_subscription_remove_datastore(struct ast_sip_subscription *subscription, const char *name); /*! + * \brief Get the datastores container for a subscription + * + * \param subscription The subscription to get the datastores container from + * + * \retval NULL datastores container not present + * \retval non-NULL datastores container + * + * \note The container is NOT returned with reference count bumped + * + * \since 14.0.0 + */ +struct ao2_container *ast_sip_subscription_get_datastores(const struct ast_sip_subscription *subscription); + +/*! * \brief Register a subscription handler * * \retval 0 Handler was registered successfully diff --git a/include/asterisk/stasis_app_playback.h b/include/asterisk/stasis_app_playback.h index b35299581..0038fd6d0 100644 --- a/include/asterisk/stasis_app_playback.h +++ b/include/asterisk/stasis_app_playback.h @@ -41,6 +41,8 @@ enum stasis_app_playback_state { STASIS_PLAYBACK_STATE_PLAYING, /*! The media is currently playing */ STASIS_PLAYBACK_STATE_PAUSED, + /*! The media is transitioning to the next in the list */ + STASIS_PLAYBACK_STATE_CONTINUING, /*! The media has stopped playing */ STASIS_PLAYBACK_STATE_COMPLETE, /*! The playback was canceled. */ @@ -84,7 +86,8 @@ enum stasis_app_playback_target_type { * available codecs for the channel. * * \param control Control for \c res_stasis. - * \param file Base filename for the file to play. + * \param media Array of const char * media files to play. + * \param media_count The number of media files in \c media. * \param language Selects the file based on language. * \param target_id ID of the target bridge or channel. * \param target_type What the target type is @@ -95,8 +98,8 @@ enum stasis_app_playback_target_type { * \return \c NULL on error. */ struct stasis_app_playback *stasis_app_control_play_uri( - struct stasis_app_control *control, const char *file, - const char *language, const char *target_id, + struct stasis_app_control *control, const char **media, + size_t media_count, const char *language, const char *target_id, enum stasis_app_playback_target_type target_type, int skipms, long offsetms, const char *id); @@ -128,6 +131,14 @@ const char *stasis_app_playback_get_id( */ struct stasis_app_playback *stasis_app_playback_find_by_id(const char *id); +/*! + * \brief Convert a playback to its JSON representation + * + * \param playback The playback object to convert to JSON + * + * \retval \c NULL on error + * \retval A JSON object on success + */ struct ast_json *stasis_app_playback_to_json( const struct stasis_app_playback *playback); diff --git a/include/asterisk/stasis_app_recording.h b/include/asterisk/stasis_app_recording.h index 543207a47..bded30629 100644 --- a/include/asterisk/stasis_app_recording.h +++ b/include/asterisk/stasis_app_recording.h @@ -49,6 +49,30 @@ const char *stasis_app_stored_recording_get_file( struct stasis_app_stored_recording *recording); /*! + * \brief Returns the full filename, with extension, for this recording. + * \since 14.0.0 + * + * \param recording Recording to query. + * + * \return Absolute path to the recording file, with the extension. + * \return \c NULL on error + */ +const char *stasis_app_stored_recording_get_filename( + struct stasis_app_stored_recording *recording); + +/*! + * \brief Returns the extension for this recording. + * \since 14.0.0 + * + * \param recording Recording to query. + * + * \return The extension associated with this recording. + * \return \c NULL on error + */ +const char *stasis_app_stored_recording_get_extension( + struct stasis_app_stored_recording *recording); + +/*! * \brief Convert stored recording info to JSON. * * \param recording Recording to convert. diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h index 0e2f69ba8..2ca75a69c 100644 --- a/include/asterisk/strings.h +++ b/include/asterisk/strings.h @@ -688,7 +688,7 @@ void ast_str_trim_blanks(struct ast_str *buf), if (!buf) { return; } - while (buf->__AST_STR_USED && buf->__AST_STR_STR[buf->__AST_STR_USED - 1] < 33) { + while (buf->__AST_STR_USED && ((unsigned char) buf->__AST_STR_STR[buf->__AST_STR_USED - 1]) < 33) { buf->__AST_STR_STR[--(buf->__AST_STR_USED)] = '\0'; } } |