code: def connectNetToMs(Facility_presence=0, ProgressIndicator_presence=0,
                     ConnectedNumber_presence=0, ConnectedSubaddress_presence=0,
                     UserUser_presence=0):
      
      a = TpPd(pd=0x3)
      b = MessageType(mesType=0x7)  # 00000111
      packet = a / b
      if Facility_presence is 1:
          c = FacilityHdr(ieiF=0x1C, eightBitF=0x0)
          packet = packet / c
      if ProgressIndicator_presence is 1:
          d = ProgressIndicatorHdr(ieiPI=0x1E, eightBitPI=0x0)
          packet = packet / d
      if ConnectedNumber_presence is 1:
          e = ConnectedNumberHdr(ieiCN=0x4C, eightBitCN=0x0)
          packet = packet / e
      if ConnectedSubaddress_presence is 1:
          f = ConnectedSubaddressHdr(ieiCS=0x4D, eightBitCS=0x0)
          packet = packet / f
      if UserUser_presence is 1:
          g = UserUserHdr(ieiUU=0x7F, eightBitUU=0x0)
          packet = packet / g
      return packet
docs: CONNECT Section 9.3.5.1