# Copyright (c) 2007, Kundan Singh. All rights reserved. See LICENSING for details.
# @implements RFC3261 (SIP)
# @implements RFC3581 (rport)
'''
The session initiation protocol (SIP) as per RFC 3261.
In my code there is no performance optimization, if it hurts the style and
compactness of the code.
'''
这里#开始的是注释行。说明了该源码的版权信息和实现了哪些协议。
三引号这一段在python中被称为"block string",可以用来表达多行的字符串。
import re, socket, traceback, uuid
from kutil import getlocaladdr
from rfc2396import isIPv4, isMulticast, isLocal, isPrivate, URI,Address
from rfc2617import createAuthorization
from socketimport gethostbyname# TODO: should replace with getifaddr, SRV, NAPTR or similar