Changeset 82 for pjproject/trunk
- Timestamp:
- Nov 23, 2005 8:56:30 PM (19 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/build/pjsip_core.dsp
r77 r82 42 42 # PROP Target_Dir "" 43 43 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 44 # ADD CPP /nologo /MD /W4 /Zi /O2 / Oy /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /c44 # ADD CPP /nologo /MD /W4 /Zi /O2 /I "../include" /I "../../pjlib/include" /I "../../pjlib-util/include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D PJ_WIN32=1 /D PJ_M_I386=1 /FR /FD /c 45 45 # SUBTRACT CPP /YX 46 46 # ADD BASE RSC /l 0x409 /d "NDEBUG" … … 120 120 # Begin Source File 121 121 122 SOURCE=..\src\pjsip\sip_tel_uri.c 123 # End Source File 124 # Begin Source File 125 122 126 SOURCE=..\src\pjsip\sip_transaction.c 123 127 # End Source File … … 200 204 # Begin Source File 201 205 206 SOURCE=..\include\pjsip\sip_tel_uri.h 207 # End Source File 208 # Begin Source File 209 202 210 SOURCE=..\include\pjsip\sip_transaction.h 203 211 # End Source File -
pjproject/trunk/pjsip/include/pjsip/print_util.h
r77 r82 56 56 if (len1+str2.slen >= (endbuf-buf)) return -1; \ 57 57 pj_memcpy(buf,str1,len1); \ 58 printed=pj_strncpy2_escape(buf ,&str2,(endbuf-buf-len1),&unres);\58 printed=pj_strncpy2_escape(buf+len1,&str2,(endbuf-buf-len1),&unres);\ 59 59 if (printed < 0) return -1; \ 60 60 buf += (printed+len1); \ -
pjproject/trunk/pjsip/include/pjsip/sip_config.h
r65 r82 75 75 /* Module related constants. */ 76 76 #define PJSIP_MAX_MODULE 8 77 78 /* Maximum header types. */ 79 #define PJSIP_MAX_HEADER_TYPES 64 80 81 /* Maximum URI types. */ 82 #define PJSIP_MAX_URI_TYPES 4 77 83 78 84 /***************************************************************************** -
pjproject/trunk/pjsip/include/pjsip/sip_parser.h
r77 r82 60 60 * Parser syntax error exception value. 61 61 */ 62 #define PJSIP_SYN_ERR_EXCEPTION 1 62 extern int PJSIP_SYN_ERR_EXCEPTION; 63 63 64 64 /** … … 110 110 * also applies here (except the separator part). 111 111 */ 112 typedef void* (pjsip_parse_uri_func)(pj_scanner *scanner, pj_pool_t *pool); 112 typedef void* (pjsip_parse_uri_func)(pj_scanner *scanner, pj_pool_t *pool, 113 pj_bool_t parse_params); 113 114 114 115 /** … … 149 150 * @return zero on success. 150 151 */ 151 PJ_DECL(pj_status_t) pjsip_register_uri_parser( c onst char *scheme,152 PJ_DECL(pj_status_t) pjsip_register_uri_parser( char *scheme, 152 153 pjsip_parse_uri_func *func); 153 154 -
pjproject/trunk/pjsip/include/pjsip/sip_uri.h
r65 r82 28 28 #include <pjsip/sip_config.h> 29 29 #include <pj/list.h> 30 #include <pjlib-util/scanner.h> 30 31 31 32 PJ_BEGIN_DECL … … 103 104 * @param buf Buffer. 104 105 * @param size Size of buffer. 106 * @param pname_unres Specification of allowed characters in pname. 107 * @param pvalue_unres Specification of allowed characters in pvalue. 105 108 * @param sep Separator character (either ';' or ','). 106 109 * … … 109 112 PJ_DECL(pj_ssize_t) pjsip_param_print_on(const pjsip_param *param_list, 110 113 char *buf, pj_size_t size, 114 const pj_cis_t *pname_unres, 115 const pj_cis_t *pvalue_unres, 111 116 int sep); 112 117 -
pjproject/trunk/pjsip/include/pjsip_core.h
r66 r82 29 29 #include <pjsip/sip_parser.h> 30 30 #include <pjsip/sip_resolve.h> 31 #include <pjsip/sip_tel_uri.h> 31 32 #include <pjsip/sip_transaction.h> 32 33 #include <pjsip/sip_transport.h> -
pjproject/trunk/pjsip/src/pjsip/sip_auth_msg.c
r65 r82 19 19 #include <pjsip/sip_auth_msg.h> 20 20 #include <pjsip/sip_auth_parser.h> 21 #include <pjsip/sip_parser.h> 21 22 #include <pj/pool.h> 22 23 #include <pj/list.h> … … 80 81 copy_advance_pair(buf, ", nc=", 5, cred->nc); 81 82 82 printed = pjsip_param_print_on(&cred->other_param, buf, endbuf-buf, ','); 83 printed = pjsip_param_print_on(&cred->other_param, buf, endbuf-buf, 84 &pjsip_PARAM_CHAR_SPEC, 85 &pjsip_PARAM_CHAR_SPEC, ','); 83 86 if (printed < 0) 84 87 return -1; … … 232 235 copy_advance_pair_quote_cond(buf, ",qop=", 5, chal->qop, '"', '"'); 233 236 234 printed = pjsip_param_print_on(&chal->other_param, buf, endbuf-buf, ','); 237 printed = pjsip_param_print_on(&chal->other_param, buf, endbuf-buf, 238 &pjsip_PARAM_CHAR_SPEC, 239 &pjsip_PARAM_CHAR_SPEC, ','); 235 240 if (printed < 0) 236 241 return -1; -
pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
r80 r82 105 105 pj_status_t, pjsip_rx_data*); 106 106 107 /* Defined in sip_parser.c */ 107 108 void init_sip_parser(void); 109 110 /* Defined in sip_tel_uri.c */ 111 pj_status_t pjsip_tel_uri_subsys_init(void); 112 108 113 109 114 /* … … 377 382 /* Init parser. */ 378 383 init_sip_parser(); 384 385 /* Init tel: uri */ 386 pjsip_tel_uri_subsys_init(); 379 387 380 388 /* Get name. */ -
pjproject/trunk/pjsip/src/pjsip/sip_msg.c
r65 r82 18 18 */ 19 19 #include <pjsip/sip_msg.h> 20 #include <pjsip/sip_parser.h> 20 21 #include <pjsip/print_util.h> 21 22 #include <pj/string.h> … … 928 929 } 929 930 930 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf,';'); 931 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 932 &pjsip_PARAM_CHAR_SPEC, 933 &pjsip_PARAM_CHAR_SPEC, ';'); 931 934 if (printed < 0) 932 935 return printed; … … 1121 1124 copy_advance_pair(buf, ";tag=", 5, hdr->tag); 1122 1125 1123 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 1126 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1127 &pjsip_PARAM_CHAR_SPEC, 1128 &pjsip_PARAM_CHAR_SPEC, ';'); 1124 1129 if (printed < 0) 1125 1130 return -1; … … 1244 1249 buf += printed; 1245 1250 1246 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 1251 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1252 &pjsip_PARAM_CHAR_SPEC, 1253 &pjsip_PARAM_CHAR_SPEC, ';'); 1247 1254 if (printed < 0) 1248 1255 return -1; … … 1407 1414 copy_advance_pair(buf, ";branch=", 8, hdr->branch_param); 1408 1415 1409 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, ';'); 1416 printed = pjsip_param_print_on(&hdr->other_param, buf, endbuf-buf, 1417 &pjsip_PARAM_CHAR_SPEC, 1418 &pjsip_PARAM_CHAR_SPEC, ';'); 1410 1419 if (printed < 0) 1411 1420 return -1; -
pjproject/trunk/pjsip/src/pjsip/sip_parser.c
r80 r82 50 50 51 51 #define PJSIP_VERSION "SIP/2.0" 52 #define PJSIP_SYN_ERR_EXCEPTION 153 52 54 53 #define UNREACHED(expr) 55 54 56 //#define IS_NEWLINE(c) ((c)=='\r' || (c)=='\n') 57 #define IS_NEWLINE(c) ((c)=='\r') 55 #define IS_NEWLINE(c) ((c)=='\r' || (c)=='\n') 58 56 #define IS_SPACE(c) ((c)==' ' || (c)=='\t') 59 57 58 /* 59 * Header parser records. 60 */ 60 61 typedef struct handler_rec 61 62 { … … 66 67 } handler_rec; 67 68 68 static handler_rec handler[ 127];69 static handler_rec handler[PJSIP_MAX_HEADER_TYPES]; 69 70 static unsigned handler_count; 70 71 static int parser_is_initialized; 72 73 /* 74 * URI parser records. 75 */ 76 typedef struct uri_parser_rec 77 { 78 pj_str_t scheme; 79 pjsip_parse_uri_func *parse; 80 } uri_parser_rec; 81 82 static uri_parser_rec uri_handler[PJSIP_MAX_URI_TYPES]; 83 static unsigned uri_handler_count; 71 84 72 85 /* 73 86 * Global vars (also extern). 74 87 */ 88 int PJSIP_SYN_ERR_EXCEPTION; 89 75 90 const pj_str_t pjsip_USER_STR = { "user", 4}; 76 91 const pj_str_t pjsip_METHOD_STR = { "method", 6}; … … 247 262 initialized = 1; 248 263 264 /* 265 * Syntax error exception number. 266 */ 267 status = pj_exception_id_alloc("PJSIP: syntax error", 268 &PJSIP_SYN_ERR_EXCEPTION); 269 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 270 271 /* 272 * Init character input spec (cis) 273 */ 274 249 275 pj_cis_buf_init(&cis_buf); 250 276 … … 310 336 pj_cis_invert(&pjsip_DISPLAY_SPEC); 311 337 338 /* 339 * Register URI parsers. 340 */ 341 342 status = pjsip_register_uri_parser("sip", &int_parse_sip_url); 343 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 344 345 status = pjsip_register_uri_parser("sips", &int_parse_sip_url); 346 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 347 348 /* 349 * Register header parsers. 350 */ 351 312 352 status = pjsip_register_hdr_parser( "Accept", NULL, &parse_hdr_accept); 313 353 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); … … 374 414 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 375 415 376 /* Register auth parser. */ 416 /* 417 * Register auth parser. 418 */ 419 377 420 status = pjsip_auth_init_parser(); 378 421 … … 383 426 { 384 427 if (!parser_is_initialized) { 385 /* Prevent race cond. */386 pj_enter_critical_section();387 428 if (!parser_is_initialized) { 388 429 init_parser(); 389 430 parser_is_initialized = 1; 390 431 } 391 pj_leave_critical_section();392 432 } 393 433 } … … 399 439 */ 400 440 PJ_INLINE(int) compare_handler( const handler_rec *r1, 401 402 403 441 const char *name, 442 pj_size_t name_len, 443 pj_uint32_t hash ) 404 444 { 405 445 PJ_UNUSED_ARG(name_len); … … 539 579 } 540 580 581 /* Find URI handler. */ 582 static pjsip_parse_uri_func* find_uri_handler(const pj_str_t *scheme) 583 { 584 unsigned i; 585 for (i=0; i<uri_handler_count; ++i) { 586 if (pj_stricmp_alnum(&uri_handler[i].scheme, scheme)==0) 587 return uri_handler[i].parse; 588 } 589 return NULL; 590 } 591 592 /* Register URI parser. */ 593 PJ_DEF(pj_status_t) pjsip_register_uri_parser( char *scheme, 594 pjsip_parse_uri_func *func) 595 { 596 if (uri_handler_count >= PJ_ARRAY_SIZE(uri_handler)) 597 return PJ_ETOOMANY; 598 599 uri_handler[uri_handler_count].scheme = pj_str((char*)scheme); 600 uri_handler[uri_handler_count].parse = func; 601 ++uri_handler_count; 602 603 return PJ_SUCCESS; 604 } 605 541 606 /* Public function to parse SIP message. */ 542 607 PJ_DEF(pjsip_msg*) pjsip_parse_msg( pj_pool_t *pool, … … 548 613 pjsip_parse_ctx context; 549 614 550 init_sip_parser();551 552 615 pj_scan_init(&scanner, buf, size, PJ_SCAN_AUTOSKIP_WS_HEADER, 553 616 &on_syntax_error); … … 569 632 pj_scanner scanner; 570 633 pjsip_parse_ctx context; 571 572 init_sip_parser();573 634 574 635 pj_scan_init(&scanner, buf, size, PJ_SCAN_AUTOSKIP_WS_HEADER, … … 626 687 PJ_USE_EXCEPTION; 627 688 628 init_sip_parser();629 630 689 pj_scan_init(&scanner, (char*)line, hdr_end-line, 631 690 PJ_SCAN_AUTOSKIP_WS_HEADER, &on_syntax_error); … … 694 753 pjsip_uri *uri = NULL; 695 754 PJ_USE_EXCEPTION; 696 697 init_sip_parser();698 755 699 756 pj_scan_init(&scanner, buf, size, 0, &on_syntax_error); … … 872 929 } 873 930 931 /* Restore flag. Flag may be set in int_parse_sip_url() */ 932 scanner->skip_ws = PJ_SCAN_AUTOSKIP_WS_HEADER; 933 934 /* Continue parse next header, if any. */ 874 935 if (!pj_scan_is_eof(scanner) && !IS_NEWLINE(*scanner->curptr)) { 875 936 goto parse_headers; … … 1019 1080 next_ch = pj_scan_peek( scanner, &pjsip_DISPLAY_SPEC, &scheme); 1020 1081 1021 if (next_ch==':' && 1022 (parser_stricmp(scheme, pjsip_SIP_STR)==0 || 1023 parser_stricmp(scheme, pjsip_SIPS_STR)==0)) 1024 { 1025 uri = (pjsip_uri*) 1026 int_parse_sip_url( scanner, pool, 1027 (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0); 1028 1029 } else if (next_ch==':') { 1030 1031 /* Not supported. */ 1032 PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); 1033 UNREACHED({return NULL; /* Not reached. */}); 1082 if (next_ch==':') { 1083 pjsip_parse_uri_func *func = find_uri_handler(&scheme); 1084 1085 if (func == NULL) { 1086 /* Unsupported URI scheme */ 1087 PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); 1088 } 1089 1090 uri = (*func)( scanner, pool, 1091 (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0); 1092 1034 1093 1035 1094 } else { … … 1063 1122 pj_str_t scheme; 1064 1123 int colon; 1124 pjsip_parse_uri_func *func; 1065 1125 1066 1126 /* Get scheme. */ … … 1070 1130 } 1071 1131 1072 if ((parser_stricmp(scheme, pjsip_SIP_STR)==0 || 1073 parser_stricmp(scheme, pjsip_SIPS_STR)==0)) 1074 { 1075 return (pjsip_uri*)int_parse_sip_url( scanner, pool, parse_params); 1076 1077 } else if (parser_stricmp(scheme, pjsip_TEL_STR)==0) { 1078 PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); 1079 UNREACHED({ return NULL; /* Not reached. */ }) 1132 func = find_uri_handler(&scheme); 1133 if (func) { 1134 return (pjsip_uri*)(*func)(scanner, pool, parse_params); 1080 1135 1081 1136 } else { 1137 /* Unsupported URI scheme */ 1082 1138 PJ_THROW(PJSIP_SYN_ERR_EXCEPTION); 1083 1139 UNREACHED({ return NULL; /* Not reached. */ }) … … 1774 1830 PJ_USE_EXCEPTION; 1775 1831 1776 init_sip_parser();1777 1778 1832 pj_scan_init(&scanner, buf, size, PJ_SCAN_AUTOSKIP_WS_HEADER, 1779 1833 &on_syntax_error); -
pjproject/trunk/pjsip/src/pjsip/sip_uri.c
r77 r82 88 88 PJ_DEF(pj_ssize_t) pjsip_param_print_on( const pjsip_param *param_list, 89 89 char *buf, pj_size_t size, 90 const pj_cis_t *pname_spec, 91 const pj_cis_t *pvalue_spec, 90 92 int sep) 91 93 { … … 104 106 do { 105 107 *buf++ = (char)sep; 106 copy_advance_escape(buf, p->name, pjsip_PARAM_CHAR_SPEC);108 copy_advance_escape(buf, p->name, (*pname_spec)); 107 109 if (p->value.slen) { 108 110 *buf++ = '='; 109 copy_advance_escape(buf, p->value, pjsip_PARAM_CHAR_SPEC);111 copy_advance_escape(buf, p->value, (*pvalue_spec)); 110 112 } 111 113 p = p->next; … … 309 311 310 312 /* Other param. */ 311 printed = pjsip_param_print_on(&url->other_param, buf, endbuf-buf, ';'); 313 printed = pjsip_param_print_on(&url->other_param, buf, endbuf-buf, 314 &pjsip_PARAM_CHAR_SPEC, 315 &pjsip_PARAM_CHAR_SPEC, ';'); 312 316 if (printed < 0) 313 317 return -1; … … 449 453 * string.. 450 454 */ 451 PJ_TODO(MORE_COMPLIANT_HEADER_PARAM_COMPARISON_IN_URL);452 453 455 if (pj_stricmp(&p1->value, &p2->value) != 0) 454 456 return PJSIP_ECMPHEADERPARAM; -
pjproject/trunk/pjsip/src/test-pjsip/test.c
r77 r82 83 83 84 84 DO_TEST(uri_test()); 85 //DO_TEST(msg_test());85 DO_TEST(msg_test()); 86 86 87 87 on_return: -
pjproject/trunk/pjsip/src/test-pjsip/uri.c
r77 r82 58 58 static pjsip_uri *create_uri16( pj_pool_t *pool ); 59 59 static pjsip_uri *create_uri17( pj_pool_t *pool ); 60 static pjsip_uri *create_uri25( pj_pool_t *pool ); 61 static pjsip_uri *create_uri26( pj_pool_t *pool ); 62 static pjsip_uri *create_uri27( pj_pool_t *pool ); 63 static pjsip_uri *create_uri28( pj_pool_t *pool ); 64 static pjsip_uri *create_uri29( pj_pool_t *pool ); 65 static pjsip_uri *create_uri30( pj_pool_t *pool ); 66 static pjsip_uri *create_uri31( pj_pool_t *pool ); 67 static pjsip_uri *create_uri32( pj_pool_t *pool ); 68 static pjsip_uri *create_uri33( pj_pool_t *pool ); 69 static pjsip_uri *create_uri34( pj_pool_t *pool ); 70 static pjsip_uri *create_uri35( pj_pool_t *pool ); 60 71 static pjsip_uri *create_dummy( pj_pool_t *pool ); 61 72 … … 67 78 pj_status_t status; 68 79 char str[PJSIP_MAX_URL_SIZE]; 69 pjsip_uri *(*creator)(pj_pool_t *pool); 80 pjsip_uri *(*creator)(pj_pool_t *pool); 81 const char *printed; 70 82 pj_size_t len; 71 83 } uri_test_array[] = … … 227 239 "", 228 240 &create_dummy, 229 } 241 }, 242 { 243 /* 25: Simple tel: URI with global context */ 244 PJ_SUCCESS, 245 "tel:+1-201-555-0123", 246 &create_uri25, 247 "tel:+1-201-555-0123" 248 }, 249 { 250 /* 26: Simple tel: URI with local context */ 251 PJ_SUCCESS, 252 "tel:7042;phone-context=example.com", 253 &create_uri26, 254 "tel:7042;phone-context=example.com" 255 }, 256 { 257 /* 27: Simple tel: URI with local context */ 258 PJ_SUCCESS, 259 "tel:863-1234;phone-context=+1-914-555", 260 &create_uri27, 261 "tel:863-1234;phone-context=+1-914-555" 262 }, 263 { 264 /* 28: Comparison between local and global number */ 265 ERR_NOT_EQUAL, 266 "tel:+1", 267 &create_uri28, 268 "tel:+1" 269 }, 270 { 271 /* 29: tel: with some visual chars and spaces */ 272 PJ_SUCCESS, 273 "tel:(44).1234-*#+Deaf", 274 &create_uri29, 275 "tel:(44).1234-*#+Deaf" 276 }, 277 { 278 /* 30: isub parameters */ 279 PJ_SUCCESS, 280 "tel:+1;isub=/:@&$,-_.!~*'()[]/:&$aA1%21+=", 281 &create_uri30, 282 "tel:+1;isub=/:@&$,-_.!~*'()[]/:&$aA1%21+%3d" 283 }, 284 { 285 /* 31: extension number parsing and encoding */ 286 PJ_SUCCESS, 287 "tel:+1;ext=+123", 288 &create_uri31, 289 "tel:+1;ext=%2b123" 290 }, 291 { 292 /* 32: context parameter parsing and encoding */ 293 PJ_SUCCESS, 294 "tel:911;phone-context=+1-911", 295 &create_uri32, 296 "tel:911;phone-context=+1-911" 297 }, 298 { 299 /* 33: case-insensitive comparison */ 300 PJ_SUCCESS, 301 "tel:911;phone-context=emergency.example.com", 302 &create_uri33, 303 "tel:911;phone-context=emergency.example.com" 304 }, 305 { 306 /* 34: parameter only appears in one URL */ 307 ERR_NOT_EQUAL, 308 "tel:911;p1=p1;p2=p2", 309 &create_uri34, 310 "tel:911;p1=p1;p2=p2" 311 }, 312 230 313 }; 231 314 … … 474 557 return (pjsip_uri*)url; 475 558 } 559 560 561 static pjsip_uri *create_uri25(pj_pool_t *pool) 562 { 563 /* "tel:+1-201-555-0123" */ 564 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 565 566 uri->number = pj_str("+1-201-555-0123"); 567 return (pjsip_uri*)uri; 568 } 569 570 static pjsip_uri *create_uri26(pj_pool_t *pool) 571 { 572 /* tel:7042;phone-context=example.com */ 573 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 574 575 uri->number = pj_str("7042"); 576 uri->context = pj_str("example.com"); 577 return (pjsip_uri*)uri; 578 } 579 580 static pjsip_uri *create_uri27(pj_pool_t *pool) 581 { 582 /* "tel:863-1234;phone-context=+1-914-555" */ 583 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 584 585 uri->number = pj_str("863-1234"); 586 uri->context = pj_str("+1-914-555"); 587 return (pjsip_uri*)uri; 588 } 589 590 /* "tel:1" */ 591 static pjsip_uri *create_uri28(pj_pool_t *pool) 592 { 593 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 594 595 uri->number = pj_str("1"); 596 return (pjsip_uri*)uri; 597 } 598 599 /* "tel:(44).1234-*#+Deaf" */ 600 static pjsip_uri *create_uri29(pj_pool_t *pool) 601 { 602 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 603 604 uri->number = pj_str("(44).1234-*#+Deaf"); 605 return (pjsip_uri*)uri; 606 } 607 608 /* "tel:+1;isub=/:@&$,-_.!~*'()[]/:&$aA1%21+=" */ 609 static pjsip_uri *create_uri30(pj_pool_t *pool) 610 { 611 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 612 613 uri->number = pj_str("+1"); 614 uri->isub_param = pj_str("/:@&$,-_.!~*'()[]/:&$aA1%21+="); 615 return (pjsip_uri*)uri; 616 } 617 618 /* "tel:+1;ext=+123" */ 619 static pjsip_uri *create_uri31(pj_pool_t *pool) 620 { 621 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 622 623 uri->number = pj_str("+1"); 624 uri->ext_param = pj_str("+123"); 625 return (pjsip_uri*)uri; 626 } 627 628 /* "tel:911;phone-context=+1-911" */ 629 static pjsip_uri *create_uri32(pj_pool_t *pool) 630 { 631 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 632 633 uri->number = pj_str("911"); 634 uri->context = pj_str("+1-911"); 635 return (pjsip_uri*)uri; 636 } 637 638 /* "tel:911;phone-context=emergency.example.com" */ 639 static pjsip_uri *create_uri33(pj_pool_t *pool) 640 { 641 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 642 643 uri->number = pj_str("911"); 644 uri->context = pj_str("EMERGENCY.EXAMPLE.COM"); 645 return (pjsip_uri*)uri; 646 } 647 648 /* "tel:911;p1=p1;p2=p2" */ 649 static pjsip_uri *create_uri34(pj_pool_t *pool) 650 { 651 pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); 652 pjsip_param *p; 653 654 uri->number = pj_str("911"); 655 656 p = pj_pool_alloc(pool, sizeof(*p)); 657 p->name = p->value = pj_str("p1"); 658 pj_list_insert_before(&uri->other_param, p); 659 660 return (pjsip_uri*)uri; 661 } 662 476 663 477 664 static pjsip_uri *create_dummy(pj_pool_t *pool) … … 573 760 574 761 /* Compare text. */ 575 if (pj_strcmp(&s1, &s2) != 0) { 576 /* Not equal. */ 577 status = -60; 762 if (entry->printed) { 763 if (pj_strcmp2(&s1, entry->printed) != 0) { 764 /* Not equal. */ 765 PJ_LOG(3,("", " uri print mismatch:\n" 766 " printed='%s'\n" 767 " expectd='%s'", 768 s1.ptr, entry->printed)); 769 status = -60; 770 } 771 } else { 772 if (pj_strcmp(&s1, &s2) != 0) { 773 /* Not equal. */ 774 PJ_LOG(3,("", " uri print mismatch:\n" 775 " uri1='%s'\n" 776 " uri2='%s'", 777 s1.ptr, s2.ptr)); 778 status = -70; 779 } 578 780 } 579 781
Note: See TracChangeset
for help on using the changeset viewer.