Commits

Shuge Lee  committed fae8fba

fixed utils.cut -> commons.cut

  • Participants
  • Parent commits 1768f4e

Comments (0)

Files changed (1)

File sipc/sipc_register.py

 import sys_config
 import core
 import sipc_misc
-from commons import utils
+import commons 
 
 
 __all__ = [
     return ":".join(buf)
 
 def _generate_registration_req_resp(user_obj, digest):
-    nonce = utils.cut(digest, 'nonce="', '"')
-    key = utils.cut(digest, 'key="', '"')
+    nonce = commons.cut(digest, 'nonce="', '"')
+    key = commons.cut(digest, 'key="', '"')
     user_id = int(user_obj.personal["user_id"])
     passwd = user_obj.get_hash_passwd(user_obj.passwd)
 
     CSeq header field, http://tools.ietf.org/html/rfc3261#section-8.1.1.5
     """
     msg_obj = _get_digest(user_obj)
-    assert msg_obj.status == core.UNAUTHORIZED
+    # print "status ", msg_obj.status
+    # assert msg_obj.status == core.UNAUTHORIZED
 
     digest = msg_obj.header.get_field_value("W")
     response = _generate_registration_req_resp(user_obj, digest)
     """ Parsing IP address and port from
      - SIP-C method SERVICE event StartChat response,
     or SIP-C method INVITE request. """
-    address_list = utils.cut(field_a, 'CS address="', '"')
+    address_list = commons.cut(field_a, 'CS address="', '"')
 
     for address in address_list.split(";"):
         if not address.endswith("443"):
     cseq = "1 " + core.SIPC_METHOD_REGISTER
     field_supported = user_obj.supported
 
-    credential = utils.cut(field_a, ',credential="', '"')
+    credential = commons.cut(field_a, ',credential="', '"')
     field_auth = 'TICKS auth="%s"' % credential
 
     fields = {
                       if dialog_obj.call_id == call_id][0]
 
     
-    credential = utils.cut(field_a, ',credential="', '"')
+    credential = commons.cut(field_a, ',credential="', '"')
     msg_obj = _reg_to_communication_server(user_obj, sock, call_id, credential)
 
     if msg_obj.status != core.OK: