def sendMessage(self, destURL, message):
        """
        Send a message.

        @param destURL: C{URL}. This should be a *physical* URL, not a logical one.
        @param message: The message to send.
        """
        if destURL.transport not in ("udp", None):
            raise RuntimeError("only UDP currently supported")
        if self.debug:
            log.msg("Sending %r to %r" % (message.toString(), destURL))
        data = message.toString()
        if isinstance(data, unicode):
            data = data.encode("utf-8")
        self.transport.write(data, (destURL.host, destURL.port or self.PORT))

        Send a message.

        @param destURL: C{URL}. This should be a *physical* URL, not a logical one.
        @param message: The message to send.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/sip.py