Changeset 127


Ignore:
Timestamp:
Jan 30, 2006 6:40:05 PM (18 years ago)
Author:
bennylp
Message:

Finished implementation of UA layer (to be tested)

Location:
pjproject/trunk
Files:
7 added
5 deleted
42 edited
1 moved

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj++/list.hpp

    r65 r127  
    6464        const_iterator operator++()  
    6565        {  
    66             return const_iterator(node_->next);  
     66            return const_iterator((const List_Node *)node_->next);  
    6767        } 
    6868        bool operator==(const const_iterator &rhs)  
     
    100100        iterator operator++()  
    101101        {  
    102             return iterator(node_->next);  
     102            return iterator((List_Node*)node_->next);  
    103103        } 
    104104        bool operator==(const iterator &rhs)  
     
    122122 
    123123    // 
     124    // You can cast Pj_List to pj_list 
     125    // 
     126    operator pj_list&() 
     127    { 
     128        return (pj_list&)root_; 
     129    } 
     130    operator const pj_list&() 
     131    { 
     132        return (const pj_list&)root_; 
     133    } 
     134 
     135    // 
     136    // You can cast Pj_List to pj_list* too 
     137    // 
     138    operator pj_list*() 
     139    { 
     140        return (pj_list*)&root_; 
     141    } 
     142    operator const pj_list*() 
     143    { 
     144        return (const pj_list*)&root_; 
     145    } 
     146 
     147    // 
    124148    // Check if list is empty. 
    125149    //  
     
    319343        // it's because List_Node is not derived from Pj_List_Node. 
    320344        List_Node *n = (List_Node*)0; 
    321         n = n->next; n = n->prev; 
     345        n = (List_Node *)n->next; n = (List_Node *)n->prev; 
    322346    } 
    323347}; 
  • pjproject/trunk/pjlib/include/pj++/pool.hpp

    r65 r127  
    124124 
    125125    // 
     126    // You can cast Pj_Pool to pj_pool_t* 
     127    // 
     128    operator pj_pool_t*() 
     129    { 
     130        return p_; 
     131    } 
     132 
     133    // 
    126134    // Get pjlib compatible pool object. 
    127135    // 
  • pjproject/trunk/pjlib/include/pj++/string.hpp

    r122 r127  
    4141 
    4242    // 
    43     // Construct the buffer from a char*. 
    44     // 
    45     explicit Pj_String(char *str)  
     43    // Construct the buffer from a char* (use with care) 
     44    // 
     45    Pj_String(char *str)  
    4646    {  
    4747        set(str); 
     
    5151    // Construct from a const char*. 
    5252    // 
    53     Pj_String(Pj_Pool *pool, const char *src) 
     53    Pj_String(Pj_Pool &pool, const char *src) 
    5454    { 
    5555        set(pool, src); 
     
    5757 
    5858    // 
    59     // Construct from pj_str_t*. 
    60     // 
    61     explicit Pj_String(pj_str_t *s) 
    62     { 
    63         set(s); 
     59    // Construct from pj_str_t&. 
     60    // 
     61    explicit Pj_String(pj_str_t &s) 
     62    { 
     63        ptr = s.ptr; 
     64        slen = s.slen; 
     65    } 
     66 
     67    // 
     68    // Construct from const pj_str_t& (use with care!). 
     69    // 
     70    explicit Pj_String(const pj_str_t &s) 
     71    { 
     72        ptr = (char*)s.ptr; 
     73        slen = s.slen; 
    6474    } 
    6575 
     
    6777    // Construct by copying from const pj_str_t*. 
    6878    // 
    69     Pj_String(Pj_Pool *pool, const pj_str_t *s) 
     79    Pj_String(Pj_Pool &pool, const pj_str_t *s) 
    7080    { 
    7181        set(pool, s); 
     
    7383 
    7484    // 
    75     // Construct from another Pj_String 
    76     // 
    77     explicit Pj_String(Pj_String &rhs) 
    78     { 
    79         set(rhs); 
    80     } 
    81  
    82     // 
    8385    // Construct by copying from Pj_String 
    8486    // 
    85     Pj_String(Pj_Pool *pool, const Pj_String &rhs) 
     87    Pj_String(Pj_Pool &pool, const Pj_String &rhs) 
    8688    { 
    8789        set(pool, rhs); 
     
    8991 
    9092    // 
     93    // Construct from another Pj_String, use with care! 
     94    // 
     95    explicit Pj_String(const Pj_String &rhs) 
     96    { 
     97        ptr = rhs.ptr; 
     98        slen = rhs.slen; 
     99    } 
     100 
     101    // 
    91102    // Construct from a char* and a length. 
    92103    // 
     
    105116 
    106117    // 
     118    // You can cast Pj_String to pj_str_t* 
     119    // 
     120    operator pj_str_t*() 
     121    { 
     122        return this; 
     123    } 
     124 
     125    // 
     126    // You can cast const Pj_String to const pj_str_t* 
     127    // 
     128    operator const pj_str_t*() const 
     129    { 
     130        return this; 
     131    } 
     132 
     133    // 
    107134    // Get the length of the string. 
    108135    // 
     
    139166    // Initialize by copying from a const char*. 
    140167    // 
    141     void set(Pj_Pool *pool, const char *s) 
    142     { 
    143         pj_strdup2(pool->pool_(), this, s); 
     168    void set(Pj_Pool &pool, const char *s) 
     169    { 
     170        pj_strdup2(pool, this, s); 
    144171    } 
    145172 
     
    155182    // Initialize by copying from const pj_str_t*. 
    156183    // 
    157     void set(Pj_Pool *pool, const pj_str_t *s) 
    158     { 
    159         pj_strdup(pool->pool_(), this, s); 
     184    void set(Pj_Pool &pool, const pj_str_t *s) 
     185    { 
     186        pj_strdup(pool, this, s); 
    160187    } 
    161188 
     
    187214    // Initialize by copying from a Pj_String*. 
    188215    // 
    189     void set(Pj_Pool *pool, const Pj_String *s) 
    190     { 
    191         pj_strdup(pool->pool_(), this, s); 
     216    void set(Pj_Pool &pool, const Pj_String *s) 
     217    { 
     218        pj_strdup(pool, this, s); 
    192219    } 
    193220 
     
    195222    // Initialize by copying from other Pj_String. 
    196223    // 
    197     void set(Pj_Pool *pool, const Pj_String &s) 
    198     { 
    199         pj_strdup(pool->pool_(), this, &s); 
     224    void set(Pj_Pool &pool, const Pj_String &s) 
     225    { 
     226        pj_strdup(pool, this, &s); 
    200227    } 
    201228 
     
    354381 
    355382    /// 
    356     // Assign from another Pj_String 
    357     // 
    358     Pj_String& operator=(Pj_String &rhs) 
    359     { 
    360         set(rhs); 
     383    // Assign from another Pj_String, use with care! 
     384    // 
     385    Pj_String& operator=(const Pj_String &rhs) 
     386    { 
     387        ptr = rhs.ptr; 
     388        slen = rhs.slen; 
    361389        return *this; 
    362390    } 
  • pjproject/trunk/pjlib/include/pj++/types.hpp

    r65 r127  
    157157}; 
    158158 
     159// 
     160// Macro to declare common object comparison operators. 
     161// 
     162#define PJ_DECLARE_OPERATORS(rhs_type)                      \ 
     163            bool operator!=(rhs_type rhs) const {           \ 
     164                return !operator==(rhs); }                  \ 
     165            bool operator<=(rhs_type rhs) const {           \ 
     166                return operator<(rhs) || operator==(rhs); } \ 
     167            bool operator>(rhs_type rhs) const {            \ 
     168                return !operator<=(rhs); }                  \ 
     169            bool operator>=(rhs_type rhs) const {           \ 
     170                return !operator<(rhs); } 
     171 
     172 
    159173#endif  /* __PJPP_TYPES_HPP__ */ 
    160174 
  • pjproject/trunk/pjlib/include/pj/assert.h

    r106 r127  
    5050/** 
    5151 * @hideinitializer 
    52  * If #PJ_ENABLE_EXTRA_CHECK is declared and non-zero, then  
     52 * If #PJ_ENABLE_EXTRA_CHECK is declared and the value is non-zero, then  
    5353 * #PJ_ASSERT_RETURN macro will evaluate the expression in @a expr during 
    5454 * run-time. If the expression yields false, assertion will be triggered 
  • pjproject/trunk/pjlib/include/pj/hash.h

    r66 r127  
    4646 
    4747/** 
     48 * This indicates the size of of each hash entry. 
     49 */ 
     50#define PJ_HASH_ENTRY_SIZE      (3*sizeof(void*) + 2*sizeof(pj_uint32_t)) 
     51 
     52/** 
    4853 * This is the function that is used by the hash table to calculate hash value 
    4954 * of the specified key. 
     
    9398 * @param keylen    the length of the key, or PJ_HASH_KEY_STRING to use the 
    9499 *                  string length of the key. 
     100 * @param hval      if this argument is not NULL and the value is not zero, 
     101 *                  the value will be used as the computed hash value. If 
     102 *                  the argument is not NULL and the value is zero, it will 
     103 *                  be filled with the computed hash upon return. 
    95104 * 
    96105 * @return the value associated with the key, or NULL if the key is not found. 
    97106 */ 
    98107PJ_DECL(void *) pj_hash_get( pj_hash_table_t *ht, 
    99                              const void *key, unsigned keylen ); 
    100  
    101  
    102 /** 
    103  * Associate/disassociate a value with the specified key. 
     108                             const void *key, unsigned keylen, 
     109                             pj_uint32_t *hval ); 
     110 
     111 
     112/** 
     113 * Associate/disassociate a value with the specified key. If value is not 
     114 * NULL and entry already exists, the entry's value will be overwritten. 
     115 * If value is not NULL and entry does not exist, a new one will be created 
     116 * with the specified pool. Otherwise if value is NULL, entry will be 
     117 * deleted if it exists. 
    104118 * 
    105119 * @param pool      the pool to allocate the new entry if a new entry has to be 
     
    109123 * @param keylen    the length of the key, or PJ_HASH_KEY_STRING to use the  
    110124 *                  string length of the key. 
     125 * @param hval      if the value is not zero, then the hash table will use 
     126 *                  this value to search the entry's index, otherwise it will 
     127 *                  compute the key. This value can be obtained when calling 
     128 *                  #pj_hash_get(). 
    111129 * @param value     value to be associated, or NULL to delete the entry with 
    112130 *                  the specified key. 
    113131 */ 
    114132PJ_DECL(void) pj_hash_set( pj_pool_t *pool, pj_hash_table_t *ht, 
    115                            const void *key, unsigned keylen, 
     133                           const void *key, unsigned keylen, pj_uint32_t hval, 
    116134                           void *value ); 
     135 
     136 
     137/** 
     138 * Associate/disassociate a value with the specified key. This function works 
     139 * like #pj_hash_set(), except that it doesn't use pool (hence the np -- no  
     140 * pool suffix). If new entry needs to be allocated, it will use the entry_buf. 
     141 * 
     142 * @param ht        the hash table. 
     143 * @param key       the key. 
     144 * @param keylen    the length of the key, or PJ_HASH_KEY_STRING to use the  
     145 *                  string length of the key. 
     146 * @param hval      if the value is not zero, then the hash table will use 
     147 *                  this value to search the entry's index, otherwise it will 
     148 *                  compute the key. This value can be obtained when calling 
     149 *                  #pj_hash_get(). 
     150 * @param entry_buf Pointer to buffer which will be used for the new entry, 
     151 *                  when one needs to be created. The buffer must be at least 
     152 *                  PJ_HASH_ENTRY_SIZE long, and the first PJ_HASH_ENTRY_SIZE 
     153 *                  bytes of the buffer will be used by the hash table. 
     154 *                  Application may use the remaining portion of the buffer 
     155 *                  for its own purpose. 
     156 * @param value     value to be associated, or NULL to delete the entry with 
     157 *                  the specified key. 
     158 */ 
     159PJ_DECL(void) pj_hash_set_np(pj_hash_table_t *ht, 
     160                             const void *key, unsigned keylen,  
     161                             pj_uint32_t hval, void *entry_buf, void *value); 
    117162 
    118163/** 
  • pjproject/trunk/pjlib/src/pj/hash.c

    r108 r127  
    2323#include <pj/os.h> 
    2424#include <pj/ctype.h> 
     25#include <pj/assert.h> 
    2526 
    2627/** 
     
    5859            hash = hash * PJ_HASH_MULTIPLIER + *p; 
    5960        } 
    60         keylen = p - (const unsigned char*)key; 
    6161    } else { 
    6262        const unsigned char *p = key, 
     
    8989    unsigned table_size; 
    9090     
     91    /* Check that PJ_HASH_ENTRY_SIZE is correct. */ 
     92    PJ_ASSERT_RETURN(sizeof(pj_hash_entry)==PJ_HASH_ENTRY_SIZE, NULL); 
     93 
    9194    h = pj_pool_alloc(pool, sizeof(pj_hash_table_t)); 
    9295    h->count = 0; 
     
    111114static pj_hash_entry **find_entry( pj_pool_t *pool, pj_hash_table_t *ht,  
    112115                                   const void *key, unsigned keylen, 
    113                                    void *val) 
     116                                   void *val, pj_uint32_t *hval, 
     117                                   void *entry_buf) 
    114118{ 
    115119    pj_uint32_t hash; 
    116120    pj_hash_entry **p_entry, *entry; 
    117121 
    118     hash=0; 
    119     if (keylen==PJ_HASH_KEY_STRING) { 
    120         const unsigned char *p = key; 
    121         for ( ; *p; ++p ) { 
    122             hash = hash * PJ_HASH_MULTIPLIER + *p; 
    123         } 
    124         keylen = p - (const unsigned char*)key; 
     122    if (hval && *hval != 0) { 
     123        hash = *hval; 
    125124    } else { 
    126         const unsigned char *p = key, 
    127                             *end = p + keylen; 
    128         for ( ; p!=end; ++p) { 
    129             hash = hash * PJ_HASH_MULTIPLIER + *p; 
    130         } 
     125        /* This slightly differs with pj_hash_calc() because we need  
     126         * to get the keylen when keylen is PJ_HASH_KEY_STRING. 
     127         */ 
     128        hash=0; 
     129        if (keylen==PJ_HASH_KEY_STRING) { 
     130            const unsigned char *p = key; 
     131            for ( ; *p; ++p ) { 
     132                hash = hash * PJ_HASH_MULTIPLIER + *p; 
     133            } 
     134            keylen = p - (const unsigned char*)key; 
     135        } else { 
     136            const unsigned char *p = key, 
     137                                *end = p + keylen; 
     138            for ( ; p!=end; ++p) { 
     139                hash = hash * PJ_HASH_MULTIPLIER + *p; 
     140            } 
     141        } 
     142 
     143        /* Report back the computed hash. */ 
     144        if (hval) 
     145            *hval = hash; 
    131146    } 
    132147 
     
    137152    { 
    138153        if (entry->hash==hash && entry->keylen==keylen && 
    139             memcmp(entry->key, key, keylen)==0)  
     154            pj_memcmp(entry->key, key, keylen)==0)  
    140155        { 
    141156            break;       
     
    146161        return p_entry; 
    147162 
    148     /* create a new entry */ 
    149     entry = pj_pool_alloc(pool, sizeof(pj_hash_entry)); 
    150     PJ_LOG(6, ("hashtbl", "%p: New p_entry %p created, pool used=%u, cap=%u", ht, entry,  
    151                           pj_pool_get_used_size(pool), pj_pool_get_capacity(pool))); 
     163    /* Entry not found, create a new one.  
     164     * If entry_buf is specified, use it. Otherwise allocate from pool. 
     165     */ 
     166    if (entry_buf) { 
     167        entry = entry_buf; 
     168    } else { 
     169        /* Pool must be specified! */ 
     170        PJ_ASSERT_RETURN(pool != NULL, NULL); 
     171 
     172        entry = pj_pool_alloc(pool, sizeof(pj_hash_entry)); 
     173        PJ_LOG(6, ("hashtbl",  
     174                   "%p: New p_entry %p created, pool used=%u, cap=%u",  
     175                   ht, entry,  pj_pool_get_used_size(pool),  
     176                   pj_pool_get_capacity(pool))); 
     177    } 
    152178    entry->next = NULL; 
    153179    entry->hash = hash; 
     
    163189 
    164190PJ_DEF(void *) pj_hash_get( pj_hash_table_t *ht, 
    165                             const void *key, unsigned keylen ) 
     191                            const void *key, unsigned keylen, 
     192                            pj_uint32_t *hval) 
    166193{ 
    167194    pj_hash_entry *entry; 
    168     entry = *find_entry( NULL, ht, key, keylen, NULL); 
     195 
     196    if (hval) *hval = 0; 
     197    entry = *find_entry( NULL, ht, key, keylen, NULL, hval, NULL); 
    169198    return entry ? entry->value : NULL; 
    170199} 
    171200 
    172201PJ_DEF(void) pj_hash_set( pj_pool_t *pool, pj_hash_table_t *ht, 
    173                           const void *key, unsigned keylen, 
     202                          const void *key, unsigned keylen, pj_uint32_t hval, 
    174203                          void *value ) 
    175204{ 
    176205    pj_hash_entry **p_entry; 
    177206 
    178     p_entry = find_entry( pool, ht, key, keylen, value ); 
     207    p_entry = find_entry( pool, ht, key, keylen, value, &hval, NULL); 
    179208    if (*p_entry) { 
    180209        if (value == NULL) { 
     
    187216            /* overwrite */ 
    188217            (*p_entry)->value = value; 
    189             PJ_LOG(6, ("hashtbl", "%p: p_entry %p value set to %p", ht, *p_entry, value)); 
     218            PJ_LOG(6, ("hashtbl", "%p: p_entry %p value set to %p", ht,  
     219                       *p_entry, value)); 
     220        } 
     221    } 
     222} 
     223 
     224PJ_DEF(void) pj_hash_set_np( pj_hash_table_t *ht, 
     225                             const void *key, unsigned keylen,  
     226                             pj_uint32_t hval, void *entry_buf, void *value) 
     227{ 
     228    pj_hash_entry **p_entry; 
     229 
     230    p_entry = find_entry( NULL, ht, key, keylen, value, &hval, entry_buf ); 
     231    if (*p_entry) { 
     232        if (value == NULL) { 
     233            /* delete entry */ 
     234            PJ_LOG(6, ("hashtbl", "%p: p_entry %p deleted", ht, *p_entry)); 
     235            *p_entry = (*p_entry)->next; 
     236            --ht->count; 
     237             
     238        } else { 
     239            /* overwrite */ 
     240            (*p_entry)->value = value; 
     241            PJ_LOG(6, ("hashtbl", "%p: p_entry %p value set to %p", ht,  
     242                       *p_entry, value)); 
    190243        } 
    191244    } 
  • pjproject/trunk/pjsip/build/pjsip.dsw

    r65 r127  
    55 
    66Project: "pjlib"=..\..\pjlib\build\pjlib.dsp - Package Owner=<4> 
     7 
     8Package=<5> 
     9{{{ 
     10}}} 
     11 
     12Package=<4> 
     13{{{ 
     14}}} 
     15 
     16############################################################################### 
     17 
     18Project: "pjlib++"="..\..\pjlib\build\pjlib++.dsp" - Package Owner=<4> 
    719 
    820Package=<5> 
     
    2941 
    3042Project: "pjmedia"=..\..\pjmedia\build\pjmedia.dsp - Package Owner=<4> 
     43 
     44Package=<5> 
     45{{{ 
     46}}} 
     47 
     48Package=<4> 
     49{{{ 
     50}}} 
     51 
     52############################################################################### 
     53 
     54Project: "pjsip++"=".\pjsip++.dsp" - Package Owner=<4> 
    3155 
    3256Package=<5> 
  • pjproject/trunk/pjsip/build/pjsip_core.dsp

    r123 r127  
    8686 
    8787# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" 
     88# Begin Group "Base (.c)" 
     89 
     90# PROP Default_Filter "" 
     91# Begin Source File 
     92 
     93SOURCE=..\src\pjsip\sip_errno.c 
     94# End Source File 
     95# End Group 
     96# Begin Group "Messaging and Parsing (.c)" 
     97 
     98# PROP Default_Filter "" 
     99# Begin Source File 
     100 
     101SOURCE=..\src\pjsip\sip_msg.c 
     102# End Source File 
     103# Begin Source File 
     104 
     105SOURCE=..\src\pjsip\sip_parser.c 
     106# End Source File 
     107# Begin Source File 
     108 
     109SOURCE=..\src\pjsip\sip_tel_uri.c 
     110# End Source File 
     111# Begin Source File 
     112 
     113SOURCE=..\src\pjsip\sip_uri.c 
     114# End Source File 
     115# End Group 
     116# Begin Group "Core (.c)" 
     117 
     118# PROP Default_Filter "" 
     119# Begin Source File 
     120 
     121SOURCE=..\src\pjsip\sip_endpoint.c 
     122# End Source File 
     123# Begin Source File 
     124 
     125SOURCE=..\src\pjsip\sip_util.c 
     126# End Source File 
     127# Begin Source File 
     128 
     129SOURCE=..\src\pjsip\sip_util_proxy.c 
     130# End Source File 
     131# End Group 
     132# Begin Group "Transport Layer (.c)" 
     133 
     134# PROP Default_Filter "" 
     135# Begin Source File 
     136 
     137SOURCE=..\src\pjsip\sip_resolve.c 
     138# End Source File 
     139# Begin Source File 
     140 
     141SOURCE=..\src\pjsip\sip_transport.c 
     142# End Source File 
     143# Begin Source File 
     144 
     145SOURCE=..\src\pjsip\sip_transport_loop.c 
     146# End Source File 
     147# Begin Source File 
     148 
     149SOURCE=..\src\pjsip\sip_transport_udp.c 
     150# End Source File 
     151# End Group 
     152# Begin Group "Authentication (.c)" 
     153 
     154# PROP Default_Filter "" 
    88155# Begin Source File 
    89156 
     
    102169SOURCE=..\src\pjsip\sip_auth_server.c 
    103170# End Source File 
    104 # Begin Source File 
    105  
    106 SOURCE=..\src\pjsip\sip_endpoint.c 
    107 # End Source File 
    108 # Begin Source File 
    109  
    110 SOURCE=..\src\pjsip\sip_errno.c 
    111 # End Source File 
    112 # Begin Source File 
    113  
    114 SOURCE=..\src\pjsip\sip_msg.c 
    115 # End Source File 
    116 # Begin Source File 
    117  
    118 SOURCE=..\src\pjsip\sip_parser.c 
    119 # End Source File 
    120 # Begin Source File 
    121  
    122 SOURCE=..\src\pjsip\sip_resolve.c 
    123 # End Source File 
    124 # Begin Source File 
    125  
    126 SOURCE=..\src\pjsip\sip_tel_uri.c 
    127 # End Source File 
     171# End Group 
     172# Begin Group "Transaction Layer (.c)" 
     173 
     174# PROP Default_Filter "" 
    128175# Begin Source File 
    129176 
    130177SOURCE=..\src\pjsip\sip_transaction.c 
    131 # End Source File 
    132 # Begin Source File 
    133  
    134 SOURCE=..\src\pjsip\sip_transport.c 
    135 # End Source File 
    136 # Begin Source File 
    137  
    138 SOURCE=..\src\pjsip\sip_transport_loop.c 
    139 # End Source File 
    140 # Begin Source File 
    141  
    142 SOURCE=..\src\pjsip\sip_transport_udp.c 
    143 # End Source File 
    144 # Begin Source File 
    145  
    146 SOURCE=..\src\pjsip\sip_uri.c 
    147 # End Source File 
    148 # Begin Source File 
    149  
    150 SOURCE=..\src\pjsip\sip_util.c 
    151 # End Source File 
    152 # Begin Source File 
    153  
    154 SOURCE=..\src\pjsip\sip_util_proxy.c 
    155178# End Source File 
    156179# Begin Source File 
     
    160183# End Source File 
    161184# End Group 
     185# Begin Group "UA Layer (.c)" 
     186 
     187# PROP Default_Filter "" 
     188# Begin Source File 
     189 
     190SOURCE=..\src\pjsip\sip_dialog.c 
     191# End Source File 
     192# Begin Source File 
     193 
     194SOURCE=..\src\pjsip\sip_ua_layer.c 
     195# End Source File 
     196# End Group 
     197# End Group 
    162198# Begin Group "Header Files" 
    163199 
    164200# PROP Default_Filter "h;hpp;hxx;hm;inl" 
    165 # Begin Source File 
    166  
    167 SOURCE=..\include\pjsip_core.h 
    168 # End Source File 
     201# Begin Group "Base Types (.h)" 
     202 
     203# PROP Default_Filter "" 
     204# Begin Source File 
     205 
     206SOURCE=..\include\pjsip\sip_config.h 
     207# End Source File 
     208# Begin Source File 
     209 
     210SOURCE=..\include\pjsip\sip_errno.h 
     211# End Source File 
     212# Begin Source File 
     213 
     214SOURCE=..\include\pjsip\sip_private.h 
     215# End Source File 
     216# Begin Source File 
     217 
     218SOURCE=..\include\pjsip\sip_types.h 
     219# End Source File 
     220# End Group 
     221# Begin Group "Messaging and Parsing (.h)" 
     222 
     223# PROP Default_Filter "" 
    169224# Begin Source File 
    170225 
     
    173228# Begin Source File 
    174229 
     230SOURCE=..\include\pjsip\sip_msg.h 
     231# End Source File 
     232# Begin Source File 
     233 
     234SOURCE=..\include\pjsip\sip_parser.h 
     235# End Source File 
     236# Begin Source File 
     237 
     238SOURCE=..\include\pjsip\sip_tel_uri.h 
     239# End Source File 
     240# Begin Source File 
     241 
     242SOURCE=..\include\pjsip\sip_uri.h 
     243# End Source File 
     244# End Group 
     245# Begin Group "Core (.h)" 
     246 
     247# PROP Default_Filter "" 
     248# Begin Source File 
     249 
     250SOURCE=..\include\pjsip\sip_endpoint.h 
     251# End Source File 
     252# Begin Source File 
     253 
     254SOURCE=..\include\pjsip\sip_event.h 
     255# End Source File 
     256# Begin Source File 
     257 
     258SOURCE=..\include\pjsip\sip_module.h 
     259# End Source File 
     260# Begin Source File 
     261 
     262SOURCE=..\include\pjsip\sip_util.h 
     263# End Source File 
     264# End Group 
     265# Begin Group "Transport Layer (.h)" 
     266 
     267# PROP Default_Filter "" 
     268# Begin Source File 
     269 
     270SOURCE=..\include\pjsip\sip_resolve.h 
     271# End Source File 
     272# Begin Source File 
     273 
     274SOURCE=..\include\pjsip\sip_transport.h 
     275# End Source File 
     276# Begin Source File 
     277 
     278SOURCE=..\include\pjsip\sip_transport_loop.h 
     279# End Source File 
     280# Begin Source File 
     281 
     282SOURCE=..\include\pjsip\sip_transport_udp.h 
     283# End Source File 
     284# End Group 
     285# Begin Group "Authentication (.h)" 
     286 
     287# PROP Default_Filter "" 
     288# Begin Source File 
     289 
    175290SOURCE=..\include\pjsip\sip_auth.h 
    176291# End Source File 
     
    183298SOURCE=..\include\pjsip\sip_auth_parser.h 
    184299# End Source File 
    185 # Begin Source File 
    186  
    187 SOURCE=..\include\pjsip\sip_config.h 
    188 # End Source File 
    189 # Begin Source File 
    190  
    191 SOURCE=..\include\pjsip\sip_endpoint.h 
    192 # End Source File 
    193 # Begin Source File 
    194  
    195 SOURCE=..\include\pjsip\sip_errno.h 
    196 # End Source File 
    197 # Begin Source File 
    198  
    199 SOURCE=..\include\pjsip\sip_event.h 
    200 # End Source File 
    201 # Begin Source File 
    202  
    203 SOURCE=..\include\pjsip\sip_module.h 
    204 # End Source File 
    205 # Begin Source File 
    206  
    207 SOURCE=..\include\pjsip\sip_msg.h 
    208 # End Source File 
    209 # Begin Source File 
    210  
    211 SOURCE=..\include\pjsip\sip_parser.h 
    212 # End Source File 
    213 # Begin Source File 
    214  
    215 SOURCE=..\include\pjsip\sip_private.h 
    216 # End Source File 
    217 # Begin Source File 
    218  
    219 SOURCE=..\include\pjsip\sip_resolve.h 
    220 # End Source File 
    221 # Begin Source File 
    222  
    223 SOURCE=..\include\pjsip\sip_tel_uri.h 
    224 # End Source File 
     300# End Group 
     301# Begin Group "Transaction Layer (.h)" 
     302 
     303# PROP Default_Filter "" 
    225304# Begin Source File 
    226305 
    227306SOURCE=..\include\pjsip\sip_transaction.h 
    228307# End Source File 
    229 # Begin Source File 
    230  
    231 SOURCE=..\include\pjsip\sip_transport.h 
    232 # End Source File 
    233 # Begin Source File 
    234  
    235 SOURCE=..\include\pjsip\sip_transport_loop.h 
    236 # End Source File 
    237 # Begin Source File 
    238  
    239 SOURCE=..\include\pjsip\sip_transport_udp.h 
    240 # End Source File 
    241 # Begin Source File 
    242  
    243 SOURCE=..\include\pjsip\sip_types.h 
    244 # End Source File 
    245 # Begin Source File 
    246  
    247 SOURCE=..\include\pjsip\sip_uri.h 
    248 # End Source File 
    249 # Begin Source File 
    250  
    251 SOURCE=..\include\pjsip\sip_util.h 
     308# End Group 
     309# Begin Group "UA Layer (.h)" 
     310 
     311# PROP Default_Filter "" 
     312# Begin Source File 
     313 
     314SOURCE=..\include\pjsip\sip_dialog.h 
     315# End Source File 
     316# Begin Source File 
     317 
     318SOURCE=..\include\pjsip\sip_ua_layer.h 
     319# End Source File 
     320# End Group 
     321# Begin Source File 
     322 
     323SOURCE=..\include\pjsip.h 
    252324# End Source File 
    253325# End Group 
  • pjproject/trunk/pjsip/build/pjsip_ua.dsp

    r123 r127  
    8888# Begin Source File 
    8989 
    90 SOURCE="..\src\pjsip-ua\sip_dialog.c" 
    91 # End Source File 
    92 # Begin Source File 
     90SOURCE="..\src\pjsip-ua\sip_reg.c" 
    9391 
    94 SOURCE="..\src\pjsip-ua\sip_reg.c" 
    95 # End Source File 
    96 # Begin Source File 
     92!IF  "$(CFG)" == "pjsip_ua - Win32 Release" 
    9793 
    98 SOURCE="..\src\pjsip-ua\sip_ua.c" 
    99 # End Source File 
    100 # Begin Source File 
     94!ELSEIF  "$(CFG)" == "pjsip_ua - Win32 Debug" 
    10195 
    102 SOURCE="..\src\pjsip-ua\sip_ua_private.h" 
     96# PROP Exclude_From_Build 1 
     97 
     98!ENDIF  
     99 
    103100# End Source File 
    104101# End Group 
     
    108105# Begin Source File 
    109106 
    110 SOURCE="..\include\pjsip-ua\sip_dialog.h" 
    111 # End Source File 
    112 # Begin Source File 
    113  
    114107SOURCE="..\include\pjsip-ua\sip_regc.h" 
    115 # End Source File 
    116 # Begin Source File 
    117  
    118 SOURCE="..\include\pjsip-ua\sip_ua.h" 
    119108# End Source File 
    120109# End Group 
  • pjproject/trunk/pjsip/build/test_pjsip.dsp

    r117 r127  
    9090# Begin Source File 
    9191 
     92SOURCE="..\src\test-pjsip\dlg_core_test.c" 
     93# End Source File 
     94# Begin Source File 
     95 
    9296SOURCE="..\src\test-pjsip\main.c" 
    9397# End Source File 
  • pjproject/trunk/pjsip/include/pjsip.h

    r112 r127  
    1717 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
    1818 */ 
    19 #ifndef __PJSIP_CORE_H__ 
    20 #define __PJSIP_CORE_H__ 
     19#ifndef __PJSIP_H__ 
     20#define __PJSIP_H__ 
    2121 
     22/* Base types. */ 
    2223#include <pjsip/sip_types.h> 
    23 #include <pjsip/sip_auth.h> 
    24 #include <pjsip/sip_endpoint.h> 
    2524#include <pjsip/sip_errno.h> 
     25 
     26/* Messaging and parsing. */ 
     27#include <pjsip/sip_uri.h> 
     28#include <pjsip/sip_tel_uri.h> 
     29#include <pjsip/sip_msg.h> 
     30#include <pjsip/sip_parser.h> 
     31 
     32/* Core */ 
    2633#include <pjsip/sip_event.h> 
    2734#include <pjsip/sip_module.h> 
    28 #include <pjsip/sip_msg.h> 
    29 #include <pjsip/sip_parser.h> 
    30 #include <pjsip/sip_resolve.h> 
    31 #include <pjsip/sip_tel_uri.h> 
    32 #include <pjsip/sip_transaction.h> 
     35#include <pjsip/sip_endpoint.h> 
     36#include <pjsip/sip_util.h> 
     37 
     38/* Transport layer */ 
    3339#include <pjsip/sip_transport.h> 
    3440#include <pjsip/sip_transport_udp.h> 
    3541#include <pjsip/sip_transport_loop.h> 
    36 #include <pjsip/sip_uri.h> 
    37 #include <pjsip/sip_util.h> 
     42#include <pjsip/sip_resolve.h> 
    3843 
    39 #endif  /* __PJSIP_CORE_H__ */ 
     44/* Authentication. */ 
     45#include <pjsip/sip_auth.h> 
    4046 
     47/* Transaction layer. */ 
     48#include <pjsip/sip_transaction.h> 
     49 
     50/* UA Layer. */ 
     51#include <pjsip/sip_ua_layer.h> 
     52#include <pjsip/sip_dialog.h> 
     53 
     54 
     55#endif  /* __PJSIP_H__ */ 
     56 
  • pjproject/trunk/pjsip/include/pjsip/sip_auth.h

    r123 r127  
    188188 
    189189 
     190/** 
     191 * Clone client initialization session.  
     192 * 
     193 * @param pool          Pool to use. 
     194 * @param sess          Structure to put the duplicated session. 
     195 * @param rhs           The client session to be cloned. 
     196 * 
     197 * @return              PJ_SUCCESS on success; 
     198 */ 
     199PJ_DECL(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool, 
     200                                           pjsip_auth_clt_sess *sess, 
     201                                           const pjsip_auth_clt_sess *rhs); 
    190202 
    191203/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r107 r127  
    5353#define PJSIP_POOL_TSX_INC              256 
    5454#define PJSIP_MAX_TSX_KEY_LEN           (PJSIP_MAX_URL_SIZE*2) 
     55 
     56/* User agent. */ 
     57#define PJSIP_POOL_LEN_USER_AGENT       1024 
     58#define PJSIP_POOL_INC_USER_AGENT       1024 
    5559 
    5660/* Message/URL related constants. */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_endpoint.h

    r107 r127  
    229229 
    230230/** 
     231 * Find transaction in endpoint's transaction table by the transaction's key. 
     232 * This function normally is only used by modules. The key for a transaction 
     233 * can be created by calling #pjsip_tsx_create_key. 
     234 * 
     235 * @param endpt     The endpoint instance. 
     236 * @param key       Transaction key, as created with #pjsip_tsx_create_key. 
     237 * 
     238 * @return          The transaction, or NULL if it's not found. 
     239 */ 
     240PJ_DECL(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt, 
     241                                                  const pj_str_t *key ); 
     242 
     243/** 
    231244 * Register the transaction to the endpoint's transaction table. 
    232245 * Before the transaction is registered, it must have been initialized as 
     
    317330                               pjsip_transport **p_transport); 
    318331 
    319 /** 
    320  * Get additional headers to be put in outgoing request message.  
    321  * This function is normally called by transaction layer when sending outgoing 
    322  * requests. 
    323  *  
    324  * @param endpt     The endpoint. 
    325  * 
    326  * @return          List of additional headers to be put in outgoing requests. 
    327  */ 
    328 PJ_DECL(const pjsip_hdr*) pjsip_endpt_get_request_headers(pjsip_endpoint *endpt); 
    329  
    330 /** 
    331  * Get "Allow" header from endpoint. The endpoint builds the "Allow" header 
    332  * from the list of methods supported by modules. 
    333  * 
    334  * @param endpt     The endpoint. 
    335  * 
    336  * @return          "Allow" header, or NULL if endpoint doesn't have "Allow" header. 
    337  */ 
    338 PJ_DECL(const pjsip_allow_hdr*) pjsip_endpt_get_allow_hdr( pjsip_endpoint *endpt ); 
    339  
    340  
    341 /** 
    342  * Find transaction in endpoint's transaction table by the transaction's key. 
    343  * This function normally is only used by modules. The key for a transaction 
    344  * can be created by calling #pjsip_tsx_create_key. 
    345  * 
    346  * @param endpt     The endpoint instance. 
    347  * @param key       Transaction key, as created with #pjsip_tsx_create_key. 
    348  * 
    349  * @return          The transaction, or NULL if it's not found. 
    350  */ 
    351 PJ_DECL(pjsip_transaction*) pjsip_endpt_find_tsx( pjsip_endpoint *endpt, 
    352                                                   const pj_str_t *key ); 
     332 
     333/***************************************************************************** 
     334 * 
     335 * Capabilities Management 
     336 * 
     337 * Modules may implement new capabilities to the stack. These capabilities 
     338 * are indicated by the appropriate SIP header fields, such as Accept, 
     339 * Accept-Encoding, Accept-Language, Allow, Supported, etc. 
     340 * 
     341 * When a module provides new capabilities to the stack, it registers these 
     342 * capabilities to the endpoint by supplying new tags (strings) to the 
     343 * appropriate header fields. Application (or other modules) can then query 
     344 * these header fields to get the list of supported capabilities, and may 
     345 * include these headers in the outgoing message. 
     346 ***************************************************************************** 
     347 */ 
     348 
     349/** 
     350 * Get the value of the specified capability header field. 
     351 * 
     352 * @param endpt     The endpoint. 
     353 * @param htype     The header type to be retrieved, which value may be: 
     354 *                  - PJSIP_H_ACCEPT 
     355 *                  - PJSIP_H_ALLOW 
     356 *                  - PJSIP_H_SUPPORTED 
     357 * @param hname     If htype specifies PJSIP_H_OTHER, then the header name 
     358 *                  must be supplied in this argument. Otherwise the value 
     359 *                  must be set to NULL. 
     360 * 
     361 * @return          The appropriate header, or NULL if the header is not 
     362 *                  available. 
     363 */ 
     364PJ_DECL(const pjsip_hdr*) pjsip_endpt_get_capability( pjsip_endpoint *endpt, 
     365                                                      int htype, 
     366                                                      const pj_str_t *hname); 
     367 
     368 
     369/** 
     370 * Add or register new capabilities as indicated by the tags to the 
     371 * appropriate header fields in the endpoint. 
     372 * 
     373 * @param endpt     The endpoint. 
     374 * @param mod       The module which registers the capability. 
     375 * @param htype     The header type to be set, which value may be: 
     376 *                  - PJSIP_H_ACCEPT 
     377 *                  - PJSIP_H_ALLOW 
     378 *                  - PJSIP_H_SUPPORTED 
     379 * @param hname     If htype specifies PJSIP_H_OTHER, then the header name 
     380 *                  must be supplied in this argument. Otherwise the value 
     381 *                  must be set to NULL. 
     382 * @param count     The number of tags in the array. 
     383 * @param tags      Array of tags describing the capabilities or extensions 
     384 *                  to be added to the appropriate header. 
     385 * 
     386 * @return          PJ_SUCCESS on success. 
     387 */ 
     388PJ_DECL(pj_status_t) pjsip_endpt_add_capability( pjsip_endpoint *endpt, 
     389                                                 pjsip_module *mod, 
     390                                                 int htype, 
     391                                                 const pj_str_t *hname, 
     392                                                 unsigned count, 
     393                                                 const pj_str_t tags[]); 
     394 
     395/** 
     396 * Get list of additional headers to be put in outgoing request message. 
     397 * 
     398 * @param e         The endpoint. 
     399 * 
     400 * @return          List of headers. 
     401 */ 
     402PJ_DECL(const pjsip_hdr*) pjsip_endpt_get_request_headers(pjsip_endpoint *e); 
     403 
    353404 
    354405/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_errno.h

    r123 r127  
    141141/** 
    142142 * @hideinitializer 
     143 * General Invalid URI error. 
     144 */ 
     145#define PJSIP_EINVALIDURI       (PJSIP_ERRNO_START_PJSIP + 39)  /* 171039 */ 
     146/** 
     147 * @hideinitializer 
    143148 * Unsupported URL scheme. 
    144149 */ 
     
    348353 
    349354 
     355/************************************************************ 
     356 * UA AND DIALOG ERRORS 
     357 ***********************************************************/ 
     358/** 
     359 * @hideinitializer 
     360 * Missing From/To tag. 
     361 */ 
     362#define PJSIP_EMISSINGTAG        (PJSIP_ERRNO_START_PJSIP+120)  /* 171120 */ 
     363 
     364 
     365 
    350366PJ_END_DECL 
    351367 
  • pjproject/trunk/pjsip/include/pjsip/sip_module.h

    r109 r127  
    2525 */ 
    2626#include <pjsip/sip_types.h> 
     27#include <pj/list.h> 
    2728 
    2829PJ_BEGIN_DECL 
     
    6768     */ 
    6869    void *user_data; 
    69  
    70     /** 
    71      * Number of methods supported by this module. 
    72      */ 
    73     int method_cnt; 
    74  
    75     /** 
    76      * Array of methods supported by this module. 
    77      */ 
    78     const pjsip_method *methods[8]; 
    7970 
    8071    /** 
  • pjproject/trunk/pjsip/include/pjsip/sip_msg.h

    r119 r127  
    174174     */ 
    175175    PJSIP_H_ACCEPT, 
    176     PJSIP_H_ACCEPT_ENCODING_UNIMP, 
    177     PJSIP_H_ACCEPT_LANGUAGE_UNIMP, 
    178     PJSIP_H_ALERT_INFO_UNIMP, 
     176    PJSIP_H_ACCEPT_ENCODING_UNIMP,      /* N/A, use pjsip_generic_string_hdr */ 
     177    PJSIP_H_ACCEPT_LANGUAGE_UNIMP,      /* N/A, use pjsip_generic_string_hdr */ 
     178    PJSIP_H_ALERT_INFO_UNIMP,           /* N/A, use pjsip_generic_string_hdr */ 
    179179    PJSIP_H_ALLOW, 
    180     PJSIP_H_AUTHENTICATION_INFO_UNIMP, 
     180    PJSIP_H_AUTHENTICATION_INFO_UNIMP,  /* N/A, use pjsip_generic_string_hdr */ 
    181181    PJSIP_H_AUTHORIZATION, 
    182182    PJSIP_H_CALL_ID, 
    183     PJSIP_H_CALL_INFO_UNIMP, 
     183    PJSIP_H_CALL_INFO_UNIMP,            /* N/A, use pjsip_generic_string_hdr */ 
    184184    PJSIP_H_CONTACT, 
    185     PJSIP_H_CONTENT_DISPOSITION_UNIMP, 
    186     PJSIP_H_CONTENT_ENCODING_UNIMP, 
    187     PJSIP_H_CONTENT_LANGUAGE_UNIMP, 
     185    PJSIP_H_CONTENT_DISPOSITION_UNIMP,  /* N/A, use pjsip_generic_string_hdr */ 
     186    PJSIP_H_CONTENT_ENCODING_UNIMP,     /* N/A, use pjsip_generic_string_hdr */ 
     187    PJSIP_H_CONTENT_LANGUAGE_UNIMP,     /* N/A, use pjsip_generic_string_hdr */ 
    188188    PJSIP_H_CONTENT_LENGTH, 
    189189    PJSIP_H_CONTENT_TYPE, 
    190190    PJSIP_H_CSEQ, 
    191     PJSIP_H_DATE_UNIMP, 
    192     PJSIP_H_ERROR_INFO_UNIMP, 
     191    PJSIP_H_DATE_UNIMP,                 /* N/A, use pjsip_generic_string_hdr */ 
     192    PJSIP_H_ERROR_INFO_UNIMP,           /* N/A, use pjsip_generic_string_hdr */ 
    193193    PJSIP_H_EXPIRES, 
    194194    PJSIP_H_FROM, 
    195     PJSIP_H_IN_REPLY_TO_UNIMP, 
     195    PJSIP_H_IN_REPLY_TO_UNIMP,          /* N/A, use pjsip_generic_string_hdr */ 
    196196    PJSIP_H_MAX_FORWARDS, 
    197     PJSIP_H_MIME_VERSION_UNIMP, 
     197    PJSIP_H_MIME_VERSION_UNIMP,         /* N/A, use pjsip_generic_string_hdr */ 
    198198    PJSIP_H_MIN_EXPIRES, 
    199     PJSIP_H_ORGANIZATION_UNIMP, 
    200     PJSIP_H_PRIORITY_UNIMP, 
     199    PJSIP_H_ORGANIZATION_UNIMP,         /* N/A, use pjsip_generic_string_hdr */ 
     200    PJSIP_H_PRIORITY_UNIMP,             /* N/A, use pjsip_generic_string_hdr */ 
    201201    PJSIP_H_PROXY_AUTHENTICATE, 
    202202    PJSIP_H_PROXY_AUTHORIZATION, 
    203     PJSIP_H_PROXY_REQUIRE_UNIMP, 
     203    PJSIP_H_PROXY_REQUIRE_UNIMP,        /* N/A, use pjsip_generic_string_hdr */ 
    204204    PJSIP_H_RECORD_ROUTE, 
    205     PJSIP_H_REPLY_TO_UNIMP, 
     205    PJSIP_H_REPLY_TO_UNIMP,             /* N/A, use pjsip_generic_string_hdr */ 
    206206    PJSIP_H_REQUIRE, 
    207207    PJSIP_H_RETRY_AFTER, 
    208208    PJSIP_H_ROUTE, 
    209     PJSIP_H_SERVER_UNIMP, 
    210     PJSIP_H_SUBJECT_UNIMP, 
     209    PJSIP_H_SERVER_UNIMP,               /* N/A, use pjsip_generic_string_hdr */ 
     210    PJSIP_H_SUBJECT_UNIMP,              /* N/A, use pjsip_generic_string_hdr */ 
    211211    PJSIP_H_SUPPORTED, 
    212     PJSIP_H_TIMESTAMP_UNIMP, 
     212    PJSIP_H_TIMESTAMP_UNIMP,            /* N/A, use pjsip_generic_string_hdr */ 
    213213    PJSIP_H_TO, 
    214214    PJSIP_H_UNSUPPORTED, 
    215     PJSIP_H_USER_AGENT_UNIMP, 
     215    PJSIP_H_USER_AGENT_UNIMP,           /* N/A, use pjsip_generic_string_hdr */ 
    216216    PJSIP_H_VIA, 
    217     PJSIP_H_WARNING_UNIMP, 
     217    PJSIP_H_WARNING_UNIMP,              /* N/A, use pjsip_generic_string_hdr */ 
    218218    PJSIP_H_WWW_AUTHENTICATE, 
    219219 
     
    749749                                    char *buf, pj_size_t size); 
    750750 
     751 
     752/* 
     753 * Some usefull macros to find common headers. 
     754 */ 
     755 
     756 
     757/** 
     758 * Find Call-ID header. 
     759 * 
     760 * @param msg   The message. 
     761 * @return      Call-ID header instance. 
     762 */ 
     763#define PJSIP_MSG_CID_HDR(msg) \ 
     764            ((pjsip_cid_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_CALL_ID, NULL)) 
     765 
     766/** 
     767 * Find CSeq header. 
     768 * 
     769 * @param msg   The message. 
     770 * @return      CSeq header instance. 
     771 */ 
     772#define PJSIP_MSG_CSEQ_HDR(msg) \ 
     773            ((pjsip_cseq_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_CSEQ, NULL)) 
     774 
     775/** 
     776 * Find From header. 
     777 * 
     778 * @param msg   The message. 
     779 * @return      From header instance. 
     780 */ 
     781#define PJSIP_MSG_FROM_HDR(msg) \ 
     782            ((pjsip_from_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_FROM, NULL)) 
     783 
     784/** 
     785 * Find To header. 
     786 * 
     787 * @param msg   The message. 
     788 * @return      To header instance. 
     789 */ 
     790#define PJSIP_MSG_TO_HDR(msg) \ 
     791            ((pjsip_to_hdr*)pjsip_msg_find_hdr(msg, PJSIP_H_TO, NULL)) 
     792 
     793 
    751794/** 
    752795 * @} 
     
    767810typedef struct pjsip_generic_string_hdr 
    768811{ 
    769     PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_string_hdr); /**< Standard header field. */ 
    770     pj_str_t hvalue;                                /**< hvalue */ 
     812    /** Standard header field. */ 
     813    PJSIP_DECL_HDR_MEMBER(struct pjsip_generic_string_hdr); 
     814    /** hvalue */ 
     815    pj_str_t hvalue; 
    771816} pjsip_generic_string_hdr; 
    772817 
     
    779824 * @param hname     The header name to be assigned to the header, or NULL to 
    780825 *                  assign the header name with some string. 
     826 * @param hvalue    Optional string to be assigned as the value. 
    781827 * 
    782828 * @return          The header, or THROW exception. 
    783829 */ 
    784 PJ_DECL(pjsip_generic_string_hdr*) pjsip_generic_string_hdr_create( pj_pool_t *pool,  
    785                                                       const pj_str_t *hname ); 
    786  
    787 /** 
    788  * Create a generic header along with the text content. 
    789  * 
    790  * @param pool      The pool. 
    791  * @param hname     The header name. 
    792  * @param hvalue    The header text content. 
    793  * 
    794  * @return          The header instance. 
    795  */ 
    796830PJ_DECL(pjsip_generic_string_hdr*)  
    797 pjsip_generic_string_hdr_create_with_text( pj_pool_t *pool, 
    798                                            const pj_str_t *hname, 
    799                                            const pj_str_t *hvalue); 
     831pjsip_generic_string_hdr_create( pj_pool_t *pool,  
     832                                 const pj_str_t *hname, 
     833                                 const pj_str_t *hvalue); 
     834 
     835/** 
     836 * Initialize a preallocated memory with the header structure. This function 
     837 * should only be called when application uses its own memory allocation to 
     838 * allocate memory block for the specified header (e.g. in C++, when the  
     839 * header is allocated with "new" operator). 
     840 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     841 * which allocates memory and initialize it in one go. 
     842 * 
     843 * @param pool      Pool for additional memory allocation if required. 
     844 * @param mem       Pre-allocated memory to be initialized as the header. 
     845 * @param hname     The header name to be assigned to the header, or NULL to 
     846 *                  assign the header name with some string later. 
     847 * @param hvalue    Optional string to be assigned as the value. 
     848 * 
     849 * @return          The header instance, which points to the same memory  
     850 *                  location as the mem argument. 
     851 */ 
     852PJ_DECL(pjsip_generic_string_hdr*)  
     853pjsip_generic_string_hdr_init( pj_pool_t *pool, 
     854                               void *mem, 
     855                               const pj_str_t *hname, 
     856                               const pj_str_t *hvalue); 
     857 
    800858 
    801859/** 
     
    828886 * @param hname     The header name to be assigned to the header, or NULL to 
    829887 *                  assign the header name with some string. 
     888 * @param hvalue    The value to be assigned to the header. 
    830889 * 
    831890 * @return          The header, or THROW exception. 
    832891 */ 
    833 PJ_DECL(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool,  
    834                                                       const pj_str_t *hname ); 
    835  
    836 /** 
    837  * Create a generic header along with the value. 
    838  * 
    839  * @param pool      The pool. 
    840  * @param hname     The header name. 
    841  * @param value     The header value content. 
    842  * 
    843  * @return          The header instance. 
    844  */ 
    845 PJ_DECL(pjsip_generic_int_hdr*)  
    846 pjsip_generic_int_hdr_create_with_value( pj_pool_t *pool, 
    847                                          const pj_str_t *hname, 
    848                                          int value); 
     892PJ_DECL(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool, 
     893                                                      const pj_str_t *hname, 
     894                                                      int hvalue ); 
     895 
     896 
     897/** 
     898 * Initialize a preallocated memory with the header structure. This function 
     899 * should only be called when application uses its own memory allocation to 
     900 * allocate memory block for the specified header (e.g. in C++, when the  
     901 * header is allocated with "new" operator). 
     902 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     903 * which allocates memory and initialize it in one go. 
     904 * 
     905 * @param pool      Pool for additional memory allocation if required. 
     906 * @param mem       Pre-allocated memory to be initialized as the header. 
     907 * @param hname     The header name to be assigned to the header, or NULL to 
     908 *                  assign the header name with some string later. 
     909 * @param value     Value to be assigned to the header. 
     910 * 
     911 * @return          The header instance, which points to the same memory  
     912 *                  location as the mem argument. 
     913 */ 
     914PJ_DECL(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_init( pj_pool_t *pool, 
     915                                                            void *mem, 
     916                                                            const pj_str_t *hname, 
     917                                                            int value ); 
    849918 
    850919/** 
     
    874943 * 
    875944 * @param pool      Pool to allocate memory from. 
     945 * @param hname     Header name. 
    876946 * 
    877947 * @return          New generic array header. 
    878948 */ 
    879 PJ_DECL(pjsip_generic_array_hdr*) pjsip_generic_array_create(pj_pool_t *pool, 
    880                                                              const pj_str_t *hnames); 
     949PJ_DECL(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_create(pj_pool_t *pool, 
     950                                                             const pj_str_t *hname); 
     951 
     952/** 
     953 * Initialize a preallocated memory with the header structure. This function 
     954 * should only be called when application uses its own memory allocation to 
     955 * allocate memory block for the specified header (e.g. in C++, when the  
     956 * header is allocated with "new" operator). 
     957 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     958 * which allocates memory and initialize it in one go. 
     959 * 
     960 * @param pool      Pool for additional memory allocation if required. 
     961 * @param mem       Pre-allocated memory to be initialized as the header. 
     962 * @param hname     The header name to be assigned to the header, or NULL to 
     963 *                  assign the header name with some string later. 
     964 * 
     965 * @return          The header instance, which points to the same memory  
     966 *                  location as the mem argument. 
     967 */ 
     968PJ_DECL(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_init(pj_pool_t *pool, 
     969                                                               void *mem, 
     970                                                               const pj_str_t *hname); 
     971 
    881972 
    882973/** 
     
    906997PJ_DECL(pjsip_accept_hdr*) pjsip_accept_hdr_create(pj_pool_t *pool); 
    907998 
     999/** 
     1000 * Initialize a preallocated memory with the header structure. This function 
     1001 * should only be called when application uses its own memory allocation to 
     1002 * allocate memory block for the specified header (e.g. in C++, when the  
     1003 * header is allocated with "new" operator). 
     1004 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1005 * which allocates memory and initialize it in one go. 
     1006 * 
     1007 * @param pool      Pool for additional memory allocation if required. 
     1008 * @param mem       Pre-allocated memory to be initialized as the header. 
     1009 * 
     1010 * @return          The header instance, which points to the same memory  
     1011 *                  location as the mem argument. 
     1012 */ 
     1013PJ_DECL(pjsip_accept_hdr*) pjsip_accept_hdr_init( pj_pool_t *pool, 
     1014                                                  void *mem ); 
    9081015 
    9091016/** 
     
    9291036PJ_DECL(pjsip_allow_hdr*) pjsip_allow_hdr_create(pj_pool_t *pool); 
    9301037 
     1038 
     1039 
     1040/** 
     1041 * Initialize a preallocated memory with the header structure. This function 
     1042 * should only be called when application uses its own memory allocation to 
     1043 * allocate memory block for the specified header (e.g. in C++, when the  
     1044 * header is allocated with "new" operator). 
     1045 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1046 * which allocates memory and initialize it in one go. 
     1047 * 
     1048 * @param pool      Pool for additional memory allocation if required. 
     1049 * @param mem       Pre-allocated memory to be initialized as the header. 
     1050 * 
     1051 * @return          The header instance, which points to the same memory  
     1052 *                  location as the mem argument. 
     1053 */ 
     1054PJ_DECL(pjsip_allow_hdr*) pjsip_allow_hdr_init( pj_pool_t *pool, 
     1055                                                void *mem ); 
    9311056 
    9321057/** 
     
    9621087 
    9631088/** 
     1089 * Initialize a preallocated memory with the header structure. This function 
     1090 * should only be called when application uses its own memory allocation to 
     1091 * allocate memory block for the specified header (e.g. in C++, when the  
     1092 * header is allocated with "new" operator). 
     1093 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1094 * which allocates memory and initialize it in one go. 
     1095 * 
     1096 * @param pool      Pool for additional memory allocation if required. 
     1097 * @param mem       Pre-allocated memory to be initialized as the header. 
     1098 * 
     1099 * @return          The header instance, which points to the same memory  
     1100 *                  location as the mem argument. 
     1101 */ 
     1102PJ_DECL(pjsip_cid_hdr*) pjsip_cid_hdr_init( pj_pool_t *pool, 
     1103                                            void *mem ); 
     1104 
     1105 
     1106/** 
    9641107 * @} 
    9651108 */ 
     
    9881131 */ 
    9891132PJ_DECL(pjsip_clen_hdr*) pjsip_clen_hdr_create( pj_pool_t *pool ); 
     1133 
     1134/** 
     1135 * Initialize a preallocated memory with the header structure. This function 
     1136 * should only be called when application uses its own memory allocation to 
     1137 * allocate memory block for the specified header (e.g. in C++, when the  
     1138 * header is allocated with "new" operator). 
     1139 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1140 * which allocates memory and initialize it in one go. 
     1141 * 
     1142 * @param pool      Pool for additional memory allocation if required. 
     1143 * @param mem       Pre-allocated memory to be initialized as the header. 
     1144 * 
     1145 * @return          The header instance, which points to the same memory  
     1146 *                  location as the mem argument. 
     1147 */ 
     1148PJ_DECL(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool, 
     1149                                              void *mem ); 
     1150 
    9901151 
    9911152/** 
     
    10171178 */ 
    10181179PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool ); 
     1180 
     1181/** 
     1182 * Initialize a preallocated memory with the header structure. This function 
     1183 * should only be called when application uses its own memory allocation to 
     1184 * allocate memory block for the specified header (e.g. in C++, when the  
     1185 * header is allocated with "new" operator). 
     1186 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1187 * which allocates memory and initialize it in one go. 
     1188 * 
     1189 * @param pool      Pool for additional memory allocation if required. 
     1190 * @param mem       Pre-allocated memory to be initialized as the header. 
     1191 * 
     1192 * @return          The header instance, which points to the same memory  
     1193 *                  location as the mem argument. 
     1194 */ 
     1195PJ_DECL(pjsip_cseq_hdr*) pjsip_cseq_hdr_init( pj_pool_t *pool, 
     1196                                              void *mem ); 
    10191197 
    10201198/** 
     
    10551233 
    10561234/** 
     1235 * Initialize a preallocated memory with the header structure. This function 
     1236 * should only be called when application uses its own memory allocation to 
     1237 * allocate memory block for the specified header (e.g. in C++, when the  
     1238 * header is allocated with "new" operator). 
     1239 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1240 * which allocates memory and initialize it in one go. 
     1241 * 
     1242 * @param pool      Pool for additional memory allocation if required. 
     1243 * @param mem       Pre-allocated memory to be initialized as the header. 
     1244 * 
     1245 * @return          The header instance, which points to the same memory  
     1246 *                  location as the mem argument. 
     1247 */ 
     1248PJ_DECL(pjsip_contact_hdr*) pjsip_contact_hdr_init( pj_pool_t *pool, 
     1249                                                    void *mem ); 
     1250 
     1251/** 
    10571252 * @} 
    10581253 */ 
     
    10841279 
    10851280/** 
     1281 * Initialize a preallocated memory with the header structure. This function 
     1282 * should only be called when application uses its own memory allocation to 
     1283 * allocate memory block for the specified header (e.g. in C++, when the  
     1284 * header is allocated with "new" operator). 
     1285 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1286 * which allocates memory and initialize it in one go. 
     1287 * 
     1288 * @param pool      Pool for additional memory allocation if required. 
     1289 * @param mem       Pre-allocated memory to be initialized as the header. 
     1290 * 
     1291 * @return          The header instance, which points to the same memory  
     1292 *                  location as the mem argument. 
     1293 */ 
     1294PJ_DECL(pjsip_ctype_hdr*) pjsip_ctype_hdr_init( pj_pool_t *pool, 
     1295                                                void *mem ); 
     1296 
     1297/** 
    10861298 * @} 
    10871299 */ 
     
    11001312 * Create a new Expires header. 
    11011313 * 
    1102  * @param pool  The pool. 
    1103  * @return      A new Expires header. 
    1104  */ 
    1105 PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool ); 
     1314 * @param pool      The pool. 
     1315 * @param value     The expiration value. 
     1316 * 
     1317 * @return          A new Expires header. 
     1318 */ 
     1319PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool, 
     1320                                                      int value); 
     1321 
     1322/** 
     1323 * Initialize a preallocated memory with the header structure. This function 
     1324 * should only be called when application uses its own memory allocation to 
     1325 * allocate memory block for the specified header (e.g. in C++, when the  
     1326 * header is allocated with "new" operator). 
     1327 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1328 * which allocates memory and initialize it in one go. 
     1329 * 
     1330 * @param pool      Pool for additional memory allocation if required. 
     1331 * @param mem       Pre-allocated memory to be initialized as the header. 
     1332 * @param value     The expiration value. 
     1333 * 
     1334 * @return          The header instance, which points to the same memory  
     1335 *                  location as the mem argument. 
     1336 */ 
     1337PJ_DECL(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool, 
     1338                                                    void *mem, 
     1339                                                    int value ); 
     1340 
    11061341 
    11071342/** 
     
    11421377 
    11431378/** 
     1379 * Initialize a preallocated memory with the header structure. This function 
     1380 * should only be called when application uses its own memory allocation to 
     1381 * allocate memory block for the specified header (e.g. in C++, when the  
     1382 * header is allocated with "new" operator). 
     1383 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1384 * which allocates memory and initialize it in one go. 
     1385 * 
     1386 * @param pool      Pool for additional memory allocation if required. 
     1387 * @param mem       Pre-allocated memory to be initialized as the header. 
     1388 * 
     1389 * @return          The header instance, which points to the same memory  
     1390 *                  location as the mem argument. 
     1391 */ 
     1392PJ_DECL(pjsip_from_hdr*) pjsip_from_hdr_init( pj_pool_t *pool, 
     1393                                              void *mem ); 
     1394 
     1395/** 
    11441396 * Create a To header. 
    11451397 * 
     
    11501402 
    11511403/** 
     1404 * Initialize a preallocated memory with the header structure. This function 
     1405 * should only be called when application uses its own memory allocation to 
     1406 * allocate memory block for the specified header (e.g. in C++, when the  
     1407 * header is allocated with "new" operator). 
     1408 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1409 * which allocates memory and initialize it in one go. 
     1410 * 
     1411 * @param pool      Pool for additional memory allocation if required. 
     1412 * @param mem       Pre-allocated memory to be initialized as the header. 
     1413 * 
     1414 * @return          The header instance, which points to the same memory  
     1415 *                  location as the mem argument. 
     1416 */ 
     1417PJ_DECL(pjsip_to_hdr*) pjsip_to_hdr_init( pj_pool_t *pool, 
     1418                                          void *mem ); 
     1419 
     1420/** 
    11521421 * Convert the header to a From header. 
    11531422 * 
     
    11551424 * @return      "From" header. 
    11561425 */ 
    1157 PJ_DECL(pjsip_from_hdr*) pjsip_fromto_set_from( pjsip_fromto_hdr *hdr ); 
     1426PJ_DECL(pjsip_from_hdr*) pjsip_fromto_hdr_set_from( pjsip_fromto_hdr *hdr ); 
    11581427 
    11591428/** 
     
    11631432 * @return      "To" header. 
    11641433 */ 
    1165 PJ_DECL(pjsip_to_hdr*)   pjsip_fromto_set_to( pjsip_fromto_hdr *hdr ); 
     1434PJ_DECL(pjsip_to_hdr*)   pjsip_fromto_hdr_set_to( pjsip_fromto_hdr *hdr ); 
    11661435 
    11671436/** 
     
    11771446 * @{ 
    11781447 */ 
    1179 typedef pjsip_generic_int_hdr pjsip_max_forwards_hdr; 
     1448typedef pjsip_generic_int_hdr pjsip_max_fwd_hdr; 
    11801449 
    11811450/** 
     
    11831452 * 
    11841453 * @param pool      The pool. 
     1454 * @param value     The Max-Forwards value. 
    11851455 * 
    11861456 * @return          New Max-Forwards header instance. 
    11871457 */ 
    1188 PJ_DECL(pjsip_max_forwards_hdr*) pjsip_max_forwards_hdr_create(pj_pool_t *pool); 
    1189  
     1458PJ_DECL(pjsip_max_fwd_hdr*)  
     1459pjsip_max_fwd_hdr_create(pj_pool_t *pool, int value); 
     1460 
     1461 
     1462/** 
     1463 * Initialize a preallocated memory with the header structure. This function 
     1464 * should only be called when application uses its own memory allocation to 
     1465 * allocate memory block for the specified header (e.g. in C++, when the  
     1466 * header is allocated with "new" operator). 
     1467 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1468 * which allocates memory and initialize it in one go. 
     1469 * 
     1470 * @param pool      Pool for additional memory allocation if required. 
     1471 * @param mem       Pre-allocated memory to be initialized as the header. 
     1472 * @param value     The Max-Forwards value. 
     1473 * 
     1474 * @return          The header instance, which points to the same memory  
     1475 *                  location as the mem argument. 
     1476 */ 
     1477PJ_DECL(pjsip_max_fwd_hdr*)  
     1478pjsip_max_fwd_hdr_init( pj_pool_t *pool, void *mem, int value ); 
    11901479 
    11911480/** 
     
    12041493 
    12051494/** 
    1206  * Create new Max-Forwards header instance. 
     1495 * Create new Min-Expires header instance. 
    12071496 * 
    12081497 * @param pool      The pool. 
    1209  * 
    1210  * @return          New Max-Forwards header instance. 
    1211  */ 
    1212 PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool); 
    1213  
     1498 * @param value     The Min-Expires value. 
     1499 * 
     1500 * @return          New Min-Expires header instance. 
     1501 */ 
     1502PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool, 
     1503                                                             int value); 
     1504 
     1505 
     1506/** 
     1507 * Initialize a preallocated memory with the header structure. This function 
     1508 * should only be called when application uses its own memory allocation to 
     1509 * allocate memory block for the specified header (e.g. in C++, when the  
     1510 * header is allocated with "new" operator). 
     1511 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1512 * which allocates memory and initialize it in one go. 
     1513 * 
     1514 * @param pool      Pool for additional memory allocation if required. 
     1515 * @param mem       Pre-allocated memory to be initialized as the header. 
     1516 * @param value     The Min-Expires value. 
     1517 * 
     1518 * @return          The header instance, which points to the same memory  
     1519 *                  location as the mem argument. 
     1520 */ 
     1521PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool, 
     1522                                                            void *mem, 
     1523                                                            int value ); 
    12141524 
    12151525/** 
     
    12501560PJ_DECL(pjsip_rr_hdr*)      pjsip_rr_hdr_create( pj_pool_t *pool ); 
    12511561 
     1562/** 
     1563 * Initialize a preallocated memory with the header structure. This function 
     1564 * should only be called when application uses its own memory allocation to 
     1565 * allocate memory block for the specified header (e.g. in C++, when the  
     1566 * header is allocated with "new" operator). 
     1567 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1568 * which allocates memory and initialize it in one go. 
     1569 * 
     1570 * @param pool      Pool for additional memory allocation if required. 
     1571 * @param mem       Pre-allocated memory to be initialized as the header. 
     1572 * 
     1573 * @return          The header instance, which points to the same memory  
     1574 *                  location as the mem argument. 
     1575 */ 
     1576PJ_DECL(pjsip_rr_hdr*) pjsip_rr_hdr_init( pj_pool_t *pool, 
     1577                                          void *mem ); 
     1578 
    12521579/**  
    12531580 * Create new Route header from the pool.  
     
    12581585PJ_DECL(pjsip_route_hdr*)   pjsip_route_hdr_create( pj_pool_t *pool ); 
    12591586 
     1587/** 
     1588 * Initialize a preallocated memory with the header structure. This function 
     1589 * should only be called when application uses its own memory allocation to 
     1590 * allocate memory block for the specified header (e.g. in C++, when the  
     1591 * header is allocated with "new" operator). 
     1592 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1593 * which allocates memory and initialize it in one go. 
     1594 * 
     1595 * @param pool      Pool for additional memory allocation if required. 
     1596 * @param mem       Pre-allocated memory to be initialized as the header. 
     1597 * 
     1598 * @return          The header instance, which points to the same memory  
     1599 *                  location as the mem argument. 
     1600 */ 
     1601PJ_DECL(pjsip_route_hdr*) pjsip_route_hdr_init( pj_pool_t *pool, 
     1602                                                void *mem ); 
     1603 
    12601604/**  
    12611605 * Convert generic routing header to Record-Route header.  
     
    12961640PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_create(pj_pool_t *pool); 
    12971641 
     1642/** 
     1643 * Initialize a preallocated memory with the header structure. This function 
     1644 * should only be called when application uses its own memory allocation to 
     1645 * allocate memory block for the specified header (e.g. in C++, when the  
     1646 * header is allocated with "new" operator). 
     1647 * For normal applications, they should use pjsip_xxx_hdr_create() instead, 
     1648 * which allocates memory and initialize it in one go. 
     1649 * 
     1650 * @param pool      Pool for additional memory allocation if required. 
     1651 * @param mem       Pre-allocated memory to be initialized as the header. 
     1652 * 
     1653 * @return          The header instance, which points to the same memory  
     1654 *                  location as the mem argument. 
     1655 */ 
     1656PJ_DECL(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool, 
     1657                                                    void *mem ); 
    12981658 
    12991659/** 
     
    13151675 * 
    13161676 * @param pool      The pool. 
     1677 * @param value     The Retry-After value. 
    13171678 * 
    13181679 * @return          New Retry-After header instance. 
    13191680 */ 
    1320 PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *pool); 
     1681PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *pool, 
     1682                                                             int value); 
     1683 
     1684/** 
     1685 * Initialize a preallocated memory with the header structure.  
     1686 * 
     1687 * @param pool      Pool for additional memory allocation if required. 
     1688 * @param mem       Pre-allocated memory to be initialized as the header. 
     1689 * @param value     The Retry-After value. 
     1690 * 
     1691 * @return          The header instance, which points to the same memory  
     1692 *                  location as the mem argument. 
     1693 */ 
     1694PJ_DECL(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool, 
     1695                                                            void *mem, 
     1696                                                            int value ); 
    13211697 
    13221698 
     
    13431719PJ_DECL(pjsip_supported_hdr*) pjsip_supported_hdr_create(pj_pool_t *pool); 
    13441720 
     1721/** 
     1722 * Initialize a preallocated memory with the header structure.  
     1723 * 
     1724 * @param pool      Pool for additional memory allocation if required. 
     1725 * @param mem       Pre-allocated memory to be initialized as the header. 
     1726 * 
     1727 * @return          The header instance, which points to the same memory  
     1728 *                  location as the mem argument. 
     1729 */ 
     1730PJ_DECL(pjsip_supported_hdr*) pjsip_supported_hdr_init( pj_pool_t *pool, 
     1731                                                        void *mem ); 
    13451732 
    13461733/** 
     
    13661753PJ_DECL(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_create(pj_pool_t *pool); 
    13671754 
     1755/** 
     1756 * Initialize a preallocated memory with the header structure.  
     1757 * 
     1758 * @param pool      Pool for additional memory allocation if required. 
     1759 * @param mem       Pre-allocated memory to be initialized as the header. 
     1760 * 
     1761 * @return          The header instance, which points to the same memory  
     1762 *                  location as the mem argument. 
     1763 */ 
     1764PJ_DECL(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_init( pj_pool_t *pool, 
     1765                                                            void *mem ); 
    13681766 
    13691767/** 
     
    14091807 
    14101808/** 
     1809 * Initialize a preallocated memory with the header structure.  
     1810 * 
     1811 * @param pool      Pool for additional memory allocation if required. 
     1812 * @param mem       Pre-allocated memory to be initialized as the header. 
     1813 * 
     1814 * @return          The header instance, which points to the same memory  
     1815 *                  location as the mem argument. 
     1816 */ 
     1817PJ_DECL(pjsip_via_hdr*) pjsip_via_hdr_init( pj_pool_t *pool, 
     1818                                            void *mem ); 
     1819 
     1820/** 
    14111821 * @} 
    14121822 */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r115 r127  
    7676    int                         cseq;           /**< The CSeq               */ 
    7777    pj_str_t                    transaction_key;/**< Hash table key.        */ 
     78    pj_uint32_t                 hashed_key;     /**< Key's hashed value.    */ 
    7879    pj_str_t                    branch;         /**< The branch Id.         */ 
    7980 
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r123 r127  
    6868 
    6969/** 
     70 * Check if transport tp is secure. 
     71 */ 
     72#define PJSIP_TRANSPORT_IS_SECURE(tp)       \ 
     73            ((tp)->flag & PJSIP_TRANSPORT_SECURE) 
     74 
     75/** 
    7076 * Get the transport type from the transport name. 
    7177 * 
     
    234240 
    235241        /** Max forwards header. */ 
    236         pjsip_max_forwards_hdr  *max_fwd; 
     242        pjsip_max_fwd_hdr       *max_fwd; 
    237243 
    238244        /** The first route header. */ 
  • pjproject/trunk/pjsip/include/pjsip/sip_types.h

    r107 r127  
    103103 
    104104/** 
     105 * Forward declaration for SIP method (sip_msg.h) 
     106 */ 
     107typedef struct pjsip_method pjsip_method; 
     108 
     109/** 
    105110 * Opaque data type for the resolver engine (sip_resolve.h). 
    106111 */ 
     
    117122 */ 
    118123typedef struct pjsip_module pjsip_module; 
     124 
     125 
     126/**  
     127 * Forward declaration for user agent type (sip_ua_layer.h).  
     128 */ 
     129typedef pjsip_module pjsip_user_agent; 
     130 
     131/** 
     132 * Forward declaration for dialog (sip_dialog.h). 
     133 */ 
     134typedef struct pjsip_dialog pjsip_dialog; 
     135 
    119136 
    120137/** 
  • pjproject/trunk/pjsip/include/pjsip/sip_uri.h

    r119 r127  
    162162     * @return the length printed. 
    163163     */ 
    164     int (*p_print)(pjsip_uri_context_e context, 
    165                    const void *uri,  
    166                    char *buf, pj_size_t size); 
     164    pj_ssize_t (*p_print)(pjsip_uri_context_e context, 
     165                          const void *uri,  
     166                          char *buf, pj_size_t size); 
    167167 
    168168    /**  
     
    333333 * @return SIP URL. 
    334334 */ 
    335 PJ_DECL(pjsip_sip_uri*) pjsip_url_create( pj_pool_t *pool, int secure ); 
     335PJ_DECL(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool, int secure ); 
    336336 
    337337/** 
     
    340340 * @return          SIPS URL. 
    341341 */ 
    342 PJ_DECL(pjsip_sip_uri*) pjsips_url_create( pj_pool_t *pool ); 
     342PJ_DECL(pjsip_sip_uri*) pjsip_sips_uri_create( pj_pool_t *pool ); 
    343343 
    344344/** 
     
    346346 * @param url       The URL. 
    347347 */ 
    348 PJ_DECL(void)  pjsip_url_init(pjsip_sip_uri *url, int secure); 
     348PJ_DECL(void)  pjsip_sip_uri_init(pjsip_sip_uri *url, int secure); 
    349349 
    350350/** 
     
    354354 * @param rhs       The source URL. 
    355355 */ 
    356 PJ_DECL(void)  pjsip_url_assign(pj_pool_t *pool, pjsip_sip_uri *url,  
    357                                 const pjsip_sip_uri *rhs); 
     356PJ_DECL(void)  pjsip_sip_uri_assign(pj_pool_t *pool, pjsip_sip_uri *url,  
     357                                    const pjsip_sip_uri *rhs); 
    358358 
    359359/** 
  • pjproject/trunk/pjsip/src/pjsip/sip_auth_client.c

    r123 r127  
    349349    sess->cred_info = NULL; 
    350350    pj_list_init(&sess->cached_auth); 
     351 
     352    return PJ_SUCCESS; 
     353} 
     354 
     355 
     356/* Clone session. */ 
     357PJ_DEF(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool, 
     358                                          pjsip_auth_clt_sess *sess, 
     359                                          const pjsip_auth_clt_sess *rhs ) 
     360{ 
     361    unsigned i; 
     362 
     363    PJ_ASSERT_RETURN(pool && sess && rhs, PJ_EINVAL); 
     364 
     365    sess->pool = pool; 
     366    sess->endpt = (pjsip_endpoint*)rhs->endpt; 
     367    sess->cred_cnt = rhs->cred_cnt; 
     368    sess->cred_info = pj_pool_alloc(pool,  
     369                                    sess->cred_cnt*sizeof(pjsip_cred_info)); 
     370    for (i=0; i<rhs->cred_cnt; ++i) { 
     371        pj_strdup(pool, &sess->cred_info[i].realm, &rhs->cred_info[i].realm); 
     372        pj_strdup(pool, &sess->cred_info[i].scheme, &rhs->cred_info[i].scheme); 
     373        pj_strdup(pool, &sess->cred_info[i].username,  
     374                  &rhs->cred_info[i].username); 
     375        sess->cred_info[i].data_type = rhs->cred_info[i].data_type; 
     376        pj_strdup(pool, &sess->cred_info[i].data, &rhs->cred_info[i].data); 
     377    } 
     378 
     379    /* TODO note: 
     380     * Cloning the full authentication client is quite a big task. 
     381     * We do only the necessary bits here, i.e. cloning the credentials. 
     382     * The drawback of this basic approach is, a forked dialog will have to 
     383     * re-authenticate itself on the next request because it has lost the 
     384     * cached authentication headers. 
     385     */ 
     386    PJ_TODO(FULL_CLONE_OF_AUTH_CLIENT_SESSION); 
    351387 
    352388    return PJ_SUCCESS; 
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r116 r127  
    7878    pjsip_module         module_list; 
    7979 
    80     /** Number of supported methods. */ 
    81     unsigned             method_cnt; 
    82  
    83     /** Array of supported methods. */ 
    84     const pjsip_method  *methods[MAX_METHODS]; 
    85  
    86     /** Allow header. */ 
    87     pjsip_allow_hdr     *allow_hdr; 
    88  
    8980    /** Route header list. */ 
    9081    pjsip_route_hdr      route_hdr_list; 
     82 
     83    /** Capability header list. */ 
     84    pjsip_hdr            cap_hdr; 
    9185 
    9286    /** Additional request headers. */ 
     
    197191 
    198192    /* Done. */ 
    199     PJ_TODO(BUILD_ALLOW_HEADER_BASED_ON_MODULES_SUPPORTED_METHODS); 
    200193 
    201194on_return: 
     
    249242    status = PJ_SUCCESS; 
    250243 
    251     PJ_TODO(REMOVE_METHODS_FROM_ALLOW_HEADER_WHEN_MODULE_IS_UNREGISTERED); 
    252  
    253244on_return: 
    254245    pj_rwmutex_unlock_write(endpt->mod_mutex); 
     
    256247} 
    257248 
    258 /* 
    259  * Get "Allow" header. 
    260  */ 
    261 PJ_DEF(const pjsip_allow_hdr*) pjsip_endpt_get_allow_hdr( pjsip_endpoint *endpt ) 
    262 { 
    263     return endpt->allow_hdr; 
     249 
     250/* 
     251 * Get the value of the specified capability header field. 
     252 */ 
     253PJ_DEF(const pjsip_hdr*) pjsip_endpt_get_capability( pjsip_endpoint *endpt, 
     254                                                     int htype, 
     255                                                     const pj_str_t *hname) 
     256{ 
     257    pjsip_hdr *hdr = endpt->cap_hdr.next; 
     258 
     259    /* Check arguments. */ 
     260    PJ_ASSERT_RETURN(endpt != NULL, NULL); 
     261    PJ_ASSERT_RETURN(htype != PJSIP_H_OTHER || hname, NULL); 
     262 
     263    if (htype != PJSIP_H_OTHER) { 
     264        while (hdr != &endpt->cap_hdr) { 
     265            if (hdr->type == htype) 
     266                return hdr; 
     267            hdr = hdr->next; 
     268        } 
     269    } 
     270    return NULL; 
     271} 
     272 
     273 
     274/* 
     275 * Add or register new capabilities as indicated by the tags to the 
     276 * appropriate header fields in the endpoint. 
     277 */ 
     278PJ_DEF(pj_status_t) pjsip_endpt_add_capability( pjsip_endpoint *endpt, 
     279                                                pjsip_module *mod, 
     280                                                int htype, 
     281                                                const pj_str_t *hname, 
     282                                                unsigned count, 
     283                                                const pj_str_t tags[]) 
     284{ 
     285    pjsip_generic_array_hdr *hdr; 
     286    unsigned i; 
     287 
     288    /* Check arguments. */ 
     289    PJ_ASSERT_RETURN(endpt!=NULL && mod!=NULL && count>0 && tags, PJ_EINVAL); 
     290    PJ_ASSERT_RETURN(htype==PJSIP_H_ACCEPT ||  
     291                     htype==PJSIP_H_ALLOW || 
     292                     htype==PJSIP_H_SUPPORTED, 
     293                     PJ_EINVAL); 
     294 
     295    /* Find the header. */ 
     296    hdr = (pjsip_generic_array_hdr*) pjsip_endpt_get_capability(endpt,  
     297                                                                htype, hname); 
     298 
     299    /* Create the header when it's not present */ 
     300    if (hdr == NULL) { 
     301        switch (htype) { 
     302        case PJSIP_H_ACCEPT: 
     303            hdr = pjsip_accept_hdr_create(endpt->pool); 
     304            break; 
     305        case PJSIP_H_ALLOW: 
     306            hdr = pjsip_allow_hdr_create(endpt->pool); 
     307            break; 
     308        case PJSIP_H_SUPPORTED: 
     309            hdr = pjsip_supported_hdr_create(endpt->pool); 
     310            break; 
     311        default: 
     312            return PJ_EINVAL; 
     313        } 
     314    } 
     315 
     316    /* Add the tags to the header. */ 
     317    for (i=0; i<count; ++i) { 
     318        pj_strdup(endpt->pool, &hdr->values[hdr->count], &tags[i]); 
     319        ++hdr->count; 
     320    } 
     321 
     322    /* Done. */ 
     323    return PJ_SUCCESS; 
    264324} 
    265325 
     
    326386    pj_pool_t *pool; 
    327387    pjsip_endpoint *endpt; 
    328     pjsip_max_forwards_hdr *mf_hdr; 
     388    pjsip_max_fwd_hdr *mf_hdr; 
    329389    pj_lock_t *lock = NULL; 
    330390 
     
    420480 
    421481    /* Add "Max-Forwards" for request header. */ 
    422     mf_hdr = pjsip_max_forwards_hdr_create(endpt->pool); 
    423     mf_hdr->ivalue = PJSIP_MAX_FORWARDS_VALUE; 
     482    mf_hdr = pjsip_max_fwd_hdr_create(endpt->pool, 
     483                                      PJSIP_MAX_FORWARDS_VALUE); 
    424484    pj_list_insert_before( &endpt->req_hdr, mf_hdr); 
     485 
     486    /* Initialize capability header list. */ 
     487    pj_list_init(&endpt->cap_hdr); 
    425488 
    426489    /* Done. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_errno.c

    r123 r127  
    4646    { PJSIP_EINVALIDSTATUS,     "Invalid status code"}, 
    4747 
     48    { PJSIP_EINVALIDURI,        "Invalid URI" }, 
    4849    { PJSIP_EINVALIDSCHEME,     "Invalid URI scheme" }, 
    4950    { PJSIP_EMISSINGREQURI,     "Missing Request-URI" }, 
     
    7879    { PJSIP_EAUTHACCDISABLED,   "Account or credential is disabled" }, 
    7980    { PJSIP_EAUTHINVALIDREALM,  "Invalid authorization realm"}, 
    80     { PJSIP_EAUTHINVALIDDIGEST, "Invalid authorization digest" } 
     81    { PJSIP_EAUTHINVALIDDIGEST, "Invalid authorization digest" }, 
     82 
     83    /* UA/dialog layer. */ 
     84    { PJSIP_EMISSINGTAG,        "Missing From/To tag parameter" } 
    8185}; 
    8286 
  • pjproject/trunk/pjsip/src/pjsip/sip_msg.c

    r119 r127  
    499499}; 
    500500 
    501 PJ_DEF(pjsip_generic_string_hdr*) pjsip_generic_string_hdr_create( pj_pool_t *pool, 
    502                                                      const pj_str_t *hnames ) 
    503 { 
    504     pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(pjsip_generic_string_hdr)); 
     501PJ_DEF(pjsip_generic_string_hdr*)  
     502pjsip_generic_string_hdr_init( pj_pool_t *pool, 
     503                               void *mem, 
     504                               const pj_str_t *hnames, 
     505                               const pj_str_t *hvalue) 
     506{ 
     507    pjsip_generic_string_hdr *hdr = mem; 
     508 
    505509    init_hdr(hdr, PJSIP_H_OTHER, &generic_hdr_vptr); 
    506510    if (hnames) { 
     
    508512        hdr->sname = hdr->name; 
    509513    } 
    510     hdr->hvalue.ptr = NULL; 
    511     hdr->hvalue.slen = 0; 
    512     return hdr; 
    513 } 
    514  
    515 PJ_DEF(pjsip_generic_string_hdr*) pjsip_generic_string_hdr_create_with_text( pj_pool_t *pool, 
    516                                                                const pj_str_t *hname, 
    517                                                                const pj_str_t *hvalue) 
    518 { 
    519     pjsip_generic_string_hdr *hdr = pjsip_generic_string_hdr_create(pool, hname); 
    520     pj_strdup(pool, &hdr->hvalue, hvalue); 
    521     return hdr; 
    522 } 
    523  
    524 static int pjsip_generic_string_hdr_print( pjsip_generic_string_hdr *hdr,  
    525                                     char *buf, pj_size_t size) 
     514    if (hvalue) { 
     515        pj_strdup(pool, &hdr->hvalue, hvalue); 
     516    } else { 
     517        hdr->hvalue.ptr = NULL; 
     518        hdr->hvalue.slen = 0; 
     519    } 
     520 
     521    return hdr; 
     522} 
     523 
     524PJ_DEF(pjsip_generic_string_hdr*)  
     525pjsip_generic_string_hdr_create( pj_pool_t *pool, 
     526                                 const pj_str_t *hnames, 
     527                                 const pj_str_t *hvalue) 
     528{ 
     529    void *mem = pj_pool_alloc(pool, sizeof(pjsip_generic_string_hdr)); 
     530    return pjsip_generic_string_hdr_init(pool, mem, hnames, hvalue); 
     531} 
     532 
     533static int pjsip_generic_string_hdr_print( pjsip_generic_string_hdr *hdr, 
     534                                           char *buf, pj_size_t size) 
    526535{ 
    527536    char *p = buf; 
     
    544553                                                   const pjsip_generic_string_hdr *rhs) 
    545554{ 
    546     pjsip_generic_string_hdr *hdr = pjsip_generic_string_hdr_create(pool, &rhs->name); 
     555    pjsip_generic_string_hdr *hdr; 
     556     
     557    hdr = pjsip_generic_string_hdr_create(pool, &rhs->name, &rhs->hvalue); 
    547558 
    548559    hdr->type = rhs->type; 
    549560    hdr->sname = hdr->name; 
    550     pj_strdup( pool, &hdr->hvalue, &rhs->hvalue); 
    551561    return hdr; 
    552562} 
     
    579589}; 
    580590 
    581 PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool, 
    582                                                      const pj_str_t *hnames ) 
    583 { 
    584     pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(pjsip_generic_int_hdr)); 
     591PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_init(  pj_pool_t *pool, 
     592                                                            void *mem, 
     593                                                            const pj_str_t *hnames, 
     594                                                            int value) 
     595{ 
     596    pjsip_generic_int_hdr *hdr = mem; 
     597 
    585598    init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr); 
    586599    if (hnames) { 
     
    588601        hdr->sname = hdr->name; 
    589602    } 
    590     hdr->ivalue = 0; 
    591     return hdr; 
    592 } 
    593  
    594 PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create_with_value( pj_pool_t *pool, 
    595                                                                const pj_str_t *hname, 
    596                                                                int value) 
    597 { 
    598     pjsip_generic_int_hdr *hdr = pjsip_generic_int_hdr_create(pool, hname); 
    599603    hdr->ivalue = value; 
    600604    return hdr; 
     605} 
     606 
     607PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_create( pj_pool_t *pool, 
     608                                                     const pj_str_t *hnames, 
     609                                                     int value) 
     610{ 
     611    void *mem = pj_pool_alloc(pool, sizeof(pjsip_generic_int_hdr)); 
     612    return pjsip_generic_int_hdr_init(pool, mem, hnames, value); 
    601613} 
    602614 
     
    652664}; 
    653665 
    654 PJ_DEF(pjsip_generic_array_hdr*) pjsip_generic_array_create( pj_pool_t *pool, 
    655                                                              const pj_str_t *hnames) 
    656 { 
    657     pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(pjsip_generic_array_hdr)); 
     666 
     667PJ_DEF(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_init( pj_pool_t *pool, 
     668                                                               void *mem, 
     669                                                               const pj_str_t *hnames) 
     670{ 
     671    pjsip_generic_array_hdr *hdr = mem; 
     672 
    658673    init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr); 
    659674    if (hnames) { 
     
    663678    hdr->count = 0; 
    664679    return hdr; 
     680} 
     681 
     682PJ_DEF(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_create( pj_pool_t *pool, 
     683                                                             const pj_str_t *hnames) 
     684{ 
     685    void *mem = pj_pool_alloc(pool, sizeof(pjsip_generic_array_hdr)); 
     686    return pjsip_generic_array_hdr_init(pool, mem, hnames); 
    665687 
    666688} 
     
    714736 * Accept header. 
    715737 */ 
    716 PJ_DEF(pjsip_accept_hdr*) pjsip_accept_hdr_create(pj_pool_t *pool) 
    717 { 
    718     pjsip_accept_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     738PJ_DEF(pjsip_accept_hdr*) pjsip_accept_hdr_init( pj_pool_t *pool, 
     739                                                 void *mem ) 
     740{ 
     741    pjsip_accept_hdr *hdr = mem; 
     742 
     743    PJ_UNUSED_ARG(pool); 
     744 
    719745    init_hdr(hdr, PJSIP_H_ACCEPT, &generic_array_hdr_vptr); 
    720746    hdr->count = 0; 
     
    722748} 
    723749 
     750PJ_DEF(pjsip_accept_hdr*) pjsip_accept_hdr_create(pj_pool_t *pool) 
     751{ 
     752    void *mem = pj_pool_alloc(pool, sizeof(pjsip_accept_hdr)); 
     753    return pjsip_accept_hdr_init(pool, mem); 
     754} 
     755 
    724756 
    725757/////////////////////////////////////////////////////////////////////////////// 
     
    728760 */ 
    729761 
    730 PJ_DEF(pjsip_allow_hdr*) pjsip_allow_hdr_create(pj_pool_t *pool) 
    731 { 
    732     pjsip_allow_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     762PJ_DEF(pjsip_allow_hdr*) pjsip_allow_hdr_init( pj_pool_t *pool, 
     763                                               void *mem ) 
     764{ 
     765    pjsip_allow_hdr *hdr = mem; 
     766 
     767    PJ_UNUSED_ARG(pool); 
     768 
    733769    init_hdr(hdr, PJSIP_H_ALLOW, &generic_array_hdr_vptr); 
    734770    hdr->count = 0; 
     
    736772} 
    737773 
     774PJ_DEF(pjsip_allow_hdr*) pjsip_allow_hdr_create(pj_pool_t *pool) 
     775{ 
     776    void *mem = pj_pool_alloc(pool, sizeof(pjsip_allow_hdr)); 
     777    return pjsip_allow_hdr_init(pool, mem); 
     778} 
     779 
    738780/////////////////////////////////////////////////////////////////////////////// 
    739781/* 
     
    741783 */ 
    742784 
     785PJ_DEF(pjsip_cid_hdr*) pjsip_cid_hdr_init( pj_pool_t *pool, 
     786                                           void *mem ) 
     787{ 
     788    pjsip_cid_hdr *hdr = mem; 
     789 
     790    PJ_UNUSED_ARG(pool); 
     791 
     792    init_hdr(hdr, PJSIP_H_CALL_ID, &generic_hdr_vptr); 
     793    return hdr; 
     794 
     795} 
     796 
    743797PJ_DEF(pjsip_cid_hdr*) pjsip_cid_hdr_create( pj_pool_t *pool ) 
    744798{ 
    745     pjsip_cid_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
    746     init_hdr(hdr, PJSIP_H_CALL_ID, &generic_hdr_vptr); 
    747     return hdr; 
     799    void *mem = pj_pool_alloc(pool, sizeof(pjsip_cid_hdr)); 
     800    return pjsip_cid_hdr_init(pool, mem); 
    748801} 
    749802 
     
    764817}; 
    765818 
    766 PJ_DEF(pjsip_clen_hdr*) pjsip_clen_hdr_create( pj_pool_t *pool ) 
    767 { 
    768     pjsip_clen_hdr *hdr = pj_pool_alloc(pool, sizeof(pjsip_clen_hdr)); 
     819PJ_DEF(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool, 
     820                                             void *mem ) 
     821{ 
     822    pjsip_clen_hdr *hdr = mem; 
     823 
     824    PJ_UNUSED_ARG(pool); 
     825 
    769826    init_hdr(hdr, PJSIP_H_CONTENT_LENGTH, &clen_hdr_vptr); 
    770827    hdr->len = 0; 
    771828    return hdr; 
     829} 
     830 
     831PJ_DEF(pjsip_clen_hdr*) pjsip_clen_hdr_create( pj_pool_t *pool ) 
     832{ 
     833    void *mem = pj_pool_alloc(pool, sizeof(pjsip_clen_hdr)); 
     834    return pjsip_clen_hdr_init(pool, mem); 
    772835} 
    773836 
     
    816879}; 
    817880 
    818 PJ_DEF(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool ) 
    819 { 
    820     pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(pjsip_cseq_hdr)); 
     881PJ_DEF(pjsip_cseq_hdr*) pjsip_cseq_hdr_init( pj_pool_t *pool, 
     882                                             void *mem ) 
     883{ 
     884    pjsip_cseq_hdr *hdr = mem; 
     885 
     886    PJ_UNUSED_ARG(pool); 
     887 
    821888    init_hdr(hdr, PJSIP_H_CSEQ, &cseq_hdr_vptr); 
    822889    hdr->cseq = 0; 
     
    827894} 
    828895 
     896PJ_DEF(pjsip_cseq_hdr*) pjsip_cseq_hdr_create( pj_pool_t *pool ) 
     897{ 
     898    void *mem = pj_pool_alloc(pool, sizeof(pjsip_cseq_hdr)); 
     899    return pjsip_cseq_hdr_init(pool, mem); 
     900} 
     901 
    829902static int pjsip_cseq_hdr_print( pjsip_cseq_hdr *hdr, char *buf, pj_size_t size) 
    830903{ 
     
    885958}; 
    886959 
    887 PJ_DEF(pjsip_contact_hdr*) pjsip_contact_hdr_create( pj_pool_t *pool ) 
    888 { 
    889     pjsip_contact_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
     960PJ_DEF(pjsip_contact_hdr*) pjsip_contact_hdr_init( pj_pool_t *pool, 
     961                                                   void *mem ) 
     962{ 
     963    pjsip_contact_hdr *hdr = mem; 
     964 
     965    PJ_UNUSED_ARG(pool); 
     966 
     967    pj_memset(mem, 0, sizeof(pjsip_contact_hdr)); 
    890968    init_hdr(hdr, PJSIP_H_CONTACT, &contact_hdr_vptr); 
    891969    hdr->expires = -1; 
    892970    pj_list_init(&hdr->other_param); 
    893971    return hdr; 
     972} 
     973 
     974PJ_DEF(pjsip_contact_hdr*) pjsip_contact_hdr_create( pj_pool_t *pool ) 
     975{ 
     976    void *mem = pj_pool_alloc(pool, sizeof(pjsip_contact_hdr)); 
     977    return pjsip_contact_hdr_init(pool, mem); 
    894978} 
    895979 
     
    10031087}; 
    10041088 
     1089PJ_DEF(pjsip_ctype_hdr*) pjsip_ctype_hdr_init( pj_pool_t *pool, 
     1090                                               void *mem ) 
     1091{ 
     1092    pjsip_ctype_hdr *hdr = mem; 
     1093 
     1094    PJ_UNUSED_ARG(pool); 
     1095 
     1096    pj_memset(mem, 0, sizeof(pjsip_ctype_hdr)); 
     1097    init_hdr(hdr, PJSIP_H_CONTENT_TYPE, &ctype_hdr_vptr); 
     1098    return hdr; 
     1099 
     1100} 
     1101 
    10051102PJ_DEF(pjsip_ctype_hdr*) pjsip_ctype_hdr_create( pj_pool_t *pool ) 
    10061103{ 
    1007     pjsip_ctype_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
    1008     init_hdr(hdr, PJSIP_H_CONTENT_TYPE, &ctype_hdr_vptr); 
    1009     return hdr; 
     1104    void *mem = pj_pool_alloc(pool, sizeof(pjsip_ctype_hdr)); 
     1105    return pjsip_ctype_hdr_init(pool, mem); 
    10101106} 
    10111107 
     
    10671163 * Expires header. 
    10681164 */ 
    1069 PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool ) 
    1070 { 
    1071     pjsip_expires_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1165PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool, 
     1166                                                   void *mem, 
     1167                                                   int value) 
     1168{ 
     1169    pjsip_expires_hdr *hdr = mem; 
     1170 
     1171    PJ_UNUSED_ARG(pool); 
     1172 
    10721173    init_hdr(hdr, PJSIP_H_EXPIRES, &generic_int_hdr_vptr); 
    1073     hdr->ivalue = 0; 
    1074     return hdr; 
     1174    hdr->ivalue = value; 
     1175    return hdr; 
     1176 
     1177} 
     1178 
     1179PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_create( pj_pool_t *pool, 
     1180                                                     int value ) 
     1181{ 
     1182    void *mem = pj_pool_alloc(pool, sizeof(pjsip_expires_hdr)); 
     1183    return pjsip_expires_hdr_init(pool, mem, value); 
    10751184} 
    10761185 
     
    10941203}; 
    10951204 
    1096 PJ_DEF(pjsip_from_hdr*) pjsip_from_hdr_create( pj_pool_t *pool ) 
    1097 { 
    1098     pjsip_from_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
     1205PJ_DEF(pjsip_from_hdr*) pjsip_from_hdr_init( pj_pool_t *pool, 
     1206                                             void *mem ) 
     1207{ 
     1208    pjsip_from_hdr *hdr = mem; 
     1209 
     1210    PJ_UNUSED_ARG(pool); 
     1211 
     1212    pj_memset(mem, 0, sizeof(pjsip_from_hdr)); 
    10991213    init_hdr(hdr, PJSIP_H_FROM, &fromto_hdr_vptr); 
    11001214    pj_list_init(&hdr->other_param); 
     
    11021216} 
    11031217 
    1104 PJ_DEF(pjsip_to_hdr*) pjsip_to_hdr_create( pj_pool_t *pool ) 
    1105 { 
    1106     pjsip_to_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
     1218PJ_DEF(pjsip_from_hdr*) pjsip_from_hdr_create( pj_pool_t *pool ) 
     1219{ 
     1220    void *mem = pj_pool_alloc(pool, sizeof(pjsip_from_hdr)); 
     1221    return pjsip_from_hdr_init(pool, mem); 
     1222} 
     1223 
     1224PJ_DEF(pjsip_to_hdr*) pjsip_to_hdr_init( pj_pool_t *pool, 
     1225                                         void *mem ) 
     1226{ 
     1227    pjsip_to_hdr *hdr = mem; 
     1228 
     1229    PJ_UNUSED_ARG(pool); 
     1230 
     1231    pj_memset(mem, 0, sizeof(pjsip_to_hdr)); 
    11071232    init_hdr(hdr, PJSIP_H_TO, &fromto_hdr_vptr); 
    11081233    pj_list_init(&hdr->other_param); 
    11091234    return hdr; 
    1110 } 
    1111  
    1112 PJ_DEF(pjsip_from_hdr*) pjsip_fromto_set_from( pjsip_fromto_hdr *hdr ) 
     1235 
     1236} 
     1237 
     1238PJ_DEF(pjsip_to_hdr*) pjsip_to_hdr_create( pj_pool_t *pool ) 
     1239{ 
     1240    void *mem = pj_pool_alloc(pool, sizeof(pjsip_to_hdr)); 
     1241    return pjsip_to_hdr_init(pool, mem); 
     1242} 
     1243 
     1244PJ_DEF(pjsip_from_hdr*) pjsip_fromto_hdr_set_from( pjsip_fromto_hdr *hdr ) 
    11131245{ 
    11141246    hdr->type = PJSIP_H_FROM; 
     
    11171249} 
    11181250 
    1119 PJ_DEF(pjsip_to_hdr*) pjsip_fromto_set_to( pjsip_fromto_hdr *hdr ) 
     1251PJ_DEF(pjsip_to_hdr*) pjsip_fromto_hdr_set_to( pjsip_fromto_hdr *hdr ) 
    11201252{ 
    11211253    hdr->type = PJSIP_H_TO; 
     
    11841316 * Max-Forwards header. 
    11851317 */ 
    1186 PJ_DEF(pjsip_max_forwards_hdr*) pjsip_max_forwards_hdr_create(pj_pool_t *pool) 
    1187 { 
    1188     pjsip_max_forwards_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1318PJ_DEF(pjsip_max_fwd_hdr*) pjsip_max_fwd_hdr_init( pj_pool_t *pool, 
     1319                                                   void *mem, 
     1320                                                   int value) 
     1321{ 
     1322    pjsip_max_fwd_hdr *hdr = mem; 
     1323 
     1324    PJ_UNUSED_ARG(pool); 
     1325 
    11891326    init_hdr(hdr, PJSIP_H_MAX_FORWARDS, &generic_int_hdr_vptr); 
    1190     hdr->ivalue = 0; 
    1191     return hdr; 
     1327    hdr->ivalue = value; 
     1328    return hdr; 
     1329 
     1330} 
     1331 
     1332PJ_DEF(pjsip_max_fwd_hdr*) pjsip_max_fwd_hdr_create(pj_pool_t *pool, 
     1333                                                    int value) 
     1334{ 
     1335    void *mem = pj_pool_alloc(pool, sizeof(pjsip_max_fwd_hdr)); 
     1336    return pjsip_max_fwd_hdr_init(pool, mem, value); 
    11921337} 
    11931338 
     
    11971342 * Min-Expires header. 
    11981343 */ 
    1199 PJ_DECL(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool) 
    1200 { 
    1201     pjsip_min_expires_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1344PJ_DEF(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool, 
     1345                                                           void *mem, 
     1346                                                           int value ) 
     1347{ 
     1348    pjsip_min_expires_hdr *hdr = mem; 
     1349 
     1350    PJ_UNUSED_ARG(pool); 
     1351 
    12021352    init_hdr(hdr, PJSIP_H_MIN_EXPIRES, &generic_int_hdr_vptr); 
    1203     hdr->ivalue = 0; 
    1204     return hdr; 
     1353    hdr->ivalue = value; 
     1354    return hdr; 
     1355} 
     1356 
     1357PJ_DEF(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_create(pj_pool_t *pool, 
     1358                                                            int value ) 
     1359{ 
     1360    void *mem = pj_pool_alloc(pool, sizeof(pjsip_min_expires_hdr)); 
     1361    return pjsip_min_expires_hdr_init(pool, mem, value ); 
    12051362} 
    12061363 
     
    12201377}; 
    12211378 
    1222 PJ_DEF(pjsip_rr_hdr*) pjsip_rr_hdr_create( pj_pool_t *pool ) 
    1223 { 
    1224     pjsip_rr_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1379PJ_DEF(pjsip_rr_hdr*) pjsip_rr_hdr_init( pj_pool_t *pool, 
     1380                                         void *mem ) 
     1381{ 
     1382    pjsip_rr_hdr *hdr = mem; 
     1383 
     1384    PJ_UNUSED_ARG(pool); 
     1385 
    12251386    init_hdr(hdr, PJSIP_H_RECORD_ROUTE, &routing_hdr_vptr); 
    12261387    pjsip_name_addr_init(&hdr->name_addr); 
    12271388    pj_list_init(&hdr->other_param); 
    12281389    return hdr; 
    1229 } 
    1230  
    1231 PJ_DEF(pjsip_route_hdr*) pjsip_route_hdr_create( pj_pool_t *pool ) 
    1232 { 
    1233     pjsip_route_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1390 
     1391} 
     1392 
     1393PJ_DEF(pjsip_rr_hdr*) pjsip_rr_hdr_create( pj_pool_t *pool ) 
     1394{ 
     1395    void *mem = pj_pool_alloc(pool, sizeof(pjsip_rr_hdr)); 
     1396    return pjsip_rr_hdr_init(pool, mem); 
     1397} 
     1398 
     1399PJ_DEF(pjsip_route_hdr*) pjsip_route_hdr_init( pj_pool_t *pool, 
     1400                                               void *mem ) 
     1401{ 
     1402    pjsip_route_hdr *hdr = mem; 
     1403 
     1404    PJ_UNUSED_ARG(pool); 
     1405 
    12341406    init_hdr(hdr, PJSIP_H_ROUTE, &routing_hdr_vptr); 
    12351407    pjsip_name_addr_init(&hdr->name_addr); 
    12361408    pj_list_init(&hdr->other_param); 
    12371409    return hdr; 
     1410} 
     1411 
     1412PJ_DEF(pjsip_route_hdr*) pjsip_route_hdr_create( pj_pool_t *pool ) 
     1413{ 
     1414    void *mem = pj_pool_alloc(pool, sizeof(pjsip_route_hdr)); 
     1415    return pjsip_route_hdr_init(pool, mem); 
    12381416} 
    12391417 
     
    13051483 * Require header. 
    13061484 */ 
    1307 PJ_DEF(pjsip_require_hdr*) pjsip_require_hdr_create(pj_pool_t *pool) 
    1308 { 
    1309     pjsip_require_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1485PJ_DEF(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool, 
     1486                                                   void *mem ) 
     1487{ 
     1488    pjsip_require_hdr *hdr = mem; 
     1489 
     1490    PJ_UNUSED_ARG(pool); 
     1491 
    13101492    init_hdr(hdr, PJSIP_H_REQUIRE, &generic_array_hdr_vptr); 
    13111493    hdr->count = 0; 
     
    13131495} 
    13141496 
     1497PJ_DEF(pjsip_require_hdr*) pjsip_require_hdr_create(pj_pool_t *pool) 
     1498{ 
     1499    void *mem = pj_pool_alloc(pool, sizeof(pjsip_require_hdr)); 
     1500    return pjsip_require_hdr_init(pool, mem); 
     1501} 
     1502 
    13151503/////////////////////////////////////////////////////////////////////////////// 
    13161504/* 
    13171505 * Retry-After header. 
    13181506 */ 
    1319 PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *pool) 
    1320 { 
    1321     pjsip_retry_after_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1507PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool, 
     1508                                                           void *mem, 
     1509                                                           int value ) 
     1510{ 
     1511    pjsip_retry_after_hdr *hdr = mem; 
     1512 
     1513    PJ_UNUSED_ARG(pool); 
     1514 
    13221515    init_hdr(hdr, PJSIP_H_RETRY_AFTER, &generic_int_hdr_vptr); 
    1323     hdr->ivalue = 0; 
    1324     return hdr; 
     1516    hdr->ivalue = value; 
     1517    return hdr; 
     1518} 
     1519 
     1520PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *pool, 
     1521                                                            int value ) 
     1522{ 
     1523    void *mem = pj_pool_alloc(pool, sizeof(pjsip_retry_after_hdr)); 
     1524    return pjsip_retry_after_hdr_init(pool, mem, value ); 
    13251525} 
    13261526 
     
    13301530 * Supported header. 
    13311531 */ 
    1332 PJ_DEF(pjsip_supported_hdr*) pjsip_supported_hdr_create(pj_pool_t *pool) 
    1333 { 
    1334     pjsip_supported_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1532PJ_DEF(pjsip_supported_hdr*) pjsip_supported_hdr_init( pj_pool_t *pool, 
     1533                                                       void *mem ) 
     1534{ 
     1535    pjsip_supported_hdr *hdr = mem; 
     1536 
     1537    PJ_UNUSED_ARG(pool); 
    13351538    init_hdr(hdr, PJSIP_H_SUPPORTED, &generic_array_hdr_vptr); 
    13361539    hdr->count = 0; 
     
    13381541} 
    13391542 
     1543PJ_DEF(pjsip_supported_hdr*) pjsip_supported_hdr_create(pj_pool_t *pool) 
     1544{ 
     1545    void *mem = pj_pool_alloc(pool, sizeof(pjsip_supported_hdr)); 
     1546    return pjsip_supported_hdr_init(pool, mem); 
     1547} 
     1548 
    13401549 
    13411550/////////////////////////////////////////////////////////////////////////////// 
     
    13431552 * Unsupported header. 
    13441553 */ 
    1345 PJ_DEF(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_create(pj_pool_t *pool) 
    1346 { 
    1347     pjsip_unsupported_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr)); 
     1554PJ_DEF(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_init( pj_pool_t *pool, 
     1555                                                           void *mem ) 
     1556{ 
     1557    pjsip_unsupported_hdr *hdr = mem; 
     1558     
     1559    PJ_UNUSED_ARG(pool); 
     1560 
    13481561    init_hdr(hdr, PJSIP_H_UNSUPPORTED, &generic_array_hdr_vptr); 
    13491562    hdr->count = 0; 
    13501563    return hdr; 
     1564} 
     1565 
     1566PJ_DEF(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_create(pj_pool_t *pool) 
     1567{ 
     1568    void *mem = pj_pool_alloc(pool, sizeof(pjsip_unsupported_hdr)); 
     1569    return pjsip_unsupported_hdr_init(pool, mem); 
    13511570} 
    13521571 
     
    13661585}; 
    13671586 
    1368 PJ_DEF(pjsip_via_hdr*) pjsip_via_hdr_create( pj_pool_t *pool ) 
    1369 { 
    1370     pjsip_via_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr)); 
     1587PJ_DEF(pjsip_via_hdr*) pjsip_via_hdr_init( pj_pool_t *pool, 
     1588                                           void *mem ) 
     1589{ 
     1590    pjsip_via_hdr *hdr = mem; 
     1591 
     1592    PJ_UNUSED_ARG(pool); 
     1593 
     1594    pj_memset(mem, 0, sizeof(pjsip_via_hdr)); 
    13711595    init_hdr(hdr, PJSIP_H_VIA, &via_hdr_vptr); 
    1372     //hdr->sent_by.port = 5060; 
    13731596    hdr->ttl_param = -1; 
    13741597    hdr->rport_param = -1; 
    13751598    pj_list_init(&hdr->other_param); 
    13761599    return hdr; 
     1600 
     1601} 
     1602 
     1603PJ_DEF(pjsip_via_hdr*) pjsip_via_hdr_create( pj_pool_t *pool ) 
     1604{ 
     1605    void *mem = pj_pool_alloc(pool, sizeof(pjsip_via_hdr)); 
     1606    return pjsip_via_hdr_init(pool, mem); 
    13771607} 
    13781608 
  • pjproject/trunk/pjsip/src/pjsip/sip_parser.c

    r123 r127  
    11681168 
    11691169    if (parser_stricmp(scheme, pjsip_SIP_STR)==0) { 
    1170         url = pjsip_url_create(pool, 0); 
     1170        url = pjsip_sip_uri_create(pool, 0); 
    11711171 
    11721172    } else if (parser_stricmp(scheme, pjsip_SIPS_STR)==0) { 
    1173         url = pjsip_url_create(pool, 1); 
     1173        url = pjsip_sip_uri_create(pool, 1); 
    11741174 
    11751175    } else { 
     
    15421542static pjsip_hdr* parse_hdr_expires(pjsip_parse_ctx *ctx) 
    15431543{ 
    1544     pjsip_expires_hdr *hdr = pjsip_expires_hdr_create(ctx->pool); 
     1544    pjsip_expires_hdr *hdr = pjsip_expires_hdr_create(ctx->pool, 0); 
    15451545    parse_generic_int_hdr(hdr, ctx->scanner); 
    15461546    return (pjsip_hdr*)hdr; 
     
    16021602{ 
    16031603    pjsip_retry_after_hdr *hdr; 
    1604     hdr = pjsip_retry_after_hdr_create(ctx->pool); 
     1604    hdr = pjsip_retry_after_hdr_create(ctx->pool, 0); 
    16051605    parse_generic_int_hdr(hdr, ctx->scanner); 
    16061606    return (pjsip_hdr*)hdr; 
     
    16741674static pjsip_hdr* parse_hdr_max_forwards( pjsip_parse_ctx *ctx ) 
    16751675{ 
    1676     pjsip_max_forwards_hdr *hdr; 
    1677     hdr = pjsip_max_forwards_hdr_create(ctx->pool); 
     1676    pjsip_max_fwd_hdr *hdr; 
     1677    hdr = pjsip_max_fwd_hdr_create(ctx->pool, 0); 
    16781678    parse_generic_int_hdr(hdr, ctx->scanner); 
    16791679 
     
    16881688{ 
    16891689    pjsip_min_expires_hdr *hdr; 
    1690     hdr = pjsip_min_expires_hdr_create(ctx->pool); 
     1690    hdr = pjsip_min_expires_hdr_create(ctx->pool, 0); 
    16911691    parse_generic_int_hdr(hdr, ctx->scanner); 
    16921692    return (pjsip_hdr*)hdr; 
     
    18211821    pjsip_generic_string_hdr *hdr; 
    18221822 
    1823     hdr = pjsip_generic_string_hdr_create(ctx->pool, NULL); 
     1823    hdr = pjsip_generic_string_hdr_create(ctx->pool, NULL, NULL); 
    18241824    parse_generic_string_hdr(hdr, ctx->scanner); 
    18251825    return (pjsip_hdr*)hdr; 
  • pjproject/trunk/pjsip/src/pjsip/sip_tel_uri.c

    r82 r127  
    6565static const pj_str_t *tel_uri_get_scheme( const pjsip_tel_uri* ); 
    6666static void *tel_uri_get_uri( pjsip_tel_uri* ); 
    67 static int tel_uri_print( pjsip_uri_context_e context, 
    68                           const pjsip_tel_uri *url,  
    69                           char *buf, pj_size_t size); 
     67static pj_ssize_t tel_uri_print( pjsip_uri_context_e context, 
     68                                const pjsip_tel_uri *url,  
     69                                char *buf, pj_size_t size); 
    7070static int tel_uri_cmp( pjsip_uri_context_e context, 
    7171                        const pjsip_tel_uri *url1, const pjsip_tel_uri *url2); 
     
    165165 
    166166/* Print tel: URI */ 
    167 static int tel_uri_print( pjsip_uri_context_e context, 
    168                           const pjsip_tel_uri *uri,  
    169                           char *buf, pj_size_t size) 
     167static pj_ssize_t tel_uri_print( pjsip_uri_context_e context, 
     168                                const pjsip_tel_uri *uri,  
     169                                char *buf, pj_size_t size) 
    170170{ 
    171171    int printed; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r123 r127  
    6262        PJSIP_MOD_PRIORITY_TSX_LAYER,   /* Priority.                */ 
    6363        NULL,                           /* User_data.               */ 
    64         0,                              /* Methods count.           */ 
    65         { NULL },                       /* Array of methods.        */ 
    6664        mod_tsx_layer_load,             /* load().                  */ 
    6765        mod_tsx_layer_start,            /* start()                  */ 
     
    508506 
    509507    /* Check if no transaction with the same key exists. */ 
    510     if (pj_hash_get( mod_tsx_layer.htable, &tsx->transaction_key.ptr, 
    511                      tsx->transaction_key.slen) != NULL) 
    512     { 
    513         pj_mutex_unlock(mod_tsx_layer.mutex); 
    514         return PJ_EEXISTS; 
    515     } 
     508    PJ_ASSERT_ON_FAIL(pj_hash_get( mod_tsx_layer.htable,  
     509                                   &tsx->transaction_key.ptr, 
     510                                   tsx->transaction_key.slen,  
     511                                   &tsx->hashed_key) == NULL, 
     512                        { 
     513                            pj_mutex_unlock(mod_tsx_layer.mutex); 
     514                            return PJ_EEXISTS; 
     515                        } 
     516                      ); 
    516517 
    517518    /* Register the transaction to the hash table. */ 
    518519    pj_hash_set( tsx->pool, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    519                  tsx->transaction_key.slen, tsx); 
     520                 tsx->transaction_key.slen, tsx->hashed_key, tsx); 
    520521 
    521522    /* Unlock mutex. */ 
     
    539540    /* Register the transaction to the hash table. */ 
    540541    pj_hash_set( NULL, mod_tsx_layer.htable, tsx->transaction_key.ptr, 
    541                  tsx->transaction_key.slen, NULL); 
     542                 tsx->transaction_key.slen, tsx->hashed_key, NULL); 
    542543 
    543544    /* Unlock mutex. */ 
     
    555556 
    556557    pj_mutex_lock(mod_tsx_layer.mutex); 
    557     tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen ); 
     558    tsx = pj_hash_get( mod_tsx_layer.htable, key->ptr, key->slen, NULL ); 
    558559    pj_mutex_unlock(mod_tsx_layer.mutex); 
    559560 
     
    649650    pj_mutex_lock( mod_tsx_layer.mutex ); 
    650651 
    651     tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen ); 
     652    tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, NULL ); 
    652653 
    653654    if (tsx == NULL || tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     
    690691    pj_mutex_lock( mod_tsx_layer.mutex ); 
    691692 
    692     tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen ); 
     693    tsx = pj_hash_get( mod_tsx_layer.htable, key.ptr, key.slen, NULL ); 
    693694 
    694695    if (tsx == NULL || tsx->state == PJSIP_TSX_STATE_TERMINATED) { 
     
    10361037                         &via->branch_param); 
    10371038 
     1039    /* Calculate hashed key value. */ 
     1040    tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 
     1041                                   tsx->transaction_key.slen); 
     1042 
    10381043    PJ_LOG(6, (tsx->obj_name, "tsx_key=%.*s", tsx->transaction_key.slen, 
    10391044               tsx->transaction_key.ptr)); 
     
    11411146    } 
    11421147 
     1148    /* Calculate hashed key value. */ 
     1149    tsx->hashed_key = pj_hash_calc(0, tsx->transaction_key.ptr, 
     1150                                   tsx->transaction_key.slen); 
     1151 
    11431152    /* Duplicate branch parameter for transaction. */ 
    11441153    branch = &rdata->msg_info.via->branch_param; 
     
    11791188        return status; 
    11801189    } 
     1190 
     1191    /* Put this transaction in rdata's mod_data. */ 
     1192    rdata->endpt_info.mod_data[mod_tsx_layer.mod.id] = tsx; 
    11811193 
    11821194    /* Unlock transaction and return. */ 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport.c

    r123 r127  
    4444static pjsip_module mod_msg_print =  
    4545{ 
    46     NULL, NULL,                         /* prev and next        */ 
    47     { "mod-msg-print", 13},             /* Name.                */ 
    48     -1,                                 /* Id                   */ 
    49     PJSIP_MOD_PRIORITY_TRANSPORT_LAYER, /* Priority             */ 
    50     NULL,                               /* User data.           */ 
    51     0,                                  /* Number of methods supported (=0). */ 
    52     { 0 },                              /* Array of methods (none) */ 
    53     NULL,                               /* load()               */ 
    54     NULL,                               /* start()              */ 
    55     NULL,                               /* stop()               */ 
    56     NULL,                               /* unload()             */ 
    57     NULL,                               /* on_rx_request()      */ 
    58     NULL,                               /* on_rx_response()     */ 
    59     &mod_on_tx_msg,                     /* on_tx_request()      */ 
    60     &mod_on_tx_msg,                     /* on_tx_response()     */ 
    61     NULL,                               /* on_tsx_state()       */ 
     46    NULL, NULL,                         /* prev and next                    */ 
     47    { "mod-msg-print", 13},             /* Name.                            */ 
     48    -1,                                 /* Id                               */ 
     49    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER, /* Priority                         */ 
     50    NULL,                               /* User data.                       */ 
     51    NULL,                               /* load()                           */ 
     52    NULL,                               /* start()                          */ 
     53    NULL,                               /* stop()                           */ 
     54    NULL,                               /* unload()                         */ 
     55    NULL,                               /* on_rx_request()                  */ 
     56    NULL,                               /* on_rx_response()                 */ 
     57    &mod_on_tx_msg,                     /* on_tx_request()                  */ 
     58    &mod_on_tx_msg,                     /* on_tx_response()                 */ 
     59    NULL,                               /* on_tsx_state()                   */ 
    6260}; 
    6361 
     
    349347 
    350348    if (tdata==NULL || tdata->msg==NULL) 
    351         return "INVALID MSG"; 
     349        return "NULL"; 
    352350 
    353351    if (tdata->info) 
     
    590588    key_len = sizeof(tp->key.type) + tp->addr_len; 
    591589    pj_lock_acquire(mgr->lock); 
    592     pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, tp); 
     590    pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, 0, tp); 
    593591    pj_lock_release(mgr->lock); 
    594592 
     
    618616     */ 
    619617    key_len = sizeof(tp->key.type) + tp->addr_len; 
    620     pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, NULL); 
     618    pj_hash_set(tp->pool, mgr->table, &tp->key, key_len, 0, NULL); 
    621619 
    622620    pj_lock_release(mgr->lock); 
     
    879877 
    880878        /* Perform basic header checking. */ 
    881         if (rdata->msg_info.cid->id.ptr == NULL ||  
     879        if (rdata->msg_info.cid == NULL || 
     880            rdata->msg_info.cid->id.slen == 0 ||  
    882881            rdata->msg_info.from == NULL ||  
    883882            rdata->msg_info.to == NULL ||  
     
    962961    pj_memcpy(&key.addr, remote, addr_len); 
    963962 
    964     transport = pj_hash_get(mgr->table, &key, key_len); 
     963    transport = pj_hash_get(mgr->table, &key, key_len, NULL); 
    965964    if (transport == NULL) { 
    966965        unsigned flag = pjsip_transport_get_flag_from_type(type); 
     
    975974            pj_memset(addr, 0, sizeof(pj_sockaddr_in)); 
    976975            key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 
    977             transport = pj_hash_get(mgr->table, &key, key_len); 
     976            transport = pj_hash_get(mgr->table, &key, key_len, NULL); 
    978977        } 
    979978        /* For datagram INET transports, try lookup with zero address. 
     
    988987 
    989988            key_len = sizeof(key.type) + sizeof(pj_sockaddr_in); 
    990             transport = pj_hash_get(mgr->table, &key, key_len); 
     989            transport = pj_hash_get(mgr->table, &key, key_len, NULL); 
    991990        } 
    992991    } 
  • pjproject/trunk/pjsip/src/pjsip/sip_uri.c

    r119 r127  
    141141static pjsip_name_addr* pjsip_name_addr_clone( pj_pool_t *pool,  
    142142                                               const pjsip_name_addr *rhs); 
    143 static int pjsip_name_addr_print( pjsip_uri_context_e context, 
    144                                   const pjsip_name_addr *name,  
    145                                   char *buf, pj_size_t size); 
     143static pj_ssize_t pjsip_name_addr_print(pjsip_uri_context_e context, 
     144                                        const pjsip_name_addr *name,  
     145                                        char *buf, pj_size_t size); 
    146146static int pjsip_name_addr_compare(  pjsip_uri_context_e context, 
    147147                                     const pjsip_name_addr *naddr1, 
    148148                                     const pjsip_name_addr *naddr2); 
    149 static int pjsip_url_print(  pjsip_uri_context_e context, 
    150                              const pjsip_sip_uri *url,  
    151                              char *buf, pj_size_t size); 
     149static pj_ssize_t pjsip_url_print(  pjsip_uri_context_e context, 
     150                                    const pjsip_sip_uri *url,  
     151                                    char *buf, pj_size_t size); 
    152152static int pjsip_url_compare( pjsip_uri_context_e context, 
    153153                              const pjsip_sip_uri *url1,  
     
    205205} 
    206206 
    207 PJ_DEF(void) pjsip_url_init(pjsip_sip_uri *url, int secure) 
     207PJ_DEF(void) pjsip_sip_uri_init(pjsip_sip_uri *url, int secure) 
    208208{ 
    209209    pj_memset(url, 0, sizeof(*url)); 
     
    214214} 
    215215 
    216 PJ_DEF(pjsip_sip_uri*) pjsip_url_create( pj_pool_t *pool, int secure ) 
     216PJ_DEF(pjsip_sip_uri*) pjsip_sip_uri_create( pj_pool_t *pool, int secure ) 
    217217{ 
    218218    pjsip_sip_uri *url = pj_pool_alloc(pool, sizeof(pjsip_sip_uri)); 
    219     pjsip_url_init(url, secure); 
     219    pjsip_sip_uri_init(url, secure); 
    220220    return url; 
    221221} 
    222222 
    223 static int pjsip_url_print(  pjsip_uri_context_e context, 
    224                              const pjsip_sip_uri *url,  
    225                              char *buf, pj_size_t size) 
     223static pj_ssize_t pjsip_url_print(  pjsip_uri_context_e context, 
     224                                    const pjsip_sip_uri *url,  
     225                                    char *buf, pj_size_t size) 
    226226{ 
    227227    int printed; 
     
    466466 
    467467 
    468 PJ_DEF(void) pjsip_url_assign(pj_pool_t *pool, pjsip_sip_uri *url,  
    469                               const pjsip_sip_uri *rhs) 
     468PJ_DEF(void) pjsip_sip_uri_assign(pj_pool_t *pool, pjsip_sip_uri *url,  
     469                                  const pjsip_sip_uri *rhs) 
    470470{ 
    471471    pj_strdup( pool, &url->user, &rhs->user); 
     
    489489        return NULL; 
    490490 
    491     pjsip_url_init(url, IS_SIPS(rhs)); 
    492     pjsip_url_assign(pool, url, rhs); 
     491    pjsip_sip_uri_init(url, IS_SIPS(rhs)); 
     492    pjsip_sip_uri_assign(pool, url, rhs); 
    493493    return url; 
    494494} 
     
    514514} 
    515515 
    516 static int pjsip_name_addr_print( pjsip_uri_context_e context, 
    517                                   const pjsip_name_addr *name,  
    518                                   char *buf, pj_size_t size) 
     516static pj_ssize_t pjsip_name_addr_print(pjsip_uri_context_e context, 
     517                                        const pjsip_name_addr *name,  
     518                                        char *buf, pj_size_t size) 
    519519{ 
    520520    int printed; 
  • pjproject/trunk/pjsip/src/pjsip/sip_util.c

    r123 r127  
    129129            pjsip_generic_string_hdr *hdr; 
    130130 
    131             hdr = pjsip_generic_string_hdr_create_with_text(tdata->pool,  
    132                                                             &hparam->name, 
    133                                                             &hparam->value); 
     131            hdr = pjsip_generic_string_hdr_create(tdata->pool,  
     132                                                  &hparam->name, 
     133                                                  &hparam->value); 
    134134            pjsip_msg_add_hdr(msg, (pjsip_hdr*)hdr); 
    135135            hparam = hparam->next; 
     
    303303        target = pjsip_uri_clone(tdata->pool, param_target); 
    304304        from = pjsip_hdr_clone(tdata->pool, param_from); 
    305         pjsip_fromto_set_from(from); 
     305        pjsip_fromto_hdr_set_from(from); 
    306306        to = pjsip_hdr_clone(tdata->pool, param_to); 
    307         pjsip_fromto_set_to(to); 
     307        pjsip_fromto_hdr_set_to(to); 
    308308        if (param_contact) 
    309309            contact = pjsip_hdr_clone(tdata->pool, param_contact); 
  • pjproject/trunk/pjsip/src/test-pjsip/msg_logger.c

    r109 r127  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjsip_core.h> 
     20#include <pjsip.h> 
    2121#include <pjlib.h> 
    2222 
     
    6565    PJSIP_MOD_PRIORITY_TRANSPORT_LAYER-1,/* Priority            */ 
    6666    NULL,                               /* User data.           */ 
    67     0,                                  /* Number of methods supported (=0). */ 
    68     { 0 },                              /* Array of methods (none) */ 
    6967    NULL,                               /* load()               */ 
    7068    NULL,                               /* start()              */ 
  • pjproject/trunk/pjsip/src/test-pjsip/msg_test.c

    r119 r127  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjsip_core.h> 
     20#include <pjsip.h> 
    2121#include <pjlib.h> 
    2222 
     
    349349    /* "INVITE sip:user@foo SIP/2.0\n" */ 
    350350    pjsip_method_set(&msg->line.req.method, PJSIP_INVITE_METHOD); 
    351     url = pjsip_url_create(pool, 0); 
     351    url = pjsip_sip_uri_create(pool, 0); 
    352352    msg->line.req.uri = (pjsip_uri*)url; 
    353353    pj_strdup2(pool, &url->user, "user"); 
     
    361361    fromto->uri = (pjsip_uri*)name_addr; 
    362362    pj_strdup2(pool, &name_addr->display, "Hi I'm Joe"); 
    363     url = pjsip_url_create(pool, 0); 
     363    url = pjsip_sip_uri_create(pool, 0); 
    364364    name_addr->uri = (pjsip_uri*)url; 
    365365    pj_strdup2(pool, &url->user, "joe.user"); 
     
    372372    fromto->uri = (pjsip_uri*)name_addr; 
    373373    pj_strdup2(pool, &name_addr->display, "Fellow User"); 
    374     url = pjsip_url_create(pool, 0); 
     374    url = pjsip_sip_uri_create(pool, 0); 
    375375    name_addr->uri = (pjsip_uri*)url; 
    376376    pj_strdup2(pool, &url->user, "user"); 
     
    400400    name_addr = pjsip_name_addr_create(pool); 
    401401    contact->uri = (pjsip_uri*)name_addr; 
    402     url = pjsip_url_create(pool, 0); 
     402    url = pjsip_sip_uri_create(pool, 0); 
    403403    name_addr->uri = (pjsip_uri*)url; 
    404404    pj_strdup2(pool, &url->user, "joe"); 
     
    411411    name_addr = pjsip_name_addr_create(pool); 
    412412    contact->uri = (pjsip_uri*)name_addr; 
    413     url = pjsip_url_create(pool, 0); 
     413    url = pjsip_sip_uri_create(pool, 0); 
    414414    name_addr->uri = (pjsip_uri*)url; 
    415415    pj_strdup2(pool, &url->user, "user"); 
     
    421421    name_addr = pjsip_name_addr_create(pool); 
    422422    contact->uri = (pjsip_uri*)name_addr; 
    423     url = pjsip_url_create(pool, 0); 
     423    url = pjsip_sip_uri_create(pool, 0); 
    424424    name_addr->uri = (pjsip_uri*)url; 
    425425    pj_strdup2(pool, &url->user, "user2"); 
     
    436436    routing = pjsip_route_hdr_create(pool); 
    437437    pjsip_msg_add_hdr(msg, (pjsip_hdr*)routing); 
    438     url = pjsip_url_create(pool, 0); 
     438    url = pjsip_sip_uri_create(pool, 0); 
    439439    routing->name_addr.uri = (pjsip_uri*)url; 
    440440    pj_strdup2(pool, &url->host, "bigbox3.site3.atlanta.com"); 
     
    444444    routing = pjsip_route_hdr_create(pool); 
    445445    pjsip_msg_add_hdr(msg, (pjsip_hdr*)routing); 
    446     url = pjsip_url_create(pool, 0); 
     446    url = pjsip_sip_uri_create(pool, 0); 
    447447    routing->name_addr.uri = (pjsip_uri*)url; 
    448448    pj_strdup2(pool, &url->host, "server10.biloxi.com"); 
     
    452452    routing = pjsip_rr_hdr_create(pool); 
    453453    pjsip_msg_add_hdr(msg, (pjsip_hdr*)routing); 
    454     url = pjsip_url_create(pool, 0); 
     454    url = pjsip_sip_uri_create(pool, 0); 
    455455    routing->name_addr.uri = (pjsip_uri*)url; 
    456456    pj_strdup2(pool, &url->host, "server10.biloxi.com"); 
     
    460460    routing = pjsip_rr_hdr_create(pool); 
    461461    pjsip_msg_add_hdr(msg, (pjsip_hdr*)routing); 
    462     url = pjsip_url_create(pool, 0); 
     462    url = pjsip_sip_uri_create(pool, 0); 
    463463    routing->name_addr.uri = (pjsip_uri*)url; 
    464464    pj_strdup2(pool, &url->host, "bigbox3.site3.atlanta.com"); 
     
    498498    str.ptr = "Organization"; 
    499499    str.slen = 12; 
    500     generic = pjsip_generic_string_hdr_create(pool, &str); 
     500    generic = pjsip_generic_string_hdr_create(pool, &str, NULL); 
    501501    pjsip_msg_add_hdr(msg, (pjsip_hdr*)generic); 
    502502    generic->hvalue.ptr = NULL; 
     
    506506    str.ptr = "Max-Forwards"; 
    507507    str.slen = 12; 
    508     generic = pjsip_generic_string_hdr_create(pool, &str); 
     508    generic = pjsip_generic_string_hdr_create(pool, &str, NULL); 
    509509    pjsip_msg_add_hdr(msg, (pjsip_hdr*)generic); 
    510510    str.ptr = "70"; 
     
    515515    str.ptr = "X-Header"; 
    516516    str.slen = 8; 
    517     generic = pjsip_generic_string_hdr_create(pool, &str); 
     517    generic = pjsip_generic_string_hdr_create(pool, &str, NULL); 
    518518    pjsip_msg_add_hdr(msg, (pjsip_hdr*)generic); 
    519519    str.ptr = NULL; 
     
    524524    str.ptr = "P-Associated-URI"; 
    525525    str.slen = 16; 
    526     generic = pjsip_generic_string_hdr_create(pool, &str); 
     526    generic = pjsip_generic_string_hdr_create(pool, &str, NULL); 
    527527    pjsip_msg_add_hdr(msg, (pjsip_hdr*)generic); 
    528528    str.ptr = NULL; 
     
    539539    pjsip_name_addr *name_addr; 
    540540    pjsip_sip_uri *url; 
    541     pjsip_max_forwards_hdr *max_fwd; 
     541    pjsip_max_fwd_hdr *max_fwd; 
    542542    pjsip_to_hdr *to; 
    543543    pjsip_from_hdr *from; 
     
    582582    route = pjsip_route_hdr_create(pool); 
    583583    pjsip_msg_add_hdr(msg, (pjsip_hdr*)route); 
    584     url = pjsip_url_create(pool, PJ_FALSE); 
     584    url = pjsip_sip_uri_create(pool, PJ_FALSE); 
    585585    route->name_addr.uri = (pjsip_uri*)url; 
    586586    url->host = pj_str("proxy.sipprovider.com"); 
     
    589589    route = pjsip_route_hdr_create(pool); 
    590590    pjsip_msg_add_hdr(msg, (pjsip_hdr*)route); 
    591     url = pjsip_url_create(pool, PJ_FALSE); 
     591    url = pjsip_sip_uri_create(pool, PJ_FALSE); 
    592592    route->name_addr.uri = (pjsip_uri*)url; 
    593593    url->host = pj_str("proxy.supersip.com"); 
     
    595595 
    596596    //"Max-Forwards: 70\r\n" 
    597     max_fwd = pjsip_max_forwards_hdr_create(pool); 
     597    max_fwd = pjsip_max_fwd_hdr_create(pool, 70); 
    598598    pjsip_msg_add_hdr(msg, (pjsip_hdr*)max_fwd); 
    599     max_fwd->ivalue = 70; 
    600599 
    601600    //"To: Bob <sip:bob@biloxi.com>;tag=a6c85cf\r\n" 
     
    605604    name_addr->display = pj_str("Bob"); 
    606605    to->uri = (pjsip_uri*)name_addr; 
    607     url = pjsip_url_create(pool, PJ_FALSE); 
     606    url = pjsip_sip_uri_create(pool, PJ_FALSE); 
    608607    name_addr->uri = (pjsip_uri*)url; 
    609608    url->user = pj_str("bob"); 
     
    617616    name_addr->display = pj_str("Alice"); 
    618617    from->uri = (pjsip_uri*)name_addr; 
    619     url = pjsip_url_create(pool, PJ_FALSE); 
     618    url = pjsip_sip_uri_create(pool, PJ_FALSE); 
    620619    name_addr->uri = (pjsip_uri*)url; 
    621620    url->user = pj_str("alice"); 
     
    639638    name_addr = pjsip_name_addr_create(pool); 
    640639    contact->uri = (pjsip_uri*)name_addr; 
    641     url = pjsip_url_create(pool, PJ_TRUE); 
     640    url = pjsip_sip_uri_create(pool, PJ_TRUE); 
    642641    name_addr->uri = (pjsip_uri*)url; 
    643642    url->user = pj_str("bob"); 
  • pjproject/trunk/pjsip/src/test-pjsip/test.c

    r117 r127  
    2121#include "test.h" 
    2222#include <pjlib.h> 
    23 #include <pjsip_core.h> 
     23#include <pjsip.h> 
    2424 
    2525#define THIS_FILE   "test.c" 
  • pjproject/trunk/pjsip/src/test-pjsip/transport_loop_test.c

    r109 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
  • pjproject/trunk/pjsip/src/test-pjsip/transport_test.c

    r123 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
     
    102102    PJSIP_MOD_PRIORITY_TSX_LAYER-1,     /* Priority             */ 
    103103    NULL,                               /* User data.           */ 
    104     0,                                  /* Number of methods supported (=0). */ 
    105     { 0 },                              /* Array of methods (none) */ 
    106104    NULL,                               /* load()               */ 
    107105    NULL,                               /* start()              */ 
     
    306304    PJSIP_MOD_PRIORITY_TSX_LAYER-1,     /* Priority             */ 
    307305    NULL,                               /* User data.           */ 
    308     0,                                  /* Number of methods supported (=0). */ 
    309     { 0 },                              /* Array of methods (none) */ 
    310306    NULL,                               /* load()               */ 
    311307    NULL,                               /* start()              */ 
  • pjproject/trunk/pjsip/src/test-pjsip/transport_udp_test.c

    r109 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
  • pjproject/trunk/pjsip/src/test-pjsip/tsx_basic_test.c

    r109 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
  • pjproject/trunk/pjsip/src/test-pjsip/tsx_uac_test.c

    r123 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
     
    104104    PJSIP_MOD_PRIORITY_APPLICATION-1,   /* Priority             */ 
    105105    NULL,                               /* User data.           */ 
    106     0,                                  /* Number of methods supported (=0). */ 
    107     { 0 },                              /* Array of methods (none) */ 
    108106    NULL,                               /* load()               */ 
    109107    NULL,                               /* start()              */ 
     
    125123    PJSIP_MOD_PRIORITY_APPLICATION-1,   /* Priority             */ 
    126124    NULL,                               /* User data.           */ 
    127     0,                                  /* Number of methods supported (=0). */ 
    128     { 0 },                              /* Array of methods (none) */ 
    129125    NULL,                               /* load()               */ 
    130126    NULL,                               /* start()              */ 
  • pjproject/trunk/pjsip/src/test-pjsip/tsx_uas_test.c

    r123 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
     
    143143    PJSIP_MOD_PRIORITY_APPLICATION-1,   /* Priority             */ 
    144144    NULL,                               /* User data.           */ 
    145     0,                                  /* Number of methods supported (=0). */ 
    146     { 0 },                              /* Array of methods (none) */ 
    147145    NULL,                               /* load()               */ 
    148146    NULL,                               /* start()              */ 
     
    164162    PJSIP_MOD_PRIORITY_APPLICATION-1,   /* Priority             */ 
    165163    NULL,                               /* User data.           */ 
    166     0,                                  /* Number of methods supported (=0). */ 
    167     { 0 },                              /* Array of methods (none) */ 
    168164    NULL,                               /* load()               */ 
    169165    NULL,                               /* start()              */ 
  • pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c

    r123 r127  
    1919 
    2020#include "test.h" 
    21 #include <pjsip_core.h> 
     21#include <pjsip.h> 
    2222#include <pjlib.h> 
    2323 
  • pjproject/trunk/pjsip/src/test-pjsip/uri_test.c

    r119 r127  
    1818 */ 
    1919#include "test.h" 
    20 #include <pjsip_core.h> 
     20#include <pjsip.h> 
    2121#include <pjlib.h> 
    2222 
     
    318318{ 
    319319    /* "sip:localhost" */ 
    320     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     320    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    321321 
    322322    pj_strdup2(pool, &url->host, "localhost"); 
     
    327327{ 
    328328    /* "sip:user@localhost" */ 
    329     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     329    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    330330 
    331331    pj_strdup2( pool, &url->user, "user"); 
     
    338338{ 
    339339    /* "sip:user:password@localhost:5060" */ 
    340     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     340    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    341341 
    342342    pj_strdup2( pool, &url->user, "user"); 
     
    351351{ 
    352352    /* Like: "sip:localhost:5060", but without the port. */ 
    353     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     353    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    354354 
    355355    pj_strdup2(pool, &url->host, "localhost"); 
     
    360360{ 
    361361    /* "sip:localhost;transport=tcp;user=ip;ttl=255;lr;maddr=127.0.0.1;method=ACK" */ 
    362     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     362    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    363363 
    364364    pj_strdup2(pool, &url->host, "localhost"); 
     
    387387       "?Subject=Hello%20There&Server=SIP%20Server"  
    388388     */ 
    389     pjsip_sip_uri *url = pjsip_url_create(pool, 0); 
     389    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0); 
    390390 
    391391    pj_strdup2(pool, &url->host, "localhost"); 
     
    406406{ 
    407407    /* "sips:localhost" */ 
    408     pjsip_sip_uri *url = pjsip_url_create(pool, 1); 
     408    pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 1); 
    409409 
    410410    pj_strdup2(pool, &url->host, "localhost"); 
     
    418418    pjsip_sip_uri *url; 
    419419 
    420     url = pjsip_url_create(pool, 0); 
     420    url = pjsip_sip_uri_create(pool, 0); 
    421421    name_addr->uri = (pjsip_uri*) url; 
    422422 
     
    431431    pjsip_sip_uri *url; 
    432432 
    433     url = pjsip_url_create(pool, 1); 
     433    url = pjsip_sip_uri_create(pool, 1); 
    434434    name_addr->uri = (pjsip_uri*) url; 
    435435 
     
    445445    pjsip_sip_uri *url; 
    446446 
    447     url = pjsip_url_create(pool, 0); 
     447    url = pjsip_sip_uri_create(pool, 0); 
    448448    name_addr->uri = (pjsip_uri*) url; 
    449449 
     
    461461    pjsip_sip_uri *url; 
    462462 
    463     url = pjsip_url_create(pool, 0); 
     463    url = pjsip_sip_uri_create(pool, 0); 
    464464    name_addr->uri = (pjsip_uri*) url; 
    465465 
     
    475475    pjsip_sip_uri *url; 
    476476 
    477     url = pjsip_url_create(pool, 0); 
     477    url = pjsip_sip_uri_create(pool, 0); 
    478478    name_addr->uri = (pjsip_uri*) url; 
    479479 
     
    489489    pjsip_sip_uri *url; 
    490490 
    491     url = pjsip_url_create(pool, 0); 
     491    url = pjsip_sip_uri_create(pool, 0); 
    492492    name_addr->uri = (pjsip_uri*) url; 
    493493 
     
    501501    /* "sip:localhost;pvalue=\"hello world\"" */ 
    502502    pjsip_sip_uri *url; 
    503     url = pjsip_url_create(pool, 0); 
     503    url = pjsip_sip_uri_create(pool, 0); 
    504504    pj_strdup2(pool, &url->host, "localhost"); 
    505505    //pj_strdup2(pool, &url->other_param, ";pvalue=\"hello world\""); 
     
    514514    pjsip_sip_uri *url; 
    515515 
    516     url = pjsip_url_create(pool, 0); 
     516    url = pjsip_sip_uri_create(pool, 0); 
    517517    name_addr->uri = (pjsip_uri*) url; 
    518518 
     
    529529    /* "sip:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.com" */ 
    530530    pjsip_sip_uri *url; 
    531     url = pjsip_url_create(pool, 0); 
     531    url = pjsip_sip_uri_create(pool, 0); 
    532532    pj_strdup2(pool, &url->host, ALPHANUM "-_.com"); 
    533533    return (pjsip_uri*)url; 
     
    538538    /* "sip:" USER_CHAR ":" PASS_CHAR "@host" */ 
    539539    pjsip_sip_uri *url; 
    540     url = pjsip_url_create(pool, 0); 
     540    url = pjsip_sip_uri_create(pool, 0); 
    541541    pj_strdup2(pool, &url->user, USER_CHAR); 
    542542    pj_strdup2(pool, &url->passwd, PASS_CHAR); 
     
    549549    /* "sip:host;user=ip;" PARAM_CHAR "%21=" PARAM_CHAR "%21;lr;other=1;transport=sctp;other2" */ 
    550550    pjsip_sip_uri *url; 
    551     url = pjsip_url_create(pool, 0); 
     551    url = pjsip_sip_uri_create(pool, 0); 
    552552    pj_strdup2(pool, &url->host, "host"); 
    553553    pj_strdup2(pool, &url->user_param, "ip"); 
Note: See TracChangeset for help on using the changeset viewer.