Changeset 1417 for pjproject/trunk/pjsip/src/pjsip/sip_msg.c
- Timestamp:
- Aug 16, 2007 10:11:44 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r1389 r1417 25 25 #include <pj/assert.h> 26 26 27 const pjsip_method 28 pjsip_invite_method = { PJSIP_INVITE_METHOD, { "INVITE",6 } }, 29 pjsip_cancel_method = { PJSIP_CANCEL_METHOD, { "CANCEL",6 } }, 30 pjsip_ack_method = { PJSIP_ACK_METHOD, { "ACK",3} }, 31 pjsip_bye_method = { PJSIP_BYE_METHOD, { "BYE",3} }, 32 pjsip_register_method = { PJSIP_REGISTER_METHOD, { "REGISTER",8} }, 33 pjsip_options_method = { PJSIP_OPTIONS_METHOD, { "OPTIONS",7} }; 27 PJ_DEF_DATA(const pjsip_method) pjsip_invite_method = 28 { PJSIP_INVITE_METHOD, { "INVITE",6 }}; 29 30 PJ_DEF_DATA(const pjsip_method) pjsip_cancel_method = 31 { PJSIP_CANCEL_METHOD, { "CANCEL",6 }}; 32 33 PJ_DEF_DATA(const pjsip_method) pjsip_ack_method = 34 { PJSIP_ACK_METHOD, { "ACK",3}}; 35 36 PJ_DEF_DATA(const pjsip_method) pjsip_bye_method = 37 { PJSIP_BYE_METHOD, { "BYE",3}}; 38 39 PJ_DEF_DATA(const pjsip_method) pjsip_register_method = 40 { PJSIP_REGISTER_METHOD, { "REGISTER", 8}}; 41 42 PJ_DEF_DATA(const pjsip_method) pjsip_options_method = 43 { PJSIP_OPTIONS_METHOD, { "OPTIONS",7}}; 44 45 46 /** INVITE method constant. */ 47 PJ_DEF(const pjsip_method*) pjsip_get_invite_method(void) 48 { 49 return &pjsip_invite_method; 50 } 51 52 /** CANCEL method constant. */ 53 PJ_DEF(const pjsip_method*) pjsip_get_cancel_method(void) 54 { 55 return &pjsip_cancel_method; 56 } 57 58 /** ACK method constant. */ 59 PJ_DEF(const pjsip_method*) pjsip_get_ack_method(void) 60 { 61 return &pjsip_ack_method; 62 } 63 64 /** BYE method constant. */ 65 PJ_DEF(const pjsip_method*) pjsip_get_bye_method(void) 66 { 67 return &pjsip_bye_method; 68 } 69 70 /** REGISTER method constant.*/ 71 PJ_DEF(const pjsip_method*) pjsip_get_register_method(void) 72 { 73 return &pjsip_register_method; 74 } 75 76 /** OPTIONS method constant. */ 77 PJ_DEF(const pjsip_method*) pjsip_get_options_method(void) 78 { 79 return &pjsip_options_method; 80 } 81 34 82 35 83 static const pj_str_t *method_names[] = … … 566 614 567 615 568 PJ_DEF(pjsip_generic_string_hdr*) 569 pjsip_generic_string_hdr_init( pj_pool_t *pool, 570 void *mem, 571 const pj_str_t *hnames, 572 const pj_str_t *hvalue) 616 PJ_DEF(pjsip_generic_string_hdr*) pjsip_generic_string_hdr_init(pj_pool_t *pool, 617 void *mem, 618 const pj_str_t *hnames, 619 const pj_str_t *hvalue) 573 620 { 574 621 pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr*) mem; … … 591 638 } 592 639 593 PJ_DEF(pjsip_generic_string_hdr*) 594 pjsip_generic_string_hdr_create( pj_pool_t *pool, 640 PJ_DEF(pjsip_generic_string_hdr*) pjsip_generic_string_hdr_create(pj_pool_t *pool, 595 641 const pj_str_t *hnames, 596 642 const pj_str_t *hvalue) … … 1056 1102 { 1057 1103 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1104 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1058 1105 1059 1106 if (hdr->star) { … … 1110 1157 1111 1158 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1112 &pjsip_TOKEN_SPEC, &pjsip_TOKEN_SPEC, 1159 &pc->pjsip_TOKEN_SPEC, 1160 &pc->pjsip_TOKEN_SPEC, 1113 1161 ';'); 1114 1162 if (printed < 0) … … 1347 1395 char *endbuf = buf + size; 1348 1396 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1397 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1349 1398 1350 1399 copy_advance(buf, (*hname)); … … 1362 1411 1363 1412 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1364 &p jsip_TOKEN_SPEC,1365 &p jsip_TOKEN_SPEC, ';');1413 &pc->pjsip_TOKEN_SPEC, 1414 &pc->pjsip_TOKEN_SPEC, ';'); 1366 1415 if (printed < 0) 1367 1416 return -1; … … 1525 1574 char *startbuf = buf; 1526 1575 char *endbuf = buf + size; 1576 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1527 1577 /* Route and Record-Route don't compact forms */ 1528 1578 … … 1538 1588 1539 1589 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1540 &p jsip_TOKEN_SPEC,1541 &p jsip_TOKEN_SPEC, ';');1590 &pc->pjsip_TOKEN_SPEC, 1591 &pc->pjsip_TOKEN_SPEC, ';'); 1542 1592 if (printed < 0) 1543 1593 return -1; … … 1705 1755 pj_str_t sip_ver = { "SIP/2.0/", 8 }; 1706 1756 const pj_str_t *hname = pjsip_use_compact_form? &hdr->sname : &hdr->name; 1757 const pjsip_parser_const_t *pc = pjsip_parser_const(); 1707 1758 1708 1759 if ((pj_ssize_t)size < hname->slen + sip_ver.slen + … … 1758 1809 1759 1810 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1760 &p jsip_TOKEN_SPEC,1761 &p jsip_TOKEN_SPEC, ';');1811 &pc->pjsip_TOKEN_SPEC, 1812 &pc->pjsip_TOKEN_SPEC, ';'); 1762 1813 if (printed < 0) 1763 1814 return -1; … … 1814 1865 } 1815 1866 1816 PJ_DEF(pjsip_warning_hdr*) 1817 pjsip_warning_hdr_create_from_status( pj_pool_t *pool, 1818 const pj_str_t *host, 1819 pj_status_t status) 1867 PJ_DEF(pjsip_warning_hdr*) pjsip_warning_hdr_create_from_status(pj_pool_t *pool, 1868 const pj_str_t *host, 1869 pj_status_t status) 1820 1870 { 1821 1871 char errbuf[PJ_ERR_MSG_SIZE];
Note: See TracChangeset
for help on using the changeset viewer.