Changeset 230


Ignore:
Timestamp:
Feb 25, 2006 9:16:36 PM (18 years ago)
Author:
bennylp
Message:

Tidying up and make it consistent with the documentation

Location:
pjproject/trunk/pjsip
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h

    r127 r230  
    4646 *  - it manages listeners and transports, and how they are used by  
    4747 *    transactions. 
    48  *  - it owns transaction hash table. 
    4948 *  - it receives incoming messages from transport layer and automatically 
    5049 *    dispatches them to the correct transaction (or create a new one). 
     
    5352 *  - it provides single polling function for all objects and distributes  
    5453 *    events. 
    55  *  - it provides SIP policy such as which outbound proxy to use for all 
    56  *    outgoing SIP request messages. 
    5754 *  - it automatically handles incoming requests which can not be handled by 
    5855 *    existing modules (such as when incoming request has unsupported method). 
     
    142139PJ_DECL(void) pjsip_endpt_cancel_timer( pjsip_endpoint *endpt,  
    143140                                        pj_timer_entry *entry ); 
    144  
    145  
    146 /** 
    147  * Dump endpoint status to the log. This will print the status to the log 
    148  * 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 because 
    153  *                      it tries to access all memory pools. 
    154  */ 
    155 PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail ); 
    156141 
    157142 
     
    395380/** 
    396381 * Get list of additional headers to be put in outgoing request message. 
     382 * Currently only Max-Forwards are defined. 
    397383 * 
    398384 * @param e         The endpoint. 
     
    404390 
    405391/** 
    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 */ 
     400PJ_DECL(void) pjsip_endpt_dump( pjsip_endpoint *endpt, pj_bool_t detail ); 
     401 
     402 
    435403 
    436404/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_module.h

    r127 r230  
    6262     */ 
    6363    int priority; 
    64  
    65     /** 
    66      * Opaque data which can be used by a module to identify a resource within 
    67      * the module itself. 
    68      */ 
    69     void *user_data; 
    7064 
    7165    /** 
     
    167161    PJSIP_MOD_PRIORITY_TSX_LAYER        = 16, 
    168162    PJSIP_MOD_PRIORITY_UA_PROXY_LAYER   = 32, 
     163    PJSIP_MOD_PRIORITY_DIALOG_USAGE     = 48, 
    169164    PJSIP_MOD_PRIORITY_APPLICATION      = 64, 
    170165}; 
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r195 r230  
    121121 * @return          PJ_SUCCESS on success. 
    122122 */ 
    123 PJ_DECL(pj_status_t) pjsip_tsx_layer_init(pjsip_endpoint *endpt); 
     123PJ_DECL(pj_status_t) pjsip_tsx_layer_init_module(pjsip_endpoint *endpt); 
    124124 
    125125/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_ua_layer.h

    r169 r230  
    5656 * @return              PJ_SUCCESS on success. 
    5757 */ 
    58 PJ_DECL(pj_status_t) pjsip_ua_init(pjsip_endpoint *endpt, 
    59                                    const pjsip_ua_init_param *prm); 
     58PJ_DECL(pj_status_t) pjsip_ua_init_module(pjsip_endpoint *endpt, 
     59                                          const pjsip_ua_init_param *prm); 
    6060 
    6161/** 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r212 r230  
    170170{ 
    171171    { 
    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()           */ 
    186185    } 
    187186}; 
  • pjproject/trunk/pjsip/src/pjsip-simple/presence.c

    r212 r230  
    4242    { "mod-presence", 12 },         /* Name.                            */ 
    4343    -1,                             /* Id                               */ 
    44     PJSIP_MOD_PRIORITY_APPLICATION-1,   /* Priority                     */ 
    45     NULL,                           /* User data.                       */ 
     44    PJSIP_MOD_PRIORITY_DIALOG_USAGE,/* Priority                         */ 
    4645    NULL,                           /* load()                           */ 
    4746    NULL,                           /* start()                          */ 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r223 r230  
    7171{ 
    7272    { 
    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()           */ 
    8786    } 
    8887}; 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_xfer.c

    r212 r230  
    3434static struct pjsip_module mod_xfer =  
    3535{ 
    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()               */ 
    5049}; 
    5150 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r212 r230  
    7878    pjsip_module         module_list; 
    7979 
    80     /** Route header list. */ 
    81     pjsip_route_hdr      route_hdr_list; 
    82  
    8380    /** Capability header list. */ 
    8481    pjsip_hdr            cap_hdr; 
     
    371368} 
    372369 
    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  
    416370 
    417371/* 
     
    521475    /* Initialize request headers. */ 
    522476    pj_list_init(&endpt->req_hdr); 
    523  
    524     /* Initialist "Route" header list. */ 
    525     pj_list_init(&endpt->route_hdr_list); 
    526477 
    527478    /* Add "Max-Forwards" for request header. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r195 r230  
    6868        -1,                             /* Module ID                */ 
    6969        PJSIP_MOD_PRIORITY_TSX_LAYER,   /* Priority.                */ 
    70         NULL,                           /* User_data.               */ 
    7170        mod_tsx_layer_load,             /* load().                  */ 
    7271        mod_tsx_layer_start,            /* start()                  */ 
     
    411410 * Create transaction layer module and registers it to the endpoint. 
    412411 */ 
    413 PJ_DEF(pj_status_t) pjsip_tsx_layer_init(pjsip_endpoint *endpt) 
     412PJ_DEF(pj_status_t) pjsip_tsx_layer_init_module(pjsip_endpoint *endpt) 
    414413{ 
    415414    pj_pool_t *pool; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r184 r230  
    4848    -1,                                 /* Id                               */ 
    4949    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER, /* Priority                         */ 
    50     NULL,                               /* User data.                       */ 
    5150    NULL,                               /* load()                           */ 
    5251    NULL,                               /* start()                          */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r197 r230  
    9090    -1,                     /* Id                               */ 
    9191    PJSIP_MOD_PRIORITY_UA_PROXY_LAYER,  /* Priority             */ 
    92     NULL,                   /* User data.                       */ 
    9392    &mod_ua_load,           /* load()                           */ 
    9493    NULL,                   /* start()                          */ 
     
    183182 * Init user agent module and register it to the endpoint. 
    184183 */ 
    185 PJ_DEF(pj_status_t) pjsip_ua_init( pjsip_endpoint *endpt, 
    186                                    const pjsip_ua_init_param *prm) 
     184PJ_DEF(pj_status_t) pjsip_ua_init_module( pjsip_endpoint *endpt, 
     185                                          const pjsip_ua_init_param *prm) 
    187186{ 
    188187    pj_status_t status; 
  • pjproject/trunk/pjsip/src/pjsip/sip_util_statefull.c

    r141 r230  
    4242    -1,                             /* Id                               */ 
    4343    PJSIP_MOD_PRIORITY_APPLICATION, /* Priority                         */ 
    44     NULL,                           /* User data.                       */ 
    4544    NULL,                           /* load()                           */ 
    4645    NULL,                           /* start()                          */ 
  • pjproject/trunk/pjsip/src/pjsua/main.c

    r226 r230  
    282282            } 
    283283        } 
    284         printf("Port #%02d %20.*s  tx to: %s\n",  
     284        printf("Port #%02d %20.*s  transmitting to: %s\n",  
    285285               port_info->slot,  
    286286               (int)port_info->name.slen,  
     
    680680    -1,                                 /* Id                   */ 
    681681    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER-1,/* Priority            */ 
    682     NULL,                               /* User data.           */ 
    683682    NULL,                               /* load()               */ 
    684683    NULL,                               /* start()              */ 
     
    765764int main(int argc, char *argv[]) 
    766765{ 
     766 
    767767    /* Init default settings. */ 
    768768 
  • pjproject/trunk/pjsip/src/pjsua/pjsua_core.c

    r222 r230  
    345345    /* Initialize transaction layer: */ 
    346346 
    347     status = pjsip_tsx_layer_init(pjsua.endpt); 
     347    status = pjsip_tsx_layer_init_module(pjsua.endpt); 
    348348    if (status != PJ_SUCCESS) { 
    349349        pjsua_perror(THIS_FILE, "Transaction layer initialization error",  
     
    354354    /* Initialize UA layer module: */ 
    355355 
    356     status = pjsip_ua_init( pjsua.endpt, NULL ); 
     356    status = pjsip_ua_init_module( pjsua.endpt, NULL ); 
    357357    if (status != PJ_SUCCESS) { 
    358358        pjsua_perror(THIS_FILE, "UA layer initialization error", status); 
     
    369369        -1,                         /* Id                               */ 
    370370        PJSIP_MOD_PRIORITY_APPLICATION, /* Priority                     */ 
    371         NULL,                       /* User data.                       */ 
    372371        NULL,                       /* load()                           */ 
    373372        NULL,                       /* start()                          */ 
  • pjproject/trunk/pjsip/src/pjsua/pjsua_pres.c

    r201 r230  
    4444    -1,                                 /* Id                   */ 
    4545    PJSIP_MOD_PRIORITY_APPLICATION,     /* Priority             */ 
    46     NULL,                               /* User data.           */ 
    4746    NULL,                               /* load()               */ 
    4847    NULL,                               /* start()              */ 
Note: See TracChangeset for help on using the changeset viewer.