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.
This commit is contained in:
parent
aab9ac5191
commit
cacce82810
12
src/call.c
12
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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue