summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-24 18:48:45 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-26 06:22:06 +0100
commitcacce828103752a9375928c63fcb7c2c19d513ae (patch)
treec4c8cc5b981ebb96cd121aa61d067affd71197dd
parentaab9ac519168af62fa53ec71837bdd371dd32a62 (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.c12
-rw-r--r--src/call.h1
-rw-r--r--src/mncc.c8
3 files changed, 20 insertions, 1 deletions
diff --git a/src/call.c b/src/call.c
index d9ca66e..48281a1 100644
--- a/src/call.c
+++ b/src/call.c
@@ -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;
+}
diff --git a/src/call.h b/src/call.h
index dc82f97..102c366 100644
--- a/src/call.h
+++ b/src/call.h
@@ -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);
diff --git a/src/mncc.c b/src/mncc.c
index a44ecad..406f32d 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -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)