Skip to content

Commit

Permalink
pjsip/info-dtmf: Change to WaitDigit to make more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
gtjoseph authored and asterisk-org-access-app[bot] committed Nov 14, 2024
1 parent 1d23b0a commit 464a335
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 44 deletions.
4 changes: 1 addition & 3 deletions tests/channels/pjsip/info_dtmf/configs/ast1/extensions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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()
38 changes: 18 additions & 20 deletions tests/channels/pjsip/info_dtmf/sipp/dtmf-duration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=10
Signal=A
Duration=150
]]>
</send>
Expand All @@ -293,7 +293,7 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=11
Signal=B
Duration=150
]]>
</send>
Expand All @@ -314,7 +314,7 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=12
Signal=C
Duration=150
]]>
</send>
Expand All @@ -335,7 +335,7 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=13
Signal=D
Duration=150
]]>
</send>
Expand All @@ -356,7 +356,7 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=14
Signal=*
Duration=150
]]>
</send>
Expand All @@ -377,32 +377,30 @@
Content-Type: application/dtmf-relay
Content-Length: [len]
Signal=15
Signal=#
Duration=150
]]>
</send>

<recv response="200" crlf="true">
</recv>

<pause milliseconds="5000"/>
<recv request="BYE">
</recv>

<send retrans="500">
<send>
<![CDATA[
BYE sip:test2@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: test2 <sip:test2@[local_ip]:[local_port]>;tag=[call_number]
To: dtmf <sip:dtmf@[remote_ip]:[remote_port]>[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: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<recv response="200" crlf="true">
</recv>

</scenario>
38 changes: 18 additions & 20 deletions tests/channels/pjsip/info_dtmf/sipp/dtmf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
Content-Type: application/dtmf
Content-Length: [len]
10
A
]]>
</send>

Expand All @@ -282,7 +282,7 @@
Content-Type: application/dtmf
Content-Length: [len]
11
B
]]>
</send>

Expand All @@ -302,7 +302,7 @@
Content-Type: application/dtmf
Content-Length: [len]
12
C
]]>
</send>

Expand All @@ -322,7 +322,7 @@
Content-Type: application/dtmf
Content-Length: [len]
13
D
]]>
</send>

Expand All @@ -342,7 +342,7 @@
Content-Type: application/dtmf
Content-Length: [len]
14
*
]]>
</send>

Expand All @@ -362,31 +362,29 @@
Content-Type: application/dtmf
Content-Length: [len]
15
#
]]>
</send>

<recv response="200" crlf="true">
</recv>

<pause milliseconds="5000"/>
<recv request="BYE">
</recv>

<send retrans="500">
<send>
<![CDATA[
BYE sip:dtmf@[remote_ip]:[remote_port] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: test <sip:test@[local_ip]:[local_port]>;tag=[call_number]
To: dtmf <sip:dtmf@[remote_ip]:[remote_port]>[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: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>

<recv response="200" crlf="true">
</recv>

</scenario>
2 changes: 1 addition & 1 deletion tests/channels/pjsip/info_dtmf/test-config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 464a335

Please sign in to comment.