mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	res_pjsip: Add utils for checking media types
Added two new functions to assist checking media types... * ast_sip_are_media_types_equal compares two pjsip_media_types. * ast_sip_is_media_type_in tests if one media type is in a list of others. Added static definitions for commonly used media types to res_pjsip.h. Changed several modules to use the new functions and static definitions. ASTERISK_29813 (not ready to close) Change-Id: Ief77675235bd3bf00a6b095d4673fd878d0801b9
This commit is contained in:
		
				
					committed by
					
						 Joshua Colp
						Joshua Colp
					
				
			
			
				
	
			
			
			
						parent
						
							b59bd3d3e4
						
					
				
				
					commit
					59cf9f0047
				
			| @@ -953,6 +953,40 @@ struct ast_sip_endpoint { | ||||
| #define AST_SIP_X_AST_TXP "x-ast-txp" | ||||
| #define AST_SIP_X_AST_TXP_LEN 9 | ||||
|  | ||||
| /*! Common media types used throughout res_pjsip and pjproject */ | ||||
| extern pjsip_media_type pjsip_media_type_application_json; | ||||
| extern pjsip_media_type pjsip_media_type_application_media_control_xml; | ||||
| extern pjsip_media_type pjsip_media_type_application_pidf_xml; | ||||
| extern pjsip_media_type pjsip_media_type_application_xpidf_xml; | ||||
| extern pjsip_media_type pjsip_media_type_application_cpim_xpidf_xml; | ||||
| extern pjsip_media_type pjsip_media_type_application_rlmi_xml; | ||||
| extern pjsip_media_type pjsip_media_type_application_simple_message_summary; | ||||
| extern pjsip_media_type pjsip_media_type_application_sdp; | ||||
| extern pjsip_media_type pjsip_media_type_multipart_alternative; | ||||
| extern pjsip_media_type pjsip_media_type_multipart_mixed; | ||||
| extern pjsip_media_type pjsip_media_type_multipart_related; | ||||
| extern pjsip_media_type pjsip_media_type_text_plain; | ||||
|  | ||||
| /*! | ||||
|  * \brief Compare pjsip media types | ||||
|  * | ||||
|  * \param pjsip_media_type a | ||||
|  * \param pjsip_media_type b | ||||
|  * \retval 1 Media types are equal | ||||
|  * \retval 0 Media types are not equal | ||||
|  */ | ||||
| int ast_sip_are_media_types_equal(pjsip_media_type *a, pjsip_media_type *b); | ||||
|  | ||||
| /*! | ||||
|  * \brief Check if a media type is in a list of others | ||||
|  * | ||||
|  * \param a pjsip_media_type to search for | ||||
|  * \param ... one or more pointers to pjsip_media_types the last of which must be "SENTINEL" | ||||
|  * \retval 1 Media types are equal | ||||
|  * \retval 0 Media types are not equal | ||||
|  */ | ||||
| int ast_sip_is_media_type_in(pjsip_media_type *a, ...) attribute_sentinel; | ||||
|  | ||||
| /*! | ||||
|  * \brief Initialize an auth vector with the configured values. | ||||
|  * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user