diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-24 18:48:45 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-26 06:22:06 +0100 |
commit | cacce828103752a9375928c63fcb7c2c19d513ae (patch) | |
tree | c4c8cc5b981ebb96cd121aa61d067affd71197dd | |
parent | aab9ac519168af62fa53ec71837bdd371dd32a62 (diff) |
mncc: In case of an unexpected REL.IND inform the other leg about it
I had modified my code to do nothing after having sent the PROCEEDING
message. First the MS will issue a DISCONNECT.IND (which I ignored) and
then there will be REL.IND. Let's inform the other leg about this event
and let's assume the call will then be terminated.
-rw-r--r-- | src/call.c | 12 | ||||
-rw-r--r-- | src/call.h | 1 | ||||
-rw-r--r-- | src/mncc.c | 8 |
3 files changed, 20 insertions, 1 deletions
@@ -78,3 +78,15 @@ struct call *sip_call_mncc_create(void) llist_add(&call->entry, &g_call_list); return call; } + +struct call_leg *call_leg_other(struct call_leg *leg) +{ + if (leg->call->initial == leg) + return leg->call->remote; + if (leg->call->remote == leg) + return leg->call->initial; + + LOGP(DAPP, LOGL_NOTICE, "leg(0x%p) not belonging to call(%u)\n", + leg, leg->call->id); + return NULL; +} @@ -81,6 +81,7 @@ struct mncc_call_leg { extern struct llist_head g_call_list; void calls_init(void); +struct call_leg *call_leg_other(struct call_leg *leg); void call_leg_release(struct call_leg *leg); @@ -315,8 +315,14 @@ static void check_rel_ind(struct mncc_connection *conn, char *buf, int rc) if (leg->base.in_release) stop_cmd_timer(leg, MNCC_REL_IND); + else { + struct call_leg *other_leg; + other_leg = call_leg_other(&leg->base); + if (other_leg) + other_leg->release_call(other_leg); + } LOGP(DMNCC, LOGL_DEBUG, "leg(%u) was released.\n", data->callref); - call_leg_release(leg); + call_leg_release(&leg->base); } static void check_hello(struct mncc_connection *conn, char *buf, int rc) |