110_tel_uri.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import inc_sip as sip
  2. import inc_sdp as sdp
  3. # Handling of incoming tel: URI.
  4. complete_msg = \
  5. """INVITE tel:+2065551212 SIP/2.0
  6. Via: SIP/2.0/UDP $LOCAL_IP:$LOCAL_PORT;rport;x-route-tag="tgrp:cococisco1";branch=z9hG4bK61E05
  7. From: <tel:12345>$FROM_TAG
  8. To: <tel:+2065551212>
  9. Date: Thu, 12 Feb 2009 18:32:33 GMT
  10. Call-ID: 58F8F7D6-F86A11DD-8013D591-5694EF79
  11. Supported: 100rel,timer,resource-priority
  12. Min-SE: 86400
  13. Cisco-Guid: 1492551325-4167700957-2148586897-1452601209
  14. User-Agent: Cisco-SIPGateway/IOS-12.x
  15. Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, UPDATE, REFER, SUBSCRIBE, NOTIFY, INFO, REGISTER
  16. CSeq: 101 INVITE
  17. Max-Forwards: 70
  18. Timestamp: 1234463553
  19. Contact: <tel:+1234;ext=1>
  20. Contact: <sip:tester@$LOCAL_IP:$LOCAL_PORT>
  21. Record-Route: <sip:tester@$LOCAL_IP:$LOCAL_PORT;lr>
  22. Expires: 180
  23. Allow-Events: telephone-event
  24. Content-Type: application/sdp
  25. Content-Disposition: session;handling=required
  26. Content-Length: 265
  27. v=0
  28. o=CiscoSystemsSIP-GW-UserAgent 1296 9529 IN IP4 X.X.X.X
  29. s=SIP Call
  30. c=IN IP4 $LOCAL_IP
  31. t=0 0
  32. m=audio 18676 RTP/AVP 0 101 19
  33. c=IN IP4 $LOCAL_IP
  34. a=rtpmap:0 PCMU/8000
  35. a=rtpmap:101 telephone-event/8000
  36. a=fmtp:101 0-16
  37. a=rtpmap:19 CN/8000
  38. a=ptime:20
  39. """
  40. sendto_cfg = sip.SendtoCfg( "tel: URI", "--null-audio --auto-answer 200",
  41. "", 200, complete_msg=complete_msg)