summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-04-27 12:50:16 +0000
committerBenny Prijono <bennylp@teluu.com>2009-04-27 12:50:16 +0000
commit2a3362d1b960f0533552b8cfba0c6a4fff4ba147 (patch)
treee1096efb824638ad6c1b260fc54993916083566b /pjsip-apps
parent1df6ac0c66b44fa792ef8e0f2a9aa3e45c4971f2 (diff)
Ticket #798: UAC disconnect call when receiving BYE in early state (thanks Gang Liu for the suggestion)
- UAC now handles the BYE, and treat it as out-of-order disconnect request, meaning that it will disconnect the call - it will also activate timer to terminate the INVITE transaction, in case final response never arrives - added SIPp UAS scenario to test this - also added forked 200/OK response SIPp scenario, - and fixed the prack_fork.xml SIPp scenario git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2650 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/src/pjsua/pjsua_app.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/pjsip-apps/src/pjsua/pjsua_app.c b/pjsip-apps/src/pjsua/pjsua_app.c
index 2b163d8c..dd81f9e9 100644
--- a/pjsip-apps/src/pjsua/pjsua_app.c
+++ b/pjsip-apps/src/pjsua/pjsua_app.c
@@ -3796,9 +3796,15 @@ void console_app_main(const pj_str_t *uri_to_call)
ui_input_url("Destination URI", buf, sizeof(buf), &result);
if (result.nb_result != NO_NB) {
- if (result.nb_result == -1 || result.nb_result == 0) {
+ if (result.nb_result == -1) {
puts("Sorry you can't do that!");
continue;
+ } else if (result.nb_result == 0) {
+ uri = NULL;
+ if (current_call == PJSUA_INVALID_ID) {
+ puts("No current call");
+ continue;
+ }
} else {
pjsua_buddy_info binfo;
pjsua_buddy_get_info(result.nb_result-1, &binfo);
@@ -3811,9 +3817,18 @@ void console_app_main(const pj_str_t *uri_to_call)
uri = result.uri_result;
}
- tmp = pj_str(uri);
-
- send_request(text, &tmp);
+ if (uri) {
+ tmp = pj_str(uri);
+ send_request(text, &tmp);
+ } else {
+ /* If you send call control request using this method
+ * (such requests includes BYE, CANCEL, etc.), it will
+ * not go well with the call state, so don't do it
+ * unless it's for testing.
+ */
+ pj_str_t method = pj_str(text);
+ pjsua_call_send_request(current_call, &method, NULL);
+ }
break;
case 'e':