<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/testsuite/+/19538">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span></span><br></pre><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_aoc: Tests for AOC-D, AOC-E, AOC-S<br><br>Also enable AMIPluggableActionModule to deal with a list of AMI headers<br>so that multiple of the same field can be supplied. AOC-S needs this,<br>but the Originate action also accepts multiple Variable headers.<br><br>ASTERISK-21502<br><br>Change-Id: I061a250b477593c4f07441a3d811e9981feb17b2<br>---<br>M configs/manager.conf<br>M lib/python/asterisk/ami.py<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/sipp/callee.xml<br>A tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/test-config.yaml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/extensions.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/pjsip.conf<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/sipp/caller.xml<br>A tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/test-config.yaml<br>A tests/channels/pjsip/aoc/tests.yaml<br>M tests/channels/pjsip/tests.yaml<br>64 files changed, 2,811 insertions(+), 1 deletion(-)<br><br></pre>
<pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configs/manager.conf b/configs/manager.conf</span><br><span>index 993c8da..09cf8de 100644</span><br><span>--- a/configs/manager.conf</span><br><span>+++ b/configs/manager.conf</span><br><span>@@ -9,6 +9,6 @@</span><br><span> [user]</span><br><span> secret = mysecret</span><br><span> read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,test,agi</span><br><span style="color: hsl(0, 100%, 40%);">-write = system,call,agent,user,config,command,reporting,originate,agi,message</span><br><span style="color: hsl(120, 100%, 40%);">+write = system,call,agent,user,config,command,reporting,originate,agi,message,aoc</span><br><span> </span><br><span> #include "manager.users.conf.inc"</span><br><span>diff --git a/lib/python/asterisk/ami.py b/lib/python/asterisk/ami.py</span><br><span>index 2e0fe4e..649d0c2 100644</span><br><span>--- a/lib/python/asterisk/ami.py</span><br><span>+++ b/lib/python/asterisk/ami.py</span><br><span>@@ -827,6 +827,13 @@</span><br><span> </span><br><span> </span><br><span> def replace_ami_vars(mydict, values):</span><br><span style="color: hsl(120, 100%, 40%);">+ if type(mydict) is list:</span><br><span style="color: hsl(120, 100%, 40%);">+ outlist = []</span><br><span style="color: hsl(120, 100%, 40%);">+ for item in mydict:</span><br><span style="color: hsl(120, 100%, 40%);">+ for key, value in item.items():</span><br><span style="color: hsl(120, 100%, 40%);">+ outlist.append((key, var_replace(value, values)))</span><br><span style="color: hsl(120, 100%, 40%);">+ return outlist</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> outdict = {}</span><br><span> for key, value in mydict.items():</span><br><span> outdict[key] = var_replace(value, values)</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..4dc58e3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/sipp/callee.xml</span><br><span>@@ -0,0 +1,101 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on inbound call hung up by us"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: callee <sip:callee@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To:[$remote_tag]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>total</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.314</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..d291cc3</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_200/test-config.yaml</span><br><span>@@ -0,0 +1,68 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to callee who hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 200 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the callee's BYE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Currency'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 314</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..f7b9b0e</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..2892cf6</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/sipp/callee.xml</span><br><span>@@ -0,0 +1,98 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on inbound call hung up by the other side"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>total</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <free-charge /></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..198dc03</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_bye/test-config.yaml</span><br><span>@@ -0,0 +1,76 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to callee after caller hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the BYE message sent to the callee.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Free'</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Hangup'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..13d8eaa</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/sipp/callee.xml</span><br><span>@@ -0,0 +1,100 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on inbound call"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>subtotal</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.042</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: callee <sip:callee@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To:[$remote_tag]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..ccab6b4</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_callee_in_info/test-config.yaml</span><br><span>@@ -0,0 +1,68 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, generating a SIP INFO message sent to the</span><br><span style="color: hsl(120, 100%, 40%);">+ callee.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Currency'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 42</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..2cfdc28</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/sipp/caller.xml</span><br><span>@@ -0,0 +1,100 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on outbound call hung up by us"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>total</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>UNIT</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>314</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..da5c429</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_200/test-config.yaml</span><br><span>@@ -0,0 +1,52 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to caller who hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 200 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the caller's BYE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Unit'</span><br><span style="color: hsl(120, 100%, 40%);">+ 'UnitAmount(0)': 314</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..f7b9b0e</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..d96dcc4</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/sipp/caller.xml</span><br><span>@@ -0,0 +1,98 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on outbound call hung up by the other side"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>total</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.3</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..270a7ba</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_bye/test-config.yaml</span><br><span>@@ -0,0 +1,67 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to caller after callee hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the BYE message sent to the caller'.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Currency'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 3</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneTenth'</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Success'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Hangup'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..9461260</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/sipp/caller.xml</span><br><span>@@ -0,0 +1,97 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-D on outbound call"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-info>subtotal</charging-info></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <free-charge /></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-d></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/test-config.yaml b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..e406cd6</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_d_to_caller_in_info/test-config.yaml</span><br><span>@@ -0,0 +1,51 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-D to caller'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-D</span><br><span style="color: hsl(120, 100%, 40%);">+ event, generating a SIP INFO message sent to the</span><br><span style="color: hsl(120, 100%, 40%);">+ caller.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'D'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Free'</span><br><span style="color: hsl(120, 100%, 40%);">+ TotalType: 'SubTotal'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..c5b2013</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/sipp/callee.xml</span><br><span>@@ -0,0 +1,86 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-E on inbound call hung up by us"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <pause milliseconds="2000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: callee <sip:callee@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To:[$remote_tag]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.314</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/test-config.yaml b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..a3fc31c</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_200/test-config.yaml</span><br><span>@@ -0,0 +1,67 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-E to callee who hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-E</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 200 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the callee's BYE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'E'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Currency'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 314</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..f7b9b0e</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..8a24ec7</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/sipp/callee.xml</span><br><span>@@ -0,0 +1,81 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-E on inbound call hung up by the other side"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <free-charge /></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>\ No newline at end of file</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/test-config.yaml b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..3d98952</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_callee_in_bye/test-config.yaml</span><br><span>@@ -0,0 +1,75 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-E to callee after caller hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-E</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the BYE message sent to the callee.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'E'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Free'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Hangup'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..1357fc9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/sipp/caller.xml</span><br><span>@@ -0,0 +1,85 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-E on outbound call hung up by us"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <pause milliseconds="2000"/></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>UNIT</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>314</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/test-config.yaml b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..7fd2076</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_200/test-config.yaml</span><br><span>@@ -0,0 +1,51 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-E to caller who hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-E</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 200 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the caller's BYE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'E'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Unit'</span><br><span style="color: hsl(120, 100%, 40%);">+ 'UnitAmount(0)': 314</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..f7b9b0e</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..7da0a3c</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/sipp/caller.xml</span><br><span>@@ -0,0 +1,81 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-E on outbound call hung up by the other side"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="BYE"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ <recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.3</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-currency-units></span><br><span style="color: hsl(120, 100%, 40%);">+ </recorded-charges></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-e></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/test-config.yaml b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..c18e939</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_e_to_caller_in_bye/test-config.yaml</span><br><span>@@ -0,0 +1,66 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-E to caller after callee hangs up'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-E</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the BYE message sent to the caller'.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'E'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargeType: 'Currency'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 3</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneTenth'</span><br><span style="color: hsl(120, 100%, 40%);">+ expected:</span><br><span style="color: hsl(120, 100%, 40%);">+ Response: 'Success'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Hangup'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..e7065cc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=callee</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[callee]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:callee@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/sipp/callee.xml b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/sipp/callee.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..9501896</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/sipp/callee.xml</span><br><span>@@ -0,0 +1,106 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-S on inbound call"></span><br><span style="color: hsl(120, 100%, 40%);">+ <Global variables="remote_tag" /></span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INVITE" crlf="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ <!-- Save the from tag. We'll need it when we send our BYE --></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp=".*(;tag=.*)"</span><br><span style="color: hsl(120, 100%, 40%);">+ header="From:"</span><br><span style="color: hsl(120, 100%, 40%);">+ search_in="hdr"</span><br><span style="color: hsl(120, 100%, 40%);">+ check_it="true"</span><br><span style="color: hsl(120, 100%, 40%);">+ assign_to="remote_tag"/></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 180 Ringing</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:];tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_CSeq:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio [media_port] RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="ACK" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+ <charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ <basic></span><br><span style="color: hsl(120, 100%, 40%);">+ <price-time></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>1\.337</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ <length-time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <time-unit>1</time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <scale>one-hour</scale></span><br><span style="color: hsl(120, 100%, 40%);">+ </length-time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-type>step-function</charging-type></span><br><span style="color: hsl(120, 100%, 40%);">+ </price-time></span><br><span style="color: hsl(120, 100%, 40%);">+ </basic></span><br><span style="color: hsl(120, 100%, 40%);">+ </charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: callee <sip:callee@[local_ip]:[local_port]>;tag=[pid]SIPpTag01[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To:[$remote_tag]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Call-ID:]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/test-config.yaml b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..83cc2e9</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_callee_in_info/test-config.yaml</span><br><span>@@ -0,0 +1,71 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-S to callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-S</span><br><span style="color: hsl(120, 100%, 40%);">+ event, generating a SIP INFO message sent to the</span><br><span style="color: hsl(120, 100%, 40%);">+ callee.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'callee.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'FullyBooted'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'Originate'</span><br><span style="color: hsl(120, 100%, 40%);">+ ActionID: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee'</span><br><span style="color: hsl(120, 100%, 40%);">+ Exten: 'echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ Context: 'default'</span><br><span style="color: hsl(120, 100%, 40%);">+ Priority: '1'</span><br><span style="color: hsl(120, 100%, 40%);">+ CallerID: 'echo <echo>'</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/callee-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Echo'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'S'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargedItem: 'BasicCommunication'</span><br><span style="color: hsl(120, 100%, 40%);">+ RateType: 'Duration'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 1337</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+ TimeScale: 'Hour'</span><br><span style="color: hsl(120, 100%, 40%);">+ Time: 1</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargingType: 'StepFunction'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..6a08c91</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Ringing()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..5098af0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/sipp/caller.xml</span><br><span>@@ -0,0 +1,85 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-S on outbound call with ringing"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="multipart/mixed" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" search_in="body" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+ <charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ <basic></span><br><span style="color: hsl(120, 100%, 40%);">+ <free-charge /></span><br><span style="color: hsl(120, 100%, 40%);">+ </basic></span><br><span style="color: hsl(120, 100%, 40%);">+ </charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/test-config.yaml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..a304067</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_180/test-config.yaml</span><br><span>@@ -0,0 +1,51 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-S to caller in ringing'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-S</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 180 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the caller's INVITE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'S'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargedItem: 'BasicCommunication'</span><br><span style="color: hsl(120, 100%, 40%);">+ RateType: 'Free'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..ec6d21d</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,5 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Progress()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..1a055fa</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/sipp/caller.xml</span><br><span>@@ -0,0 +1,88 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-S on outbound with early media"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="multipart/mixed" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" search_in="body" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+ <charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ <basic></span><br><span style="color: hsl(120, 100%, 40%);">+ <flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>1\.337</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ </basic></span><br><span style="color: hsl(120, 100%, 40%);">+ </charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" rtd="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/test-config.yaml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..13f8fbd</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_183/test-config.yaml</span><br><span>@@ -0,0 +1,54 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-S to caller in early media'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-S</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 183 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the caller's INVITE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'S'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargedItem: 'BasicCommunication'</span><br><span style="color: hsl(120, 100%, 40%);">+ RateType: 'Flat'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 1337</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..045b637</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,4 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Wait(2)</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..7bd5edc</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/sipp/caller.xml</span><br><span>@@ -0,0 +1,88 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-S on outbound call"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="multipart/mixed" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" search_in="body" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+ <charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ <communication-attempt></span><br><span style="color: hsl(120, 100%, 40%);">+ <flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>EUR</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>1\.337</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ </communication-attempt></span><br><span style="color: hsl(120, 100%, 40%);">+ </charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/test-config.yaml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..97ecb04</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_200/test-config.yaml</span><br><span>@@ -0,0 +1,54 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-S to caller in answer'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-S</span><br><span style="color: hsl(120, 100%, 40%);">+ event, adding to the 200 message sent in reply to</span><br><span style="color: hsl(120, 100%, 40%);">+ the caller's INVITE message.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Wait'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ MsgType: 'S'</span><br><span style="color: hsl(120, 100%, 40%);">+ ChargedItem: 'CallAttempt'</span><br><span style="color: hsl(120, 100%, 40%);">+ RateType: 'Flat'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyAmount: 1337</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyName: 'EUR'</span><br><span style="color: hsl(120, 100%, 40%);">+ CurrencyMultiplier: 'OneThousandth'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/extensions.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/extensions.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..af317af</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/extensions.conf</span><br><span>@@ -0,0 +1,3 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[default]</span><br><span style="color: hsl(120, 100%, 40%);">+exten => echo,1,Answer()</span><br><span style="color: hsl(120, 100%, 40%);">+same => n,Echo()</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/pjsip.conf b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/pjsip.conf</span><br><span>new file mode 100644</span><br><span>index 0000000..feb5ba0</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/configs/ast1/pjsip.conf</span><br><span>@@ -0,0 +1,25 @@</span><br><span style="color: hsl(120, 100%, 40%);">+[system]</span><br><span style="color: hsl(120, 100%, 40%);">+type=system</span><br><span style="color: hsl(120, 100%, 40%);">+timer_t1=100</span><br><span style="color: hsl(120, 100%, 40%);">+timer_b=6400</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[local-transport-udp]</span><br><span style="color: hsl(120, 100%, 40%);">+type=transport</span><br><span style="color: hsl(120, 100%, 40%);">+bind=127.0.0.1</span><br><span style="color: hsl(120, 100%, 40%);">+protocol=udp</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=endpoint</span><br><span style="color: hsl(120, 100%, 40%);">+aors=caller</span><br><span style="color: hsl(120, 100%, 40%);">+context=default</span><br><span style="color: hsl(120, 100%, 40%);">+allow=!all,ulaw</span><br><span style="color: hsl(120, 100%, 40%);">+rewrite_contact=yes</span><br><span style="color: hsl(120, 100%, 40%);">+direct_media=no</span><br><span style="color: hsl(120, 100%, 40%);">+send_aoc=yes</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[caller]</span><br><span style="color: hsl(120, 100%, 40%);">+type=aor</span><br><span style="color: hsl(120, 100%, 40%);">+max_contacts=1</span><br><span style="color: hsl(120, 100%, 40%);">+minimum_expiration=5</span><br><span style="color: hsl(120, 100%, 40%);">+default_expiration=30</span><br><span style="color: hsl(120, 100%, 40%);">+contact=sip:caller@127.0.0.1:5062</span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/sipp/caller.xml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/sipp/caller.xml</span><br><span>new file mode 100644</span><br><span>index 0000000..1a9ea05</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/sipp/caller.xml</span><br><span>@@ -0,0 +1,114 @@</span><br><span style="color: hsl(120, 100%, 40%);">+<?xml version="1.0" encoding="ISO-8859-1" ?></span><br><span style="color: hsl(120, 100%, 40%);">+<!DOCTYPE scenario SYSTEM "sipp.dtd"></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+<scenario name="Receive AOC-S on outbound call after answer"></span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ INVITE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]></span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 INVITE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Type: application/sdp</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: [len]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ v=0</span><br><span style="color: hsl(120, 100%, 40%);">+ o=phoneA 53655765 2353687637 IN IP[local_ip_type] [local_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ s=-</span><br><span style="color: hsl(120, 100%, 40%);">+ c=IN IP[media_ip_type] [media_ip]</span><br><span style="color: hsl(120, 100%, 40%);">+ t=0 0</span><br><span style="color: hsl(120, 100%, 40%);">+ m=audio 6000 RTP/AVP 0</span><br><span style="color: hsl(120, 100%, 40%);">+ a=rtpmap:0 PCMU/8000</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="100" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="180" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="183" optional="true"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200"></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ ACK sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:caller@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 1 ACK</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv request="INFO"></span><br><span style="color: hsl(120, 100%, 40%);">+ <action></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="application/vnd.etsi\.aoc\+xml" header="Content-Type:" search_in="hdr" check_it="true" assign_to="_"/></span><br><span style="color: hsl(120, 100%, 40%);">+ <ereg regexp="<\?xml version="1\.0" encoding="UTF-8"\?></span><br><span style="color: hsl(120, 100%, 40%);">+<aoc xmlns="http://uri\.etsi\.org/ngn/params/xml/simservs/aoc"></span><br><span style="color: hsl(120, 100%, 40%);">+ <aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+ <charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ <basic></span><br><span style="color: hsl(120, 100%, 40%);">+ <price-time></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>UNIT</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>133\.7</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ <length-time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <time-unit>10</time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <scale>one-minute</scale></span><br><span style="color: hsl(120, 100%, 40%);">+ </length-time-unit></span><br><span style="color: hsl(120, 100%, 40%);">+ <charging-type>continuous</charging-type></span><br><span style="color: hsl(120, 100%, 40%);">+ </price-time></span><br><span style="color: hsl(120, 100%, 40%);">+ </basic></span><br><span style="color: hsl(120, 100%, 40%);">+ <communication-attempt></span><br><span style="color: hsl(120, 100%, 40%);">+ <flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-id>UNIT</currency-id></span><br><span style="color: hsl(120, 100%, 40%);">+ <currency-amount>0\.42</currency-amount></span><br><span style="color: hsl(120, 100%, 40%);">+ </flat-rate></span><br><span style="color: hsl(120, 100%, 40%);">+ </communication-attempt></span><br><span style="color: hsl(120, 100%, 40%);">+ </charged-items></span><br><span style="color: hsl(120, 100%, 40%);">+ </aoc-s></span><br><span style="color: hsl(120, 100%, 40%);">+</aoc>" check_it="true" search_in="body" assign_to="_" /></span><br><span style="color: hsl(120, 100%, 40%);">+ </action></span><br><span style="color: hsl(120, 100%, 40%);">+ </recv></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <send></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ SIP/2.0 200 OK</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_Via:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_From:]</span><br><span style="color: hsl(120, 100%, 40%);">+ [last_To:]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: [cseq] INFO</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:user1@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ <send retrans="500"></span><br><span style="color: hsl(120, 100%, 40%);">+ <![CDATA[</span><br><span style="color: hsl(120, 100%, 40%);">+ BYE sip:echo@[remote_ip]:[remote_port] SIP/2.0</span><br><span style="color: hsl(120, 100%, 40%);">+ Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]</span><br><span style="color: hsl(120, 100%, 40%);">+ From: caller <sip:[service]@[local_ip]:[local_port]>;tag=[call_number]</span><br><span style="color: hsl(120, 100%, 40%);">+ To: echo <sip:echo@[remote_ip]:[remote_port]>[peer_tag_param]</span><br><span style="color: hsl(120, 100%, 40%);">+ Call-ID: [call_id]</span><br><span style="color: hsl(120, 100%, 40%);">+ CSeq: 2 BYE</span><br><span style="color: hsl(120, 100%, 40%);">+ Contact: <sip:caller@[local_ip]:[local_port];transport=[transport]></span><br><span style="color: hsl(120, 100%, 40%);">+ Max-Forwards: 70</span><br><span style="color: hsl(120, 100%, 40%);">+ Subject: Test</span><br><span style="color: hsl(120, 100%, 40%);">+ Content-Length: 0</span><br><span style="color: hsl(120, 100%, 40%);">+ ]]></span><br><span style="color: hsl(120, 100%, 40%);">+ </send></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ <recv response="200" /></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</scenario></span><br><span>diff --git a/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/test-config.yaml b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/test-config.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..897fd63</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/aoc_s_to_caller_in_info/test-config.yaml</span><br><span>@@ -0,0 +1,62 @@</span><br><span style="color: hsl(120, 100%, 40%);">+info:</span><br><span style="color: hsl(120, 100%, 40%);">+ summary: 'Test AOC-S to caller after answer'</span><br><span style="color: hsl(120, 100%, 40%);">+ description: |</span><br><span style="color: hsl(120, 100%, 40%);">+ This uses an AOCMessage AMI to generate an AOC-S</span><br><span style="color: hsl(120, 100%, 40%);">+ event, generating a SIP INFO message sent to the</span><br><span style="color: hsl(120, 100%, 40%);">+ caller.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ test-object:</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: test-object-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: sipp.SIPpTestCase</span><br><span style="color: hsl(120, 100%, 40%);">+ modules:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ config-section: ami-config</span><br><span style="color: hsl(120, 100%, 40%);">+ typename: 'pluggable_modules.EventActionModule'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+test-object-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ memcheck-delay-stop: 7</span><br><span style="color: hsl(120, 100%, 40%);">+ fail-on-any: True</span><br><span style="color: hsl(120, 100%, 40%);">+ test-iterations:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ scenarios:</span><br><span style="color: hsl(120, 100%, 40%);">+ - { 'key-args': { 'scenario': 'caller.xml', '-i': '127.0.0.1', '-p': '5062' } }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ami-config:</span><br><span style="color: hsl(120, 100%, 40%);">+ -</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-events:</span><br><span style="color: hsl(120, 100%, 40%);">+ type: 'headermatch'</span><br><span style="color: hsl(120, 100%, 40%);">+ conditions:</span><br><span style="color: hsl(120, 100%, 40%);">+ match:</span><br><span style="color: hsl(120, 100%, 40%);">+ Event: 'Newexten'</span><br><span style="color: hsl(120, 100%, 40%);">+ Channel: 'PJSIP/caller-.*'</span><br><span style="color: hsl(120, 100%, 40%);">+ Application: 'Answer'</span><br><span style="color: hsl(120, 100%, 40%);">+ ami-actions:</span><br><span style="color: hsl(120, 100%, 40%);">+ action:</span><br><span style="color: hsl(120, 100%, 40%);">+ - Action: 'AOCMessage'</span><br><span style="color: hsl(120, 100%, 40%);">+ - Channel: '{channel}'</span><br><span style="color: hsl(120, 100%, 40%);">+ - MsgType: 'S'</span><br><span style="color: hsl(120, 100%, 40%);">+ - ChargedItem: 'BasicCommunication'</span><br><span style="color: hsl(120, 100%, 40%);">+ - RateType: 'Duration'</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyAmount: 1337</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyName: 'UNIT'</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyMultiplier: 'OneTenth'</span><br><span style="color: hsl(120, 100%, 40%);">+ - TimeScale: 'Minute'</span><br><span style="color: hsl(120, 100%, 40%);">+ - Time: 10</span><br><span style="color: hsl(120, 100%, 40%);">+ - ChargingType: 'ContinuousCharging'</span><br><span style="color: hsl(120, 100%, 40%);">+ - ChargedItem: 'CallAttempt'</span><br><span style="color: hsl(120, 100%, 40%);">+ - RateType: 'Flat'</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyAmount: 42</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyName: 'UNIT'</span><br><span style="color: hsl(120, 100%, 40%);">+ - CurrencyMultiplier: 'OneHundredth'</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+properties:</span><br><span style="color: hsl(120, 100%, 40%);">+ dependencies:</span><br><span style="color: hsl(120, 100%, 40%);">+ - sipp :</span><br><span style="color: hsl(120, 100%, 40%);">+ version : 'v3.0'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'chan_pjsip'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'res_pjsip_aoc'</span><br><span style="color: hsl(120, 100%, 40%);">+ - asterisk : 'app_dial'</span><br><span style="color: hsl(120, 100%, 40%);">+ tags:</span><br><span style="color: hsl(120, 100%, 40%);">+ - PJSIP</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/tests/channels/pjsip/aoc/tests.yaml b/tests/channels/pjsip/aoc/tests.yaml</span><br><span>new file mode 100644</span><br><span>index 0000000..a418077</span><br><span>--- /dev/null</span><br><span>+++ b/tests/channels/pjsip/aoc/tests.yaml</span><br><span>@@ -0,0 +1,17 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# Enter tests here in the order they should be considered for execution:</span><br><span style="color: hsl(120, 100%, 40%);">+tests:</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_callee_in_200'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_callee_in_bye'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_callee_in_info'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_caller_in_200'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_caller_in_bye'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_d_to_caller_in_info'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_e_to_callee_in_200'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_e_to_callee_in_bye'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_e_to_caller_in_200'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_e_to_caller_in_bye'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_s_to_callee_in_info'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_s_to_caller_in_180'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_s_to_caller_in_183'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_s_to_caller_in_200'</span><br><span style="color: hsl(120, 100%, 40%);">+ - test: 'aoc_s_to_caller_in_info'</span><br><span>diff --git a/tests/channels/pjsip/tests.yaml b/tests/channels/pjsip/tests.yaml</span><br><span>index 92fbf5f..3ae1bb2 100644</span><br><span>--- a/tests/channels/pjsip/tests.yaml</span><br><span>+++ b/tests/channels/pjsip/tests.yaml</span><br><span>@@ -2,6 +2,7 @@</span><br><span> tests:</span><br><span> - dir: 'allow_sending_180_after_183'</span><br><span> - dir: 'ami'</span><br><span style="color: hsl(120, 100%, 40%);">+ - dir: 'aoc'</span><br><span> - dir: 'auth'</span><br><span> - dir: 'basic_calls'</span><br><span> - dir: 'config_wizard'</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/testsuite/+/19538">change 19538</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/testsuite/+/19538"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: testsuite </div>
<div style="display:none"> Gerrit-Branch: 20 </div>
<div style="display:none"> Gerrit-Change-Id: I061a250b477593c4f07441a3d811e9981feb17b2 </div>
<div style="display:none"> Gerrit-Change-Number: 19538 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Michael Kuron <m.kuron@gmx.de> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>