Commit 7b1e75ec authored by Pekka Pessi's avatar Pekka Pessi
Browse files

Fixed nua_handle_has_active_call() in nua_stack.c.

darcs-hash:20051129121416-65a35-07dfc813436f3b77a6ba368033f7f5765120c648.gz
parent 1427dd8b
......@@ -2938,6 +2938,16 @@ static void signal_call_state_change(nua_handle_t *nh,
answer_sent = strcasecmp(oa_sent, "answer") == 0;
}
if (answer_recv || answer_sent) {
/* Update ss->ss_hold_remote */
char const *held;
soa_get_params(nh->nh_soa, SOATAG_HOLD_REF(held), TAG_END());
ss->ss_hold_remote = held && strlen(held) > 0;
}
(void)sr;
if (next_state > ss_state)
......
......@@ -2580,6 +2580,9 @@ int test_call_hold(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(!nua_handle_has_call_on_hold(a_call->nh));
/*
Server transitions:
INIT -(S1)-> RECEIVED: nua_i_invite, nua_i_state
......@@ -2603,6 +2606,9 @@ int test_call_hold(struct context *ctx)
TEST(audio_activity(e->data->e_tags), SOA_ACTIVE_SENDRECV);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(!nua_handle_has_call_on_hold(b_call->nh));
free_events_in_list(ctx, b_call);
/*
......@@ -2635,6 +2641,10 @@ int test_call_hold(struct context *ctx)
TEST_1(is_answer_recv(e->data->e_tags));
TEST(audio_activity(e->data->e_tags), SOA_ACTIVE_SENDONLY);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(nua_handle_has_call_on_hold(a_call->nh));
free_events_in_list(ctx, a_call);
/*
......@@ -2654,6 +2664,9 @@ int test_call_hold(struct context *ctx)
TEST(audio_activity(e->data->e_tags), SOA_ACTIVE_RECVONLY);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(!nua_handle_has_call_on_hold(b_call->nh));
free_events_in_list(ctx, b_call);
if (print_headings)
......@@ -2691,6 +2704,10 @@ int test_call_hold(struct context *ctx)
TEST(audio_activity(e->data->e_tags), SOA_ACTIVE_INACTIVE);
TEST(video_activity(e->data->e_tags), SOA_ACTIVE_SENDRECV);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(nua_handle_has_call_on_hold(b_call->nh));
free_events_in_list(ctx, b_call);
/*
......@@ -2711,6 +2728,9 @@ int test_call_hold(struct context *ctx)
TEST(video_activity(e->data->e_tags), SOA_ACTIVE_SENDRECV);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(nua_handle_has_call_on_hold(a_call->nh));
free_events_in_list(ctx, a_call);
if (print_headings)
......@@ -2750,6 +2770,9 @@ int test_call_hold(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, a_call);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(!nua_handle_has_call_on_hold(a_call->nh));
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
......@@ -2768,6 +2791,9 @@ int test_call_hold(struct context *ctx)
TEST(video_activity(e->data->e_tags), SOA_ACTIVE_SENDRECV);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(nua_handle_has_call_on_hold(b_call->nh));
free_events_in_list(ctx, b_call);
if (print_headings)
......@@ -2807,6 +2833,9 @@ int test_call_hold(struct context *ctx)
TEST_1(!e->next);
free_events_in_list(ctx, b_call);
TEST_1(nua_handle_has_active_call(a_call->nh));
TEST_1(!nua_handle_has_call_on_hold(a_call->nh));
/*
Server transitions:
READY -(S3b)-> COMPLETED: nua_i_invite, <auto-answer>, nua_i_state
......@@ -2825,6 +2854,9 @@ int test_call_hold(struct context *ctx)
TEST(video_activity(e->data->e_tags), SOA_ACTIVE_SENDRECV);
TEST_1(!e->next);
TEST_1(nua_handle_has_active_call(b_call->nh));
TEST_1(!nua_handle_has_call_on_hold(b_call->nh));
free_events_in_list(ctx, a_call);
if (print_headings)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment