diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-02-22 14:46:55 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-02-22 14:46:55 +0000 |
commit | d7bfd38fd9a244a92f74cb2c0cc8ae2bbc056e20 (patch) | |
tree | 5b6614cd50960e524e2fc4e12b3f95fac42f5171 /pjsip-apps/src | |
parent | 7adab49c698d7f6d31b22a8afa74bbac0ca74cdf (diff) |
Fixed ticket #131: dialog automatically insert Contact header when sending 3xx response (thanks Hozjan Vladimir for reporting)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/pjproject-0.5-stable@994 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src')
-rw-r--r-- | pjsip-apps/src/pjsua/pjsua_app.c | 24 |
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; |