Changeset 106 for pjproject/trunk/pjsip/include/pjsip/sip_module.h
- Timestamp:
- Dec 30, 2005 11:50:15 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_module.h
r65 r106 42 42 struct pjsip_module 43 43 { 44 /** To allow chaining of modules in the endpoint. */ 45 PJ_DECL_LIST_MEMBER(struct pjsip_module); 46 44 47 /** 45 48 * Module name. … … 48 51 49 52 /** 50 * Flag to indicate the type of interfaces supported by the module.53 * Module ID. 51 54 */ 52 pj_uint32_t flag;55 int id; 53 56 54 57 /** … … 57 60 * initialized later. 58 61 */ 59 pj_uint32_t priority;62 int priority; 60 63 61 64 /** … … 63 66 * the module itself. 64 67 */ 65 void * mod_data;68 void *user_data; 66 69 67 70 /** … … 79 82 * 80 83 * @param endpt The endpoint instance. 81 * @param mod The module. 82 * @param id The unique module ID assigned to this module. 83 * 84 * @return Module should return zero when initialization succeed. 84 * @return Module should return PJ_SUCCESS to indicate success. 85 85 */ 86 pj_status_t (*init_module)(pjsip_endpoint *endpt, 87 struct pjsip_module *mod, pj_uint32_t id); 86 pj_status_t (*load)(pjsip_endpoint *endpt); 88 87 89 88 /** 90 89 * Pointer to function to be called to start the module. 91 90 * 92 * @param mod The module.93 *94 91 * @return Module should return zero to indicate success. 95 92 */ 96 pj_status_t (*start_module)(struct pjsip_module *mod); 93 pj_status_t (*start)(void); 94 95 /** 96 * Pointer to function to be called to deinitialize the module before 97 * it is unloaded. 98 * 99 * @return Module should return PJ_SUCCESS to indicate success. 100 */ 101 pj_status_t (*stop)(void); 97 102 98 103 /** … … 102 107 * @param mod The module. 103 108 * 104 * @return Module should return zeroto indicate success.109 * @return Module should return PJ_SUCCESS to indicate success. 105 110 */ 106 pj_status_t (* deinit_module)(struct pjsip_module *mod);111 pj_status_t (*unload)(void); 107 112 108 113 /** 109 * Pointer to function to receive transaction related events. 110 * If the module doesn't wish to receive such notification, this member 111 * must be set to NULL. 114 * Called to process incoming request. 112 115 * 113 * @param mod The module. 114 * @param event The transaction event. 116 * @param rdata The incoming message. 117 * 118 * @return Module should return PJ_TRUE if it handles the request, 119 * or otherwise it should return PJ_FALSE to allow other 120 * modules to handle the request. 115 121 */ 116 void (*tsx_handler)(struct pjsip_module *mod, pjsip_event *event); 122 pj_bool_t (*on_rx_request)(pjsip_rx_data *rdata); 123 124 /** 125 * Called to processed incoming response. 126 * 127 * @param rdata The incoming message. 128 * 129 * @return Module should return PJ_TRUE if it handles the 130 * response, or otherwise it should return PJ_FALSE to 131 * allow other modules to handle the response. 132 */ 133 pj_bool_t (*on_rx_response)(pjsip_rx_data *rdata); 134 135 /** 136 * Called when this module is acting as transaction user for the specified 137 * transaction, when the transaction's state has changed. 138 * 139 * @param tsx The transaction. 140 * @param event The event which has caused the transaction state 141 * to change. 142 */ 143 void (*on_tsx_state)(pjsip_transaction *tsx, pjsip_event *event); 144 117 145 }; 118 146 119 147 120 148 /** 121 * Prototype of function to register static modules (eg modules that are 122 * linked staticly with the application). This function must be implemented 123 * by any applications that use PJSIP library. 124 * 125 * @param count [input/output] On input, it contains the maximum number of 126 * elements in the array. On output, the function fills with 127 * the number of modules to be registered. 128 * @param modules [output] array of pointer to modules to be registered. 149 * Module priority guidelines. 129 150 */ 130 pj_status_t register_static_modules( pj_size_t *count, 131 pjsip_module **modules ); 151 enum pjsip_module_priority 152 { 153 PJSIP_MOD_PRIORITY_TSX_LAYER = 4, 154 PJSIP_MOD_PRIORITY_UA_PROXY_LAYER = 16, 155 PJSIP_MOD_PRIORITY_APPLICATION = 32, 156 }; 157 132 158 133 159 /**
Note: See TracChangeset
for help on using the changeset viewer.