Handling of unknown facility indications from terminals
This commit is contained in:
parent
b7887e39cf
commit
45177fa41c
131
src/isdn/dss1.c
131
src/isdn/dss1.c
|
@ -1323,80 +1323,83 @@ void facility_ind(call_t *call, uint32_t pid, struct l3_msg *l3m)
|
||||||
set_3pty = 0;
|
set_3pty = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
;
|
LOGP(DDSS1, LOGL_DEBUG, "Facility Operation=%x of Component=%x not implemented\n", fac.u.inv.operationValue, fac.comp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
;
|
LOGP(DDSS1, LOGL_DEBUG, "Facility Operation=%x of Component=%x not implemented\n", fac.u.inv.operationValue, fac.comp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find other terminal on hold */
|
if(set_3pty >= 0) {
|
||||||
other = call->isdn_ep->call_list;
|
/* find other terminal on hold */
|
||||||
while (other) {
|
other = call->isdn_ep->call_list;
|
||||||
// printf("check: call=%p other=%p call_ces=%x other_ces=%x other_hold=%d\n", call, other, call->l3_ces, other->l3_ces, other->hold);
|
while (other) {
|
||||||
if (other != call
|
// printf("check: call=%p other=%p call_ces=%x other_ces=%x other_hold=%d\n", call, other, call->l3_ces, other->l3_ces, other->hold);
|
||||||
&& other->l3_ces == call->l3_ces) {
|
if (other != call
|
||||||
/* if we got facility on active call */
|
&& other->l3_ces == call->l3_ces) {
|
||||||
if (other->hold && !call->hold)
|
/* if we got facility on active call */
|
||||||
break;
|
if (other->hold && !call->hold)
|
||||||
/* if we got facility on active call */
|
break;
|
||||||
if (!other->hold && call->hold)
|
/* if we got facility on active call */
|
||||||
break;
|
if (!other->hold && call->hold)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
other = other->next;
|
||||||
|
}
|
||||||
|
if (other) {
|
||||||
|
other->conference_3pty = call->conference_3pty = set_3pty;
|
||||||
|
/* process local briding capability */
|
||||||
|
bridge_socket_client_update(call, 0);
|
||||||
|
bridge_socket_client_update(other, 0);
|
||||||
|
jitter_reset(&call->conf_dejitter);
|
||||||
|
jitter_reset(&call->tx_dejitter);
|
||||||
|
jitter_reset(&other->conf_dejitter);
|
||||||
|
jitter_reset(&other->tx_dejitter);
|
||||||
|
} else {
|
||||||
|
LOGP(DDSS1, LOGL_NOTICE, "Phone requests conference, but no call on hold!\n");
|
||||||
|
notify = 0;
|
||||||
}
|
}
|
||||||
other = other->next;
|
|
||||||
}
|
|
||||||
if (set_3pty >= 0 && other) {
|
|
||||||
other->conference_3pty = call->conference_3pty = set_3pty;
|
|
||||||
/* process local briding capability */
|
|
||||||
bridge_socket_client_update(call, 0);
|
|
||||||
bridge_socket_client_update(other, 0);
|
|
||||||
jitter_reset(&call->conf_dejitter);
|
|
||||||
jitter_reset(&call->tx_dejitter);
|
|
||||||
jitter_reset(&other->conf_dejitter);
|
|
||||||
jitter_reset(&other->tx_dejitter);
|
|
||||||
} else {
|
|
||||||
LOGP(DDSS1, LOGL_NOTICE, "Phone requests conference, but no call on hold!\n");
|
|
||||||
notify = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* encode 3PTY facility */
|
/* encode 3PTY facility */
|
||||||
memset(&fac, 0, sizeof(fac));
|
memset(&fac, 0, sizeof(fac));
|
||||||
fac.Valid = 1;
|
fac.Valid = 1;
|
||||||
if (notify) {
|
if (notify) {
|
||||||
fac.comp = CompReturnResult;
|
fac.comp = CompReturnResult;
|
||||||
fac.u.retResult.invokeId = invokeid;
|
fac.u.retResult.invokeId = invokeid;
|
||||||
fac.u.retResult.operationValuePresent = 1;
|
fac.u.retResult.operationValuePresent = 1;
|
||||||
if (notify == OSMO_CC_NOTIFY_CONFERENCE_ESTABLISHED)
|
if (notify == OSMO_CC_NOTIFY_CONFERENCE_ESTABLISHED)
|
||||||
fac.u.retResult.operationValue = Fac_Begin3PTY;
|
fac.u.retResult.operationValue = Fac_Begin3PTY;
|
||||||
if (notify == OSMO_CC_NOTIFY_CONFERENCE_DISCONNECTED)
|
if (notify == OSMO_CC_NOTIFY_CONFERENCE_DISCONNECTED)
|
||||||
fac.u.retResult.operationValue = Fac_End3PTY;
|
fac.u.retResult.operationValue = Fac_End3PTY;
|
||||||
} else {
|
} else {
|
||||||
fac.comp = CompReturnError;
|
fac.comp = CompReturnError;
|
||||||
fac.u.retError.invokeId = invokeid;
|
fac.u.retError.invokeId = invokeid;
|
||||||
fac.u.retError.errorValue = FacError_Gen_InvalidCallState;
|
fac.u.retError.errorValue = FacError_Gen_InvalidCallState;
|
||||||
}
|
}
|
||||||
encodeFac(fac_ie, &fac);
|
encodeFac(fac_ie, &fac);
|
||||||
|
|
||||||
|
/* sending facility */
|
||||||
|
l3m = create_l3msg();
|
||||||
|
enc_ie_facility(l3m, fac_ie + 2, fac_ie[1]);
|
||||||
|
call->isdn_ep->ml3->to_layer3(call->isdn_ep->ml3, MT_FACILITY, call->l3_pid, l3m);
|
||||||
|
|
||||||
/* sending facility */
|
if (notify) {
|
||||||
l3m = create_l3msg();
|
/* create osmo-cc message */
|
||||||
enc_ie_facility(l3m, fac_ie + 2, fac_ie[1]);
|
msg = osmo_cc_new_msg(OSMO_CC_MSG_NOTIFY_IND);
|
||||||
call->isdn_ep->ml3->to_layer3(call->isdn_ep->ml3, MT_FACILITY, call->l3_pid, l3m);
|
/* notify the facility */
|
||||||
|
osmo_cc_add_ie_notify(msg, notify);
|
||||||
|
/* send message to osmo-cc */
|
||||||
|
osmo_cc_ll_msg(&call->isdn_ep->cc_ep, call->cc_callref, msg);
|
||||||
|
|
||||||
if (notify) {
|
/* create osmo-cc message */
|
||||||
/* create osmo-cc message */
|
msg = osmo_cc_new_msg(OSMO_CC_MSG_NOTIFY_IND);
|
||||||
msg = osmo_cc_new_msg(OSMO_CC_MSG_NOTIFY_IND);
|
/* notify the facility */
|
||||||
/* notify the facility */
|
osmo_cc_add_ie_notify(msg, notify);
|
||||||
osmo_cc_add_ie_notify(msg, notify);
|
/* send message to osmo-cc */
|
||||||
/* send message to osmo-cc */
|
osmo_cc_ll_msg(&other->isdn_ep->cc_ep, call->cc_callref, msg);
|
||||||
osmo_cc_ll_msg(&call->isdn_ep->cc_ep, call->cc_callref, msg);
|
}
|
||||||
|
|
||||||
/* create osmo-cc message */
|
|
||||||
msg = osmo_cc_new_msg(OSMO_CC_MSG_NOTIFY_IND);
|
|
||||||
/* notify the facility */
|
|
||||||
osmo_cc_add_ie_notify(msg, notify);
|
|
||||||
/* send message to osmo-cc */
|
|
||||||
osmo_cc_ll_msg(&other->isdn_ep->cc_ep, call->cc_callref, msg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue