mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Add support for reserving a fax session before answering the channel.
Note: this change breaks ABI compatibility. FAX-217 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@297486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -58,8 +58,10 @@ enum ast_fax_modems { | ||||
|  | ||||
| /*! \brief current state of a fax session */ | ||||
| enum ast_fax_state { | ||||
| 	/*! reserved state */ | ||||
| 	AST_FAX_STATE_RESERVED = 0, | ||||
| 	/*! uninitialized state */ | ||||
| 	AST_FAX_STATE_UNINITIALIZED = 0, | ||||
| 	AST_FAX_STATE_UNINITIALIZED, | ||||
| 	/*! initialized state */ | ||||
| 	AST_FAX_STATE_INITIALIZED, | ||||
| 	/*! fax resources open state */ | ||||
| @@ -168,7 +170,8 @@ struct ast_fax_session_details { | ||||
|  | ||||
| struct ast_fax_tech; | ||||
| struct ast_fax_debug_info; | ||||
| 	 | ||||
| struct ast_fax_tech_token; | ||||
|  | ||||
| /*! \brief The data required to handle a fax session */ | ||||
| struct ast_fax_session { | ||||
| 	/*! session id */ | ||||
| @@ -183,6 +186,8 @@ struct ast_fax_session { | ||||
| 	unsigned long frames_sent; | ||||
| 	/*! the fax technology callbacks */ | ||||
| 	const struct ast_fax_tech *tech; | ||||
| 	/*! the token used to reserve this session */ | ||||
| 	struct ast_fax_tech_token *token; | ||||
| 	/*! private implementation pointer */ | ||||
| 	void *tech_pvt; | ||||
| 	/*! fax state */ | ||||
| @@ -197,9 +202,11 @@ struct ast_fax_session { | ||||
| 	struct ast_fax_debug_info *debug_info; | ||||
| 	/*! used to take variable-sized frames in and output frames of an expected size to the fax stack */ | ||||
| 	struct ast_smoother *smoother; | ||||
| }; | ||||
|  | ||||
| struct ast_fax_tech_token; | ||||
| 	/*! some flags to track the stat counters for this session */ | ||||
| 	unsigned int reserved:1; | ||||
| 	unsigned int active:1; | ||||
| }; | ||||
|  | ||||
| /*! \brief used to register a FAX technology module with res_fax */ | ||||
| struct ast_fax_tech { | ||||
| @@ -242,7 +249,15 @@ struct ast_fax_tech { | ||||
| 	/*! displays settings from the fax technology module */ | ||||
| 	char * (* const cli_show_settings)(int); | ||||
| }; | ||||
|    | ||||
|  | ||||
| /*! \brief used by res_fax to reserve a FAX session */ | ||||
| struct ast_fax_tech_token { | ||||
| 	/*! the fax technology callbacks */ | ||||
| 	const struct ast_fax_tech *tech; | ||||
| 	/*! private implementation pointer */ | ||||
| 	void *tech_pvt; | ||||
| }; | ||||
|  | ||||
| /*! \brief register a fax technology */ | ||||
| int ast_fax_tech_register(struct ast_fax_tech *tech); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user