Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pjsip/info-dtmf: Change to WaitDigit to make more reliable #76

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were these incorrect in the first place?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Either is acceptable but the letters/symbols are clearer than the numbers. I couldn't find the numbers for the symbols anyway. :)

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