提交 9113f23b authored 作者: Steve Underwood's avatar Steve Underwood

Fixed the application of the T.30 T1 timeout in faxing.

上级 ce62c062
...@@ -589,5 +589,69 @@ ...@@ -589,5 +589,69 @@
<step dir="R" type="CLEAR" timein="800" timeout="1200"/> <step dir="R" type="CLEAR" timein="800" timeout="1200"/>
<step type="STATUS" value="OK"/> <step type="STATUS" value="OK"/>
</test> </test>
<test name="Invalid-signalling-rate">
<step type="CALL"/>
<!--<step dir="T" type="CNG"/>-->
<step dir="R" type="CED"/>
<!-- Invalid signalling rate in DCS -->
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000"/>
<step dir="R" type="SILENCE"/>
<step type="WAIT" value="75"/>
<step dir="T" type="PREAMBLE" modem="V.21"/>
<step dir="T" type="HDLC" tag="DCS" value="FF C8 C1 00 49 1f 00"/>
<step dir="T" type="POSTAMBLE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F"/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="CLEAR" timein="800" timeout="1200"/>
<step type="STATUS" value="OK"/>
</test>
<test name="No-caller-response">
<step type="CALL"/>
<step dir="T" type="SET" tag="IDENT" value="+0123456789"/>
<!--<step dir="T" type="CNG"/>-->
<step dir="R" type="CED"/>
<!-- -->
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..." timeout="60000"/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..."/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..."/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..."/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..."/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DIS" value="FF C8 01 ..."/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="HDLC" modem="V.21" tag="DCN" value="FF C8 5F"/>
<step dir="R" type="SILENCE"/>
<step dir="R" type="CLEAR" timein="800" timeout="1200"/>
<step type="STATUS" value="T1_EXPIRED"/>
</test>
<test name="No-answerer-response">
<step type="ANSWER" value="etsi_300_242_a4_impress_white.tif"/>
<step dir="T" type="SET" tag="IDENT" value="+0123456789"/>
<step dir="R" type="CNG"/>
<step type="WAIT" value="75"/>
<step dir="R" type="CLEAR" timein="55000" timeout="65000"/>
<step type="STATUS" value="T0_EXPIRED"/>
</test>
</test-group> </test-group>
</fax-tests> </fax-tests>
...@@ -2712,6 +2712,7 @@ static int send_cfr_sequence(t30_state_t *s, int start) ...@@ -2712,6 +2712,7 @@ static int send_cfr_sequence(t30_state_t *s, int start)
s->step++; s->step++;
if (send_csa_frame(s)) if (send_csa_frame(s))
break; break;
/*endif*/
/* Fall through */ /* Fall through */
case 1: case 1:
s->step++; s->step++;
...@@ -5721,6 +5722,7 @@ static void set_phase(t30_state_t *s, int phase) ...@@ -5721,6 +5722,7 @@ static void set_phase(t30_state_t *s, int phase)
case T30_PHASE_D_TX: case T30_PHASE_D_TX:
if (!s->far_end_detected && s->timer_t0_t1 > 0) if (!s->far_end_detected && s->timer_t0_t1 > 0)
{ {
/* Switch from T0 to T1 */
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1); s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
s->far_end_detected = true; s->far_end_detected = true;
} }
...@@ -5822,7 +5824,10 @@ static void set_state(t30_state_t *s, int state) ...@@ -5822,7 +5824,10 @@ static void set_state(t30_state_t *s, int state)
static void repeat_last_command(t30_state_t *s) static void repeat_last_command(t30_state_t *s)
{ {
s->step = 0; s->step = 0;
if (++s->retries >= MAX_COMMAND_TRIES) /* If T0 or T1 are in progress we do not want to apply a limit to the maximum number of retries. We
let T0 or T1 terminate things if the far end doesn't communicate. */
s->retries++;
if (s->timer_t0_t1 == 0 && s->retries >= MAX_COMMAND_TRIES)
{ {
span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n"); span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n");
switch (s->state) switch (s->state)
...@@ -6667,6 +6672,7 @@ static void t30_hdlc_rx_status(void *user_data, int status) ...@@ -6667,6 +6672,7 @@ static void t30_hdlc_rx_status(void *user_data, int status)
case SIG_STATUS_FRAMING_OK: case SIG_STATUS_FRAMING_OK:
if (!s->far_end_detected && s->timer_t0_t1 > 0) if (!s->far_end_detected && s->timer_t0_t1 > 0)
{ {
/* Switch from T0 to T1 */
s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1); s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1);
s->far_end_detected = true; s->far_end_detected = true;
if (s->phase == T30_PHASE_A_CED || s->phase == T30_PHASE_A_CNG) if (s->phase == T30_PHASE_A_CED || s->phase == T30_PHASE_A_CNG)
......
差异被折叠。
...@@ -771,8 +771,6 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr ...@@ -771,8 +771,6 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
s = (faxtester_state_t *) user_data; s = (faxtester_state_t *) user_data;
t = &s->modems; t = &s->modems;
span_log(&s->logging, SPAN_LOG_FLOW, "Set tx type %d\n", type); span_log(&s->logging, SPAN_LOG_FLOW, "Set tx type %d\n", type);
if (s->current_tx_type == type)
return;
if (use_hdlc) if (use_hdlc)
{ {
get_bit_func = (get_bit_func_t) hdlc_tx_get_bit; get_bit_func = (get_bit_func_t) hdlc_tx_get_bit;
...@@ -783,6 +781,12 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr ...@@ -783,6 +781,12 @@ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_tr
get_bit_func = non_ecm_get_bit; get_bit_func = non_ecm_get_bit;
get_bit_user_data = (void *) s; get_bit_user_data = (void *) s;
} }
if (type == s->current_tx_type)
{
if (type == T30_MODEM_PAUSE)
silence_gen_alter(&t->silence_gen, ms_to_samples(short_train));
return;
}
switch (type) switch (type)
{ {
case T30_MODEM_PAUSE: case T30_MODEM_PAUSE:
...@@ -1314,6 +1318,8 @@ SPAN_DECLARE(int) faxtester_next_step(faxtester_state_t *s) ...@@ -1314,6 +1318,8 @@ SPAN_DECLARE(int) faxtester_next_step(faxtester_state_t *s)
else if (strcasecmp((const char *) parms.type, "CLEAR") == 0) else if (strcasecmp((const char *) parms.type, "CLEAR") == 0)
{ {
span_log(&s->logging, SPAN_LOG_FLOW, "Far end should drop the call\n"); span_log(&s->logging, SPAN_LOG_FLOW, "Far end should drop the call\n");
faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, s->timeout_x, false);
s->test_for_call_clear = true; s->test_for_call_clear = true;
s->call_clear_timer = 0; s->call_clear_timer = 0;
} }
...@@ -1648,6 +1654,8 @@ SPAN_DECLARE(int) faxtester_next_step(faxtester_state_t *s) ...@@ -1648,6 +1654,8 @@ SPAN_DECLARE(int) faxtester_next_step(faxtester_state_t *s)
else if (strcasecmp((const char *) parms.type, "CLEAR") == 0) else if (strcasecmp((const char *) parms.type, "CLEAR") == 0)
{ {
span_log(&s->logging, SPAN_LOG_FLOW, "Time to drop the call\n"); span_log(&s->logging, SPAN_LOG_FLOW, "Time to drop the call\n");
faxtester_set_rx_type(s, T30_MODEM_NONE, 0, false, false);
faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, s->timeout_x, false);
t30_terminate(s->far_t30); t30_terminate(s->far_t30);
free_node_parms(&parms); free_node_parms(&parms);
return 0; return 0;
......
...@@ -28,7 +28,7 @@ run_tsb85_test() ...@@ -28,7 +28,7 @@ run_tsb85_test()
fi fi
} }
for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC ECM-DCN-clipped Non-ECM-DCN-clipped Tx-EOP-echo Tx-PPS-echo for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC ECM-DCN-clipped Non-ECM-DCN-clipped Tx-EOP-echo Tx-PPS-echo Invalid-signalling-rate No-caller-response No-answerer-response
do do
run_tsb85_test run_tsb85_test
done done
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论