uas-subscribe-multipart-notify.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <!DOCTYPE scenario SYSTEM "sipp.dtd">
  3. <!-- This program is free software; you can redistribute it and/or -->
  4. <!-- modify it under the terms of the GNU General Public License as -->
  5. <!-- published by the Free Software Foundation; either version 2 of the -->
  6. <!-- License, or (at your option) any later version. -->
  7. <!-- -->
  8. <!-- This program is distributed in the hope that it will be useful, -->
  9. <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
  10. <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
  11. <!-- GNU General Public License for more details. -->
  12. <!-- -->
  13. <!-- You should have received a copy of the GNU General Public License -->
  14. <!-- along with this program; if not, write to the -->
  15. <!-- Free Software Foundation, Inc., -->
  16. <!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
  17. <!-- -->
  18. <!-- See https://github.com/pjsip/pjproject/issues/1146 -->
  19. <!-- -->
  20. <scenario name="SUBSCRIBE tests">
  21. <!-- Establish subscription -->
  22. <recv request="SUBSCRIBE" crlf="true">
  23. <action>
  24. <ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/>
  25. <ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/>
  26. <assign assign_to="4" variable="5" />
  27. </action>
  28. </recv>
  29. <send>
  30. <![CDATA[
  31. SIP/2.0 200 OK
  32. [last_Via:]
  33. [last_From:]
  34. [last_To:];tag=[call_number]
  35. [last_Call-ID:]
  36. [last_CSeq:]
  37. Contact: <sip:sipp@[local_ip]:[local_port]>
  38. Content-Length: 0
  39. Expires: 60
  40. ]]>
  41. </send>
  42. <send retrans="500">
  43. <![CDATA[
  44. NOTIFY sip:[$5] SIP/2.0
  45. Via: SIP/2.0/[transport] [local_ip]:[local_port];rport;branch=z9hG4bKPj01
  46. From: sipp <sip:sipp@[local_ip]>;tag=[call_number]
  47. To[$3]
  48. Call-ID: [call_id]
  49. Cseq: 1 NOTIFY
  50. Contact: sip:sipp@[local_ip]:[local_port]
  51. Max-Forwards: 70
  52. Event: presence
  53. Subscription-State: active;expires=10
  54. Content-Type: multipart/mixed;boundary=abcd
  55. --abcd
  56. Content-Type: text/plain
  57. Hi there, please don't read this part.
  58. --abcd
  59. Content-Type: application/pidf+xml
  60. <?xml version="1.0" encoding="UTF-8"?>
  61. <presence xmlns="urn:ietf:params:xml:ns:pidf" xmlns:op="urn:oma:xml:prs:pidf:oma-pres" entity="sip:test@pjsip.org">
  62. <tuple id="17415d5738f332a64a2f1d8cfb4ab0a5">
  63. <status>
  64. <basic>open</basic>
  65. </status>
  66. </tuple>
  67. </presence>
  68. --abcd--
  69. ]]>
  70. </send>
  71. <recv response="200">
  72. </recv>
  73. <!-- Subscription has been established at this point -->
  74. <!-- *******
  75. Wait for subscription refresh, reply with 481
  76. -->
  77. <recv request="SUBSCRIBE" crlf="true">
  78. </recv>
  79. <send>
  80. <![CDATA[
  81. SIP/2.0 481 You should resubscribe mow
  82. [last_Via:]
  83. [last_From:]
  84. [last_To:];tag=[call_number]
  85. [last_Call-ID:]
  86. [last_CSeq:]
  87. Contact: <sip:sipp@[local_ip]:[local_port]>
  88. Content-Length: 0
  89. ]]>
  90. </send>
  91. <!-- definition of the response time repartition table (unit is ms) -->
  92. <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
  93. <!-- definition of the call length repartition table (unit is ms) -->
  94. <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
  95. </scenario>