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

Finished implementation of UA layer (to be tested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 */ 
Note: See TracChangeset for help on using the changeset viewer.