171_timer_initiated_by_uas.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. sdp = \
  4. """
  5. v=0
  6. o=- 0 0 IN IP4 127.0.0.1
  7. s=pjmedia
  8. c=IN IP4 127.0.0.1
  9. t=0 0
  10. m=audio 4000 RTP/AVP 0 101
  11. a=rtpmap:0 PCMU/8000
  12. a=sendrecv
  13. a=rtpmap:101 telephone-event/8000
  14. a=fmtp:101 0-15
  15. """
  16. # RFC 4028 Section 9:
  17. # If the incoming request contains a Supported header field with a
  18. # value 'timer' but does not contain a Session-Expires header, it means
  19. # that the UAS is indicating support for timers but is not requesting
  20. # one. The UAS may request a session timer in the 2XX response by
  21. # including a Session-Expires header field. The value MUST NOT be set
  22. # to a duration lower than the value in the Min-SE header field in the
  23. # request, if it is present.
  24. pjsua_args = "--null-audio --auto-answer 200 --use-timer 2 --timer-min-se 90 --timer-se 1800"
  25. extra_headers = "Supported: timer\n"
  26. include = ["Session-Expires: .*;refresher=.*"]
  27. exclude = []
  28. sendto_cfg = sip.SendtoCfg("Session Timer initiated by UAS", pjsua_args, sdp, 200,
  29. extra_headers=extra_headers,
  30. resp_inc=include, resp_exc=exclude)