summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-02-22 14:52:24 +0000
committerBenny Prijono <bennylp@teluu.com>2007-02-22 14:52:24 +0000
commitb9c4802224bd1772e144def6df556fbf0a3a71ed (patch)
tree3ce4c868f00e04700f591ddfa589ce886a59bae3 /pjsip-apps
parent20968030aa4e9d15c000cca74aa9a3b575c7f41e (diff)
Fixed ticket #132: dialog automatically insert Contact header when sending 3xx response (thanks Hozjan Vladimir for the report)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@995 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 1417b81f..928ed1c1 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -2284,12 +2284,32 @@ void console_app_main(const pj_str_t *uri_to_call)
continue;
} else {
+ int st_code;
+ char contact[120];
+ pj_str_t hname = { "Contact", 7 };
+ pj_str_t hvalue;
+ pjsip_generic_string_hdr hcontact;
+ pjsua_msg_data msg_data;
+
if (!simple_input("Answer with code (100-699)", buf, sizeof(buf)))
continue;
- if (my_atoi(buf) < 100)
+ st_code = my_atoi(buf);
+ if (st_code < 100)
continue;
+ pjsua_msg_data_init(&msg_data);
+
+ if (st_code/100 == 3) {
+ if (!simple_input("Enter URL to be put in Contact",
+ contact, sizeof(contact)))
+ continue;
+ hvalue = pj_str(contact);
+ pjsip_generic_string_hdr_init2(&hcontact, &hname, &hvalue);
+
+ pj_list_push_back(&msg_data.hdr_list, &hcontact);
+ }
+
/*
* Must check again!
* Call may have been disconnected while we're waiting for
@@ -2301,7 +2321,7 @@ void console_app_main(const pj_str_t *uri_to_call)
continue;
}
- pjsua_call_answer(current_call, my_atoi(buf), NULL, NULL);
+ pjsua_call_answer(current_call, st_code, NULL, &msg_data);
}
break;