mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 09:09:21 +00:00
Fix DTMF tests suite: when using SIP INFO, we should keep initial packets order
This commit is contained in:
parent
a8e2461db5
commit
8846ca4780
2 changed files with 7 additions and 2 deletions
|
|
@ -29,10 +29,12 @@ void dtmf_received(LinphoneCore *lc, LinphoneCall *call, int dtmf) {
|
|||
*dst = *dst ?
|
||||
ms_strcat_printf(*dst, "%c", dtmf)
|
||||
: ms_strdup_printf("%c", dtmf);
|
||||
counters->dtmf_count++;
|
||||
}
|
||||
|
||||
void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtmf_seq) {
|
||||
char* expected = NULL;
|
||||
int dtmf_count_prev;
|
||||
marie = linphone_core_manager_new( "marie_rc");
|
||||
pauline = linphone_core_manager_new( "pauline_rc");
|
||||
|
||||
|
|
@ -46,19 +48,21 @@ void send_dtmf_base(bool_t use_rfc2833, bool_t use_sipinfo, char dtmf, char* dtm
|
|||
marie_call = linphone_core_get_current_call(marie->lc);
|
||||
|
||||
if (dtmf != '\0') {
|
||||
dtmf_count_prev = pauline->stat.dtmf_count;
|
||||
linphone_call_send_dtmf(marie_call, dtmf);
|
||||
|
||||
/*wait for the DTMF to be received from pauline*/
|
||||
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000);
|
||||
CU_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &pauline->stat.dtmf_count, dtmf_count_prev+1, 10000));
|
||||
expected = ms_strdup_printf("%c", dtmf);
|
||||
}
|
||||
|
||||
if (dtmf_seq != NULL) {
|
||||
int dtmf_delay_ms = lp_config_get_int(marie_call->core->config,"net","dtmf_delay_ms",200);
|
||||
dtmf_count_prev = pauline->stat.dtmf_count;
|
||||
linphone_call_send_dtmfs(marie_call, dtmf_seq);
|
||||
|
||||
/*wait for the DTMF sequence to be received from pauline*/
|
||||
wait_for_until(marie->lc, pauline->lc, NULL, 0, 1000 + dtmf_delay_ms * strlen(dtmf_seq));
|
||||
CU_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &pauline->stat.dtmf_count, dtmf_count_prev + strlen(dtmf_seq), 10000 + dtmf_delay_ms * strlen(dtmf_seq)));
|
||||
expected = (dtmf!='\0')?ms_strdup_printf("%c%s",dtmf,dtmf_seq):ms_strdup(dtmf_seq);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ typedef struct _stats {
|
|||
LinphoneChatMessage* last_received_chat_message;
|
||||
|
||||
char * dtmf_list_received;
|
||||
int dtmf_count;
|
||||
}stats;
|
||||
|
||||
typedef struct _LinphoneCoreManager {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue