From 2dde735f17b55273f9d2b4dec662f0653192166f Mon Sep 17 00:00:00 2001 From: George Joseph Date: Fri, 8 Nov 2024 14:12:36 -0700 Subject: [PATCH] pjsip/info-dtmf: Change to WaitDigit to make more reliable --- .../info_dtmf/configs/ast1/extensions.conf | 4 +- .../pjsip/info_dtmf/sipp/dtmf-duration.xml | 38 +++++++++---------- tests/channels/pjsip/info_dtmf/sipp/dtmf.xml | 38 +++++++++---------- .../channels/pjsip/info_dtmf/test-config.yaml | 2 +- 4 files changed, 38 insertions(+), 44 deletions(-) diff --git a/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf b/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf index ccf05d119..42c79c223 100644 --- a/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf +++ b/tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf @@ -2,7 +2,5 @@ exten => dtmf,1,NoOp() same => n,Answer() - ; We must use MusicOnHold instead of Echo because we are sending DTMF - ; and echo will send the digits back as well as exit on DTMF '#'. - same => n,MusicOnHold() + same => n,WaitDigit(10,#) same => n,Hangup() diff --git a/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml b/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml index ad938f947..a48745f17 100644 --- a/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml +++ b/tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml @@ -272,7 +272,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=10 + Signal=A Duration=150 ]]> @@ -293,7 +293,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=11 + Signal=B Duration=150 ]]> @@ -314,7 +314,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=12 + Signal=C Duration=150 ]]> @@ -335,7 +335,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=13 + Signal=D Duration=150 ]]> @@ -356,7 +356,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=14 + Signal=* Duration=150 ]]> @@ -377,7 +377,7 @@ Content-Type: application/dtmf-relay Content-Length: [len] - Signal=15 + Signal=# Duration=150 ]]> @@ -385,24 +385,22 @@ - + + - + ;tag=[call_number] - To: dtmf [peer_tag_param] - Call-ID: [call_id] - CSeq: 18 BYE - Contact: sip:test2@[local_ip][local_port] - Max-Forwards: 70 - Subject: INFO Test + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: Content-Length: 0 + ]]> - - - diff --git a/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml b/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml index f0a9aae32..d0d331732 100644 --- a/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml +++ b/tests/channels/pjsip/info_dtmf/sipp/dtmf.xml @@ -262,7 +262,7 @@ Content-Type: application/dtmf Content-Length: [len] - 10 + A ]]> @@ -282,7 +282,7 @@ Content-Type: application/dtmf Content-Length: [len] - 11 + B ]]> @@ -302,7 +302,7 @@ Content-Type: application/dtmf Content-Length: [len] - 12 + C ]]> @@ -322,7 +322,7 @@ Content-Type: application/dtmf Content-Length: [len] - 13 + D ]]> @@ -342,7 +342,7 @@ Content-Type: application/dtmf Content-Length: [len] - 14 + * ]]> @@ -362,31 +362,29 @@ Content-Type: application/dtmf Content-Length: [len] - 15 + # ]]> - + + - + ;tag=[call_number] - To: dtmf [peer_tag_param] - Call-ID: [call_id] - CSeq: 18 BYE - Contact: sip:test@[local_ip][local_port] - Max-Forwards: 70 - Subject: INFO Test + + SIP/2.0 200 OK + [last_Via:] + [last_From:] + [last_To:] + [last_Call-ID:] + [last_CSeq:] + Contact: Content-Length: 0 + ]]> - - - diff --git a/tests/channels/pjsip/info_dtmf/test-config.yaml b/tests/channels/pjsip/info_dtmf/test-config.yaml index 9439f4897..06f41ebe2 100644 --- a/tests/channels/pjsip/info_dtmf/test-config.yaml +++ b/tests/channels/pjsip/info_dtmf/test-config.yaml @@ -1,7 +1,7 @@ testinfo: summary: 'Test that asterisk correctly handles DTMF in SIP packets when using PJSIP.' description: - 'Tests all DMTF characters (0-9 A-D # * !) with and without duration. + 'Tests all DMTF characters (0-9 A-D * #) with and without duration. #Due to a bug (ASTERISK-23537), ignoring "!" and blank DTMF characters.' test-modules: