1# $Id: sip.py 48 2008-05-27 17:31:15Z yardley $ 2# -*- coding: utf-8 -*- 3"""Session Initiation Protocol.""" 4from __future__ import absolute_import 5 6from . import http 7 8 9class Request(http.Request): 10 """SIP request. 11 12 TODO: Longer class information.... 13 14 Attributes: 15 __hdr__: Header fields of SIP request. 16 TODO. 17 """ 18 19 __hdr_defaults__ = { 20 'method': 'INVITE', 21 'uri': 'sip:user@example.com', 22 'version': '2.0', 23 'headers': {'To': '', 'From': '', 'Call-ID': '', 'CSeq': '', 'Contact': ''} 24 } 25 __methods = dict.fromkeys(( 26 'ACK', 'BYE', 'CANCEL', 'INFO', 'INVITE', 'MESSAGE', 'NOTIFY', 27 'OPTIONS', 'PRACK', 'PUBLISH', 'REFER', 'REGISTER', 'SUBSCRIBE', 28 'UPDATE' 29 )) 30 __proto = 'SIP' 31 32 33class Response(http.Response): 34 """SIP response. 35 36 TODO: Longer class information.... 37 38 Attributes: 39 __hdr__: Header fields of SIP response. 40 TODO. 41 """ 42 43 __hdr_defaults__ = { 44 'version': '2.0', 45 'status': '200', 46 'reason': 'OK', 47 'headers': {'To': '', 'From': '', 'Call-ID': '', 'CSeq': '', 'Contact': ''} 48 } 49 __proto = 'SIP' 50