AMPS: Detect difference between paging response and call response
Release call, if paging response was received, after call from fixed network has already been released.
This commit is contained in:
@@ -648,15 +648,21 @@ void amps_rx_recc(amps_t *amps, uint8_t scm, uint32_t esn, uint32_t min1, uint16
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
if (order == 0 && ordq == 0 && msg_type == 0) {
|
if (order == 0 && ordq == 0 && msg_type == 0) {
|
||||||
trans = search_transaction_number(amps, min1, min2);
|
if (!dialing)
|
||||||
if (!trans) {
|
|
||||||
PDEBUG(DAMPS, DEBUG_INFO, "Call %s -> %s (ESN = %08x, %s)\n", callerid, dialing, esn, amps_scm(scm));
|
|
||||||
} else {
|
|
||||||
PDEBUG(DAMPS, DEBUG_INFO, "Paging reply %s (ESN = %08x, %s)\n", callerid, esn, amps_scm(scm));
|
PDEBUG(DAMPS, DEBUG_INFO, "Paging reply %s (ESN = %08x, %s)\n", callerid, esn, amps_scm(scm));
|
||||||
|
else
|
||||||
|
PDEBUG(DAMPS, DEBUG_INFO, "Call %s -> %s (ESN = %08x, %s)\n", callerid, dialing, esn, amps_scm(scm));
|
||||||
|
trans = search_transaction_number(amps, min1, min2);
|
||||||
|
if (!trans && !dialing) {
|
||||||
|
PDEBUG(DAMPS, DEBUG_NOTICE, "Paging reply, but call is already gone, rejecting call\n");
|
||||||
|
goto reject;
|
||||||
}
|
}
|
||||||
|
if (trans && dialing)
|
||||||
|
PDEBUG(DAMPS, DEBUG_NOTICE, "There is already a transaction for this phone. Cloning?\n");
|
||||||
vc = search_free_vc();
|
vc = search_free_vc();
|
||||||
if (!vc) {
|
if (!vc) {
|
||||||
PDEBUG(DAMPS, DEBUG_NOTICE, "No free channel, rejecting call\n");
|
PDEBUG(DAMPS, DEBUG_NOTICE, "No free channel, rejecting call\n");
|
||||||
|
reject:
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
trans = create_transaction(amps, TRANS_CALL_REJECT, min1, min2, 0, 0, 3, 0);
|
trans = create_transaction(amps, TRANS_CALL_REJECT, min1, min2, 0, 0, 3, 0);
|
||||||
if (!trans) {
|
if (!trans) {
|
||||||
|
@@ -3239,8 +3239,9 @@ static int amps_decode_word_recc(amps_t *amps, uint64_t word, int first)
|
|||||||
amps->rx_recc_dialing[31] = digit2number[frame->ie[AMPS_IE_DIGIT_32]];
|
amps->rx_recc_dialing[31] = digit2number[frame->ie[AMPS_IE_DIGIT_32]];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg_count >= 2 && nawc == 0) {
|
if (msg_count >= 3 && nawc == 0) {
|
||||||
amps_rx_recc(amps, amps->rx_recc_scm, amps->rx_recc_esn, amps->rx_recc_min1, amps->rx_recc_min2, amps->rx_recc_msg_type, amps->rx_recc_ordq, amps->rx_recc_order, amps->rx_recc_dialing);
|
/* if no digit messages are present, send NULL as dial string (paging reply) */
|
||||||
|
amps_rx_recc(amps, amps->rx_recc_scm, amps->rx_recc_esn, amps->rx_recc_min1, amps->rx_recc_min2, amps->rx_recc_msg_type, amps->rx_recc_ordq, amps->rx_recc_order, (msg_count > 3) ? amps->rx_recc_dialing : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
amps->rx_recc_word_count++;
|
amps->rx_recc_word_count++;
|
||||||
@@ -3618,7 +3619,7 @@ int amps_decode_bits_recc(amps_t *amps, const char *bits, int first)
|
|||||||
if (!strncmp(encode_bch(word_string, 28), word_string + 28, 12))
|
if (!strncmp(encode_bch(word_string, 28), word_string + 28, 12))
|
||||||
crc_ok++;
|
crc_ok++;
|
||||||
}
|
}
|
||||||
if (crc_ok == i) {
|
if (crc_ok) {
|
||||||
PDEBUG(DFRAME, DEBUG_NOTICE, "Seems we RX FOCC frame due to loopback, ignoring!\n");
|
PDEBUG(DFRAME, DEBUG_NOTICE, "Seems we RX FOCC frame due to loopback, ignoring!\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user