From 0c7d22afb672fb08310fc66b080a8c9acb3d9b7d Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sat, 15 Aug 2009 11:00:26 +0000 Subject: More ticket #930 (New PJSUA-LIB account option to add user defined parameters to the Contact header) - Fixed test failure in pjsip_test, due to Contact URI is now interpreted as Contact header git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2883 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/test/txdata_test.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'pjsip/src') diff --git a/pjsip/src/test/txdata_test.c b/pjsip/src/test/txdata_test.c index 9ced25e3..fb791155 100644 --- a/pjsip/src/test/txdata_test.c +++ b/pjsip/src/test/txdata_test.c @@ -417,6 +417,7 @@ static int txdata_test_uri_params(void) pj_str_t target = pj_str("sip:alice@wonderland:5061;x-param=param%201" "?X-Hdr-1=Header%201" "&X-Empty-Hdr="); + pj_str_t contact; pj_str_t pname = pj_str("x-param"); pj_str_t hname = pj_str("X-Hdr-1"); pj_str_t hemptyname = pj_str("X-Empty-Hdr"); @@ -435,9 +436,17 @@ static int txdata_test_uri_params(void) PJ_LOG(3,(THIS_FILE, " header param in URI to create request")); + /* Due to #930, contact argument is now parsed as Contact header, so + * must enclose it with <> to make it be parsed as URI. + */ + pj_ansi_snprintf(msgbuf, sizeof(msgbuf), "<%.*s>", + (int)target.slen, target.ptr); + contact.ptr = msgbuf; + contact.slen = strlen(msgbuf); + /* Create request with header param in target URI. */ status = pjsip_endpt_create_request(endpt, &pjsip_invite_method, &target, - &target, &target, &target, NULL, -1, + &target, &target, &contact, NULL, -1, NULL, &tdata); if (status != 0) { app_perror(" error: Unable to create request", status); -- cgit v1.2.3