[Asterisk-code-review] app_dial: Tests for expanded A option (testsuite[master])

N A asteriskteam at digium.com
Wed Jun 2 11:31:25 CDT 2021


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/15986 )


Change subject: app_dial: Tests for expanded A option
......................................................................

app_dial: Tests for expanded A option

Adds test for the expanded Announcement
option which can plays announcements
to the calling and called parties.

ASTERISK-29442

Change-Id: Id8a136dc4ba771e0aca71e1a3ed3b4b20b406158
---
A tests/apps/dial/dial_announcements/configs/ast1/extensions.conf
A tests/apps/dial/dial_announcements/test-config.yaml
M tests/apps/dial/tests.yaml
3 files changed, 85 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/86/15986/1

diff --git a/tests/apps/dial/dial_announcements/configs/ast1/extensions.conf b/tests/apps/dial/dial_announcements/configs/ast1/extensions.conf
new file mode 100644
index 0000000..e1bde08
--- /dev/null
+++ b/tests/apps/dial/dial_announcements/configs/ast1/extensions.conf
@@ -0,0 +1,25 @@
+[default]
+exten => caller,1,Answer(2)
+	same => n,Dial(Local/s at somebody/n,,gA(tt-weasels:tt-weasels))
+	same => n,Hangup()
+
+[default-side-b]
+exten => s,1,Answer()
+	same => n,Set(TIMEOUT(absolute)=12)
+	same => n,BackgroundDetect(silence/10,200,500)
+	same => n,UserEvent(DialAnnouncementCaller,Result: Fail,Reason: No Announcement Heard)
+	same => n,Hangup()
+exten => talk,1,UserEvent(DialAnnouncementCaller,Result: Pass)
+	same => n,Hangup()
+
+[somebody]
+exten => s,1,Wait(1)
+	same => n,Progress() ; somebody's phone is ringing!
+	same => n,Wait(${RAND(3,6)}) ; How long until he answers? We don't know.
+	same => n,Set(TIMEOUT(absolute)=7)
+	same => n,Answer()
+	same => n,BackgroundDetect(silence/10,200,500)
+	same => n,UserEvent(DialAnnouncementCaller,Result: Fail,Reason: No Announcement Heard)
+	same => n,Hangup()
+exten => talk,1,UserEvent(DialAnnouncementCaller,Result: Pass)
+	same => n,Hangup()
\ No newline at end of file
diff --git a/tests/apps/dial/dial_announcements/test-config.yaml b/tests/apps/dial/dial_announcements/test-config.yaml
new file mode 100644
index 0000000..be790bd
--- /dev/null
+++ b/tests/apps/dial/dial_announcements/test-config.yaml
@@ -0,0 +1,59 @@
+testinfo:
+    summary: 'Ensure that Dial announcements work as intended.'
+    description: |
+        'This test plays back an announcement to the calling and
+        called parties upon answer and ensures that audio on
+        both sides is detected.'
+
+test-modules:
+    test-object:
+        config-section: test-object-config
+        typename: 'test_case.TestCaseModule'
+    modules:
+        -
+            config-section: caller-originator
+            typename: 'pluggable_modules.Originator'
+        -
+            config-section: hangup-monitor
+            typename: 'pluggable_modules.HangupMonitor'
+        -
+            config-section: ami-config
+            typename: 'ami.AMIEventModule'
+
+test-object-config:
+    connect-ami: True
+
+caller-originator:
+    channel: 'Local/caller at default'
+    context: 'default-side-b'
+    exten: 's'
+    priority: '1'
+    trigger: 'ami_connect'
+
+hangup-monitor:
+    ids: '0'
+
+ami-config:
+    -
+        type: 'headermatch'
+        conditions:
+            match:
+                Event: 'UserEvent'
+                UserEvent: 'DialAnnouncementCaller'
+        requirements:
+            match:
+                Result: 'Pass'
+        count: 2
+
+properties:
+    tags:
+        - dial
+        - apps
+    dependencies:
+        - python: 'twisted'
+        - python: 'starpy'
+        - asterisk: 'app_dial'
+        - asterisk: 'app_userevent'
+        - asterisk: 'func_timeout'
+        - asterisk: 'pbx_config'
+
diff --git a/tests/apps/dial/tests.yaml b/tests/apps/dial/tests.yaml
index 2a7686c..3c356e1 100644
--- a/tests/apps/dial/tests.yaml
+++ b/tests/apps/dial/tests.yaml
@@ -1,5 +1,6 @@
 # Enter tests here in the order they should be considered for execution:
 tests:
+    - test: 'dial_announcements'
     - test: 'dial_answer'
     - test: 'dial_busy'
     - test: 'dial_congestion'

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/15986
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: Id8a136dc4ba771e0aca71e1a3ed3b4b20b406158
Gerrit-Change-Number: 15986
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210602/ef5470a8/attachment-0001.html>


More information about the asterisk-code-review mailing list