summaryrefslogtreecommitdiff
path: root/pjsip/src/test
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-08-15 11:00:26 +0000
committerBenny Prijono <bennylp@teluu.com>2009-08-15 11:00:26 +0000
commit0c7d22afb672fb08310fc66b080a8c9acb3d9b7d (patch)
tree8c038335ad6bbc1f3f1ef01bc7283c98bfd5dfb2 /pjsip/src/test
parent62085bfb4fe4e6f5ca95f414d96714c2f8714355 (diff)
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
Diffstat (limited to 'pjsip/src/test')
-rw-r--r--pjsip/src/test/txdata_test.c11
1 files changed, 10 insertions, 1 deletions
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);