Changeset 230
- Timestamp:
- Feb 25, 2006 9:16:36 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h
r127 r230 46 46 * - it manages listeners and transports, and how they are used by 47 47 * transactions. 48 * - it owns transaction hash table.49 48 * - it receives incoming messages from transport layer and automatically 50 49 * dispatches them to the correct transaction (or create a new one). … … 53 52 * - it provides single polling function for all objects and distributes 54 53 * events. 55 * - it provides SIP policy such as which outbound proxy to use for all56 * outgoing SIP request messages.57 54 * - it automatically handles incoming requests which can not be handled by 58 55 * existing modules (such as when incoming request has unsupported method). … … 142 139 PJ_DECL(void) pjsip_endpt_cancel_timer( pjsip_endpoint *endpt, 143 140 pj_timer_entry *entry ); 144 145 146 /**147 * Dump endpoint status to the log. This will print the status to the log148 * with log level 3.149 *150 * @param endpt The endpoint.151 * @param detail If non zero, then it will dump a detailed output.152 * BEWARE that this option may crash the system because153 * it tries to access all memory pools.154 */155 PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail );156 141 157 142 … … 395 380 /** 396 381 * Get list of additional headers to be put in outgoing request message. 382 * Currently only Max-Forwards are defined. 397 383 * 398 384 * @param e The endpoint. … … 404 390 405 391 /** 406 * Set list of SIP proxies to be visited for all outbound request messages. 407 * Application can call this function to specify how outgoing request messages 408 * should be routed. For example, if outgoing requests should go through an 409 * outbound proxy, then application can specify the URL of the proxy when 410 * calling this function. More than one proxy can be specified, and the 411 * order of which proxy is specified when calling this function specifies 412 * the order of which proxy will be visited first by the request messages. 413 * 414 * @param endpt The endpoint instance. 415 * @param url_cnt Number of proxies/URLs in the array. 416 * @param url Array of proxy URL, which specifies the order of which 417 * proxy will be visited first (e.g. url[0] will be visited 418 * before url[1]). 419 * 420 * @return Zero on success. 421 */ 422 PJ_DECL(pj_status_t) pjsip_endpt_set_proxies( pjsip_endpoint *endpt, 423 int url_cnt, const pj_str_t url[]); 424 425 /** 426 * Get the list of "Route" header that are configured for this endpoint. 427 * The "Route" header specifies how outbound request messages will be sent, 428 * and is built when application sets the outbound proxy. 429 * 430 * @param endpt The endpoint instance. 431 * 432 * @return List of "Route" header. 433 */ 434 PJ_DECL(const pjsip_route_hdr*) pjsip_endpt_get_routing( pjsip_endpoint *endpt ); 392 * Dump endpoint status to the log. This will print the status to the log 393 * with log level 3. 394 * 395 * @param endpt The endpoint. 396 * @param detail If non zero, then it will dump a detailed output. 397 * BEWARE that this option may crash the system because 398 * it tries to access all memory pools. 399 */ 400 PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail ); 401 402 435 403 436 404 /** -
pjproject/trunk/pjsip/include/pjsip/sip_module.h
r127 r230 62 62 */ 63 63 int priority; 64 65 /**66 * Opaque data which can be used by a module to identify a resource within67 * the module itself.68 */69 void *user_data;70 64 71 65 /** … … 167 161 PJSIP_MOD_PRIORITY_TSX_LAYER = 16, 168 162 PJSIP_MOD_PRIORITY_UA_PROXY_LAYER = 32, 163 PJSIP_MOD_PRIORITY_DIALOG_USAGE = 48, 169 164 PJSIP_MOD_PRIORITY_APPLICATION = 64, 170 165 }; -
pjproject/trunk/pjsip/include/pjsip/sip_transaction.h
r195 r230 121 121 * @return PJ_SUCCESS on success. 122 122 */ 123 PJ_DECL(pj_status_t) pjsip_tsx_layer_init (pjsip_endpoint *endpt);123 PJ_DECL(pj_status_t) pjsip_tsx_layer_init_module(pjsip_endpoint *endpt); 124 124 125 125 /** -
pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h
r169 r230 56 56 * @return PJ_SUCCESS on success. 57 57 */ 58 PJ_DECL(pj_status_t) pjsip_ua_init (pjsip_endpoint *endpt,59 58 PJ_DECL(pj_status_t) pjsip_ua_init_module(pjsip_endpoint *endpt, 59 const pjsip_ua_init_param *prm); 60 60 61 61 /** -
pjproject/trunk/pjsip/src/pjsip-simple/evsub.c
r212 r230 170 170 { 171 171 { 172 NULL, NULL, /* prev, next. */ 173 { "mod-evsub", 9 }, /* Name. */ 174 -1, /* Id */ 175 PJSIP_MOD_PRIORITY_APPLICATION-1, /* Priority */ 176 NULL, /* User data. */ 177 NULL, /* load() */ 178 NULL, /* start() */ 179 NULL, /* stop() */ 180 &mod_evsub_unload, /* unload() */ 181 NULL, /* on_rx_request() */ 182 NULL, /* on_rx_response() */ 183 NULL, /* on_tx_request. */ 184 NULL, /* on_tx_response() */ 185 &mod_evsub_on_tsx_state, /* on_tsx_state() */ 172 NULL, NULL, /* prev, next. */ 173 { "mod-evsub", 9 }, /* Name. */ 174 -1, /* Id */ 175 PJSIP_MOD_PRIORITY_DIALOG_USAGE, /* Priority */ 176 NULL, /* load() */ 177 NULL, /* start() */ 178 NULL, /* stop() */ 179 &mod_evsub_unload, /* unload() */ 180 NULL, /* on_rx_request() */ 181 NULL, /* on_rx_response() */ 182 NULL, /* on_tx_request. */ 183 NULL, /* on_tx_response() */ 184 &mod_evsub_on_tsx_state, /* on_tsx_state() */ 186 185 } 187 186 }; -
pjproject/trunk/pjsip/src/pjsip-simple/presence.c
r212 r230 42 42 { "mod-presence", 12 }, /* Name. */ 43 43 -1, /* Id */ 44 PJSIP_MOD_PRIORITY_APPLICATION-1, /* Priority */ 45 NULL, /* User data. */ 44 PJSIP_MOD_PRIORITY_DIALOG_USAGE,/* Priority */ 46 45 NULL, /* load() */ 47 46 NULL, /* start() */ -
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r223 r230 71 71 { 72 72 { 73 NULL, NULL, /* prev, next. */ 74 { "mod-invite", 10 }, /* Name. */ 75 -1, /* Id */ 76 PJSIP_MOD_PRIORITY_APPLICATION-1, /* Priority */ 77 NULL, /* User data. */ 78 &mod_inv_load, /* load() */ 79 NULL, /* start() */ 80 NULL, /* stop() */ 81 &mod_inv_unload, /* unload() */ 82 &mod_inv_on_rx_request, /* on_rx_request() */ 83 &mod_inv_on_rx_response, /* on_rx_response() */ 84 NULL, /* on_tx_request. */ 85 NULL, /* on_tx_response() */ 86 &mod_inv_on_tsx_state, /* on_tsx_state() */ 73 NULL, NULL, /* prev, next. */ 74 { "mod-invite", 10 }, /* Name. */ 75 -1, /* Id */ 76 PJSIP_MOD_PRIORITY_DIALOG_USAGE, /* Priority */ 77 &mod_inv_load, /* load() */ 78 NULL, /* start() */ 79 NULL, /* stop() */ 80 &mod_inv_unload, /* unload() */ 81 &mod_inv_on_rx_request, /* on_rx_request() */ 82 &mod_inv_on_rx_response, /* on_rx_response() */ 83 NULL, /* on_tx_request. */ 84 NULL, /* on_tx_response() */ 85 &mod_inv_on_tsx_state, /* on_tsx_state() */ 87 86 } 88 87 }; -
pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c
r212 r230 34 34 static struct pjsip_module mod_xfer = 35 35 { 36 NULL, NULL, /* prev, next. */ 37 { "mod-refer", 9 }, /* Name. */ 38 -1, /* Id */ 39 PJSIP_MOD_PRIORITY_APPLICATION-1, /* Priority */ 40 NULL, /* User data. */ 41 NULL, /* load() */ 42 NULL, /* start() */ 43 NULL, /* stop() */ 44 NULL, /* unload() */ 45 NULL, /* on_rx_request() */ 46 NULL, /* on_rx_response() */ 47 NULL, /* on_tx_request. */ 48 NULL, /* on_tx_response() */ 49 NULL, /* on_tsx_state() */ 36 NULL, NULL, /* prev, next. */ 37 { "mod-refer", 9 }, /* Name. */ 38 -1, /* Id */ 39 PJSIP_MOD_PRIORITY_DIALOG_USAGE, /* Priority */ 40 NULL, /* load() */ 41 NULL, /* start() */ 42 NULL, /* stop() */ 43 NULL, /* unload() */ 44 NULL, /* on_rx_request() */ 45 NULL, /* on_rx_response() */ 46 NULL, /* on_tx_request. */ 47 NULL, /* on_tx_response() */ 48 NULL, /* on_tsx_state() */ 50 49 }; 51 50 -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r212 r230 78 78 pjsip_module module_list; 79 79 80 /** Route header list. */81 pjsip_route_hdr route_hdr_list;82 83 80 /** Capability header list. */ 84 81 pjsip_hdr cap_hdr; … … 371 368 } 372 369 373 PJ_DEF(pj_status_t) pjsip_endpt_set_proxies( pjsip_endpoint *endpt,374 int url_cnt, const pj_str_t url[])375 {376 int i;377 pjsip_route_hdr *hdr;378 pj_str_t str_ROUTE = { "Route", 5 };379 380 /* Lock endpoint mutex. */381 pj_mutex_lock(endpt->mutex);382 383 pj_list_init(&endpt->route_hdr_list);384 385 for (i=0; i<url_cnt; ++i) {386 int len = url[i].slen;387 char *dup = pj_pool_alloc(endpt->pool, len + 1);388 pj_memcpy(dup, url[i].ptr, len);389 dup[len] = '\0';390 391 hdr = pjsip_parse_hdr(endpt->pool, &str_ROUTE, dup, len, NULL);392 if (!hdr) {393 pj_mutex_unlock(endpt->mutex);394 PJ_LOG(4,(THIS_FILE, "Invalid URL %s in proxy URL", dup));395 return -1;396 }397 398 pj_assert(hdr->type == PJSIP_H_ROUTE);399 pj_list_insert_before(&endpt->route_hdr_list, hdr);400 }401 402 /* Unlock endpoint mutex. */403 pj_mutex_unlock(endpt->mutex);404 405 return 0;406 }407 408 /*409 * Get "Route" header list.410 */411 PJ_DEF(const pjsip_route_hdr*) pjsip_endpt_get_routing( pjsip_endpoint *endpt )412 {413 return &endpt->route_hdr_list;414 }415 416 370 417 371 /* … … 521 475 /* Initialize request headers. */ 522 476 pj_list_init(&endpt->req_hdr); 523 524 /* Initialist "Route" header list. */525 pj_list_init(&endpt->route_hdr_list);526 477 527 478 /* Add "Max-Forwards" for request header. */ -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r195 r230 68 68 -1, /* Module ID */ 69 69 PJSIP_MOD_PRIORITY_TSX_LAYER, /* Priority. */ 70 NULL, /* User_data. */71 70 mod_tsx_layer_load, /* load(). */ 72 71 mod_tsx_layer_start, /* start() */ … … 411 410 * Create transaction layer module and registers it to the endpoint. 412 411 */ 413 PJ_DEF(pj_status_t) pjsip_tsx_layer_init (pjsip_endpoint *endpt)412 PJ_DEF(pj_status_t) pjsip_tsx_layer_init_module(pjsip_endpoint *endpt) 414 413 { 415 414 pj_pool_t *pool; -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r184 r230 48 48 -1, /* Id */ 49 49 PJSIP_MOD_PRIORITY_TRANSPORT_LAYER, /* Priority */ 50 NULL, /* User data. */51 50 NULL, /* load() */ 52 51 NULL, /* start() */ -
pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c
r197 r230 90 90 -1, /* Id */ 91 91 PJSIP_MOD_PRIORITY_UA_PROXY_LAYER, /* Priority */ 92 NULL, /* User data. */93 92 &mod_ua_load, /* load() */ 94 93 NULL, /* start() */ … … 183 182 * Init user agent module and register it to the endpoint. 184 183 */ 185 PJ_DEF(pj_status_t) pjsip_ua_init ( pjsip_endpoint *endpt,186 184 PJ_DEF(pj_status_t) pjsip_ua_init_module( pjsip_endpoint *endpt, 185 const pjsip_ua_init_param *prm) 187 186 { 188 187 pj_status_t status; -
pjproject/trunk/pjsip/src/pjsip/sip_util_statefull.c
r141 r230 42 42 -1, /* Id */ 43 43 PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ 44 NULL, /* User data. */45 44 NULL, /* load() */ 46 45 NULL, /* start() */ -
pjproject/trunk/pjsip/src/pjsua/main.c
r226 r230 282 282 } 283 283 } 284 printf("Port #%02d %20.*s t xto: %s\n",284 printf("Port #%02d %20.*s transmitting to: %s\n", 285 285 port_info->slot, 286 286 (int)port_info->name.slen, … … 680 680 -1, /* Id */ 681 681 PJSIP_MOD_PRIORITY_TRANSPORT_LAYER-1,/* Priority */ 682 NULL, /* User data. */683 682 NULL, /* load() */ 684 683 NULL, /* start() */ … … 765 764 int main(int argc, char *argv[]) 766 765 { 766 767 767 /* Init default settings. */ 768 768 -
pjproject/trunk/pjsip/src/pjsua/pjsua_core.c
r222 r230 345 345 /* Initialize transaction layer: */ 346 346 347 status = pjsip_tsx_layer_init (pjsua.endpt);347 status = pjsip_tsx_layer_init_module(pjsua.endpt); 348 348 if (status != PJ_SUCCESS) { 349 349 pjsua_perror(THIS_FILE, "Transaction layer initialization error", … … 354 354 /* Initialize UA layer module: */ 355 355 356 status = pjsip_ua_init ( pjsua.endpt, NULL );356 status = pjsip_ua_init_module( pjsua.endpt, NULL ); 357 357 if (status != PJ_SUCCESS) { 358 358 pjsua_perror(THIS_FILE, "UA layer initialization error", status); … … 369 369 -1, /* Id */ 370 370 PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ 371 NULL, /* User data. */372 371 NULL, /* load() */ 373 372 NULL, /* start() */ -
pjproject/trunk/pjsip/src/pjsua/pjsua_pres.c
r201 r230 44 44 -1, /* Id */ 45 45 PJSIP_MOD_PRIORITY_APPLICATION, /* Priority */ 46 NULL, /* User data. */47 46 NULL, /* load() */ 48 47 NULL, /* start() */
Note: See TracChangeset
for help on using the changeset viewer.