Index: tests/channels/SIP/timers/uac_minimum_se/test-config.yaml
===================================================================
--- tests/channels/SIP/timers/uac_minimum_se/test-config.yaml	(revision 0)
+++ tests/channels/SIP/timers/uac_minimum_se/test-config.yaml	(revision 0)
@@ -0,0 +1,33 @@
+testinfo:
+    summary:     'Minimum RFC4028-mandated Session-Expires value test (outbound UAS immediate BYE)'
+    description: |
+        "This test verifies that outbound calls providing Session-Expires values in 200 OK messages that are outside RFC4028 limits are immediately torn down."
+
+properties:
+    minversion: '1.8.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - custom : 'ipv6'
+        - app : 'sipp'
+    tags:
+        - SIP
+        - timers
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            typename: 'originator.Originator'
+
+sipp-config:
+    reactor-timeout: 40
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uas-no-hangup.xml', '-p': '5066', '-send_timeout': '5000', '-recv_timeout': '5000', '-timeout': '30000'},
+                    'ordered-args': ['-timeout_error'] }
Index: tests/channels/SIP/timers/uac_minimum_se/originator.py
===================================================================
--- tests/channels/SIP/timers/uac_minimum_se/originator.py	(revision 0)
+++ tests/channels/SIP/timers/uac_minimum_se/originator.py	(revision 0)
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+'''
+Copyright (C) 2012, Digium, Inc.
+Mark Michelson <mmichelson@digium.com>
+
+This program is free software, distributed under the terms of
+the GNU General Public License Version 2.
+'''
+
+import sys
+import logging
+
+sys.path.append("lib/python")
+
+LOGGER = logging.getLogger(__name__)
+
+class Originator(object):
+    def __init__(self, module_config, test_object):
+        self.ami = None
+        test_object.register_ami_observer(self.ami_connect)
+        test_object.register_scenario_started_observer(self.scenario_started)
+        self.test_object = test_object
+        self.current_destination = 0
+        return
+
+    def ami_connect(self, ami):
+        LOGGER.info("AMI connected")
+        self.ami = ami
+        return
+
+    def success(self, result):
+        LOGGER.info("Originate Successful")
+        return result
+
+    def originate_call(self):
+
+        LOGGER.info("Originating call")
+
+        self.ami.originate(channel = 'Local/s@default',
+                application = 'Echo').addCallback(self.success)
+
+    def scenario_started(self, result):
+        def failure(result):
+            self.test_object.set_passed(False)
+            return result
+
+        self.originate_call()
+        return result
Index: tests/channels/SIP/timers/uac_minimum_se/configs/ast1/sip.conf
===================================================================
--- tests/channels/SIP/timers/uac_minimum_se/configs/ast1/sip.conf	(revision 0)
+++ tests/channels/SIP/timers/uac_minimum_se/configs/ast1/sip.conf	(revision 0)
@@ -0,0 +1,13 @@
+[general]
+canreinvite=no
+
+[endpoint]
+context=default
+type=friend
+host=127.0.0.1
+port=5066
+insecure=invite
+disallow=all
+allow=ulaw
+session-timers=accept
+session-refresher=uas
Index: tests/channels/SIP/timers/uac_minimum_se/configs/ast1/extensions.conf
===================================================================
--- tests/channels/SIP/timers/uac_minimum_se/configs/ast1/extensions.conf	(revision 0)
+++ tests/channels/SIP/timers/uac_minimum_se/configs/ast1/extensions.conf	(revision 0)
@@ -0,0 +1,2 @@
+[default]
+exten => s,1,Dial(sip/endpoint)
Index: tests/channels/SIP/timers/uac_minimum_se/sipp/uas-no-hangup.xml
===================================================================
--- tests/channels/SIP/timers/uac_minimum_se/sipp/uas-no-hangup.xml	(revision 0)
+++ tests/channels/SIP/timers/uac_minimum_se/sipp/uas-no-hangup.xml	(revision 0)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- This program is free software; you can redistribute it and/or      -->
+<!-- modify it under the terms of the GNU General Public License as     -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version.                    -->
+<!--                                                                    -->
+<!-- This program is distributed in the hope that it will be useful,    -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
+<!-- GNU General Public License for more details.                       -->
+<!--                                                                    -->
+<!-- You should have received a copy of the GNU General Public License  -->
+<!-- along with this program; if not, write to the                      -->
+<!-- Free Software Foundation, Inc.,                                    -->
+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="UAS for timer testing">
+  <Global variables="remote_tag" />
+  <recv request="INVITE" crlf="true">
+      <!-- Save the from tag. We'll need it when we send our BYE -->
+      <action>
+          <ereg regexp=".*timer.*"
+              header="Supported:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="1"/>
+          <ereg regexp=".*(;tag=.*)"
+              header="From:"
+              search_in="hdr"
+              check_it="true"
+              assign_to="remote_tag"/>
+      </action>
+  </recv>
+  <Reference variables="1" />
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 180 Ringing
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Require: timer
+      Session-Expires: 80;refresher=uas
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv request="ACK"
+        rtd="true"
+        crlf="true" />
+
+  <!-- Expect a BYE immediately since Session-Expires is invalid -->
+  <recv request="BYE"
+        rtd="true"
+        crlf="true" />
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[pid]SIPpTag01[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: <sip:[local_ip]:[local_port];transport=[transport]>
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
Index: tests/channels/SIP/timers/uas_minimum_se/test-config.yaml
===================================================================
--- tests/channels/SIP/timers/uas_minimum_se/test-config.yaml	(revision 0)
+++ tests/channels/SIP/timers/uas_minimum_se/test-config.yaml	(revision 0)
@@ -0,0 +1,28 @@
+testinfo:
+    summary:     'Minimum RFC4028-mandated Session-Expires value test (inbound UAC 422)'
+    description: |
+        "This test verifies that Asterisk will reject an incoming INVITE with a 422 if the Session-Expires value is below 90."
+
+properties:
+    minversion: '1.8.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - custom : 'ipv6'
+        - app : 'sipp'
+    tags:
+        - SIP
+        - timers
+
+test-modules:
+    add-test-to-search-path: 'True'
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+
+sipp-config:
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'uac-no-hangup.xml', '-p': '5066'} }
Index: tests/channels/SIP/timers/uas_minimum_se/configs/ast1/sip.conf
===================================================================
--- tests/channels/SIP/timers/uas_minimum_se/configs/ast1/sip.conf	(revision 0)
+++ tests/channels/SIP/timers/uas_minimum_se/configs/ast1/sip.conf	(revision 0)
@@ -0,0 +1,13 @@
+[general]
+canreinvite=no
+
+[endpoint]
+context=default
+type=friend
+host=127.0.0.1
+port=5066
+insecure=invite
+disallow=all
+allow=ulaw
+session-timers=accept
+session-refresher=uas
Index: tests/channels/SIP/timers/uas_minimum_se/configs/ast1/extensions.conf
===================================================================
--- tests/channels/SIP/timers/uas_minimum_se/configs/ast1/extensions.conf	(revision 0)
+++ tests/channels/SIP/timers/uas_minimum_se/configs/ast1/extensions.conf	(revision 0)
@@ -0,0 +1,4 @@
+[default]
+exten => endpoint,1,NoOp()
+exten => endpoint,n,Answer()
+exten => endpoint,n,Echo()
Index: tests/channels/SIP/timers/uas_minimum_se/sipp/uac-no-hangup.xml
===================================================================
--- tests/channels/SIP/timers/uas_minimum_se/sipp/uac-no-hangup.xml	(revision 0)
+++ tests/channels/SIP/timers/uas_minimum_se/sipp/uac-no-hangup.xml	(revision 0)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- This program is free software; you can redistribute it and/or      -->
+<!-- modify it under the terms of the GNU General Public License as     -->
+<!-- published by the Free Software Foundation; either version 2 of the -->
+<!-- License, or (at your option) any later version.                    -->
+<!--                                                                    -->
+<!-- This program is distributed in the hope that it will be useful,    -->
+<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of     -->
+<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the      -->
+<!-- GNU General Public License for more details.                       -->
+<!--                                                                    -->
+<!-- You should have received a copy of the GNU General Public License  -->
+<!-- along with this program; if not, write to the                      -->
+<!-- Free Software Foundation, Inc.,                                    -->
+<!-- 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="UAC for timer testing">
+  <send retrans="500">
+    <![CDATA[
+
+      INVITE sip:endpoint@[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
+      To: sut <sip:[service]@[remote_ip]:[remote_port]>
+      Call-ID: [call_id]
+      CSeq: 1 INVITE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Supported: timer
+      Session-Expires: 80;refresher=uac
+      Content-Type: application/sdp
+      Content-Length: [len]
+
+      v=0
+      o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
+      s=-
+      c=IN IP[media_ip_type] [media_ip]
+      t=0 0
+      m=audio [media_port] RTP/AVP 0
+      a=rtpmap:0 PCMU/8000
+
+    ]]>
+  </send>
+
+  <recv response="422" />
+
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+
