tayler6000 / pyVoIP

Pure python VoIP/SIP/RTP library. Currently supports PCMA, PCMU, and telephone-event
https://pypi.org/project/pyVoIP/
GNU General Public License v3.0
224 stars 94 forks source link

Received calls left unanswered on 2.0.0a5 #270

Open FloppiTuna opened 3 weeks ago

FloppiTuna commented 3 weeks ago

On the latest development version, it doesn't seem like call_class is used at all when a call is received.

import pyVoIP
from pyVoIP.credentials import CredentialsManager
from pyVoIP.VoIP.call import VoIPCall
from pyVoIP.VoIP.error import InvalidStateError
from pyVoIP.VoIP.phone import VoIPPhone, VoIPPhoneParameter
import time
import wave

class Call(VoIPCall):

    def ringing(self, invite_request):
        try:
            f = wave.open('sounds/splash.wav', 'rb')
            frames = f.getnframes()
            data = f.readframes(frames)
            f.close()

            self.answer()
            self.write_audio(data)  # This writes the audio data to the transmit buffer, this must be bytes.

            stop = time.time() + (frames / 8000)  # frames/8000 is the length of the audio in seconds. 8000 is the hertz of PCMU.
        except InvalidStateError:
            pass
        except:
            self.hangup()

if __name__ == "__main__":
    pyVoIP.DEBUG = True

    cm = CredentialsManager()
    cm.add("1234", "...")
    params = VoIPPhoneParameter("192.168.xx.xx", 5060, "1234", cm, call_class=Call)
    phone = VoIPPhone(params)
    phone.start()
    print("== Phone started ==")
    print("== Waiting for incoming call on 1234 ==")

The phone will ring, however ringing() is never run. This is running through FreePBX 16 setup with Asterisk 18.

FloppiTuna commented 3 weeks ago

It seems this ended up fixing itself; i'm unsure what I changed though :(

FloppiTuna commented 3 weeks ago

Nevermind; the issue has come back. Here is the debug log output while trying to make a call:

SENT:
REGISTER sip:FreePBX.local:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('0.0.0.0', 5060), 'branch': 'z9hG4bK2a9a1cddafd74c788a91071be'}]
From: {'raw': '<sip:1234@FreePBX.local>;tag=9a3bfd69', 'tag': '9a3bfd69', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
To: {'raw': '<sip:1234@FreePBX.local>', 'tag': '', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
Call-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060
CSeq: {'check': 1, 'method': 'REGISTER'}
Contact: {'raw': '<sip:1234@0.0.0.0;transport=UDP>;+sip.instance="<urn:uuid:4C3EFD2E-D131-4B86-94D8-30D6B0A24483>"', 'tag': '', 'uri': 'sip:1234@0.0.0.0', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '0.0.0.0', 'port': 5060}
Allow: ['INVITE', 'ACK', 'BYE', 'CANCEL', 'OPTIONS', 'NOTIFY', 'REGISTER', 'MESSAGE', 'SUBSCRIBE', 'REFER']
Max-Forwards: 70
Allow-Events: org.3gpp.nwinitdereg
User-Agent: pyVoIP 2.0.0a5
Expires: 120
Content-Length: 0

Body:
content: None

Raw:
b'REGISTER sip:FreePBX.local:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 0.0.0.0:5060;branch=z9hG4bK2a9a1cddafd74c788a91071be\r\nFrom: <sip:1234@FreePBX.local>;tag=9a3bfd69\r\nTo: <sip:1234@FreePBX.local>\r\nCall-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060\r\nCSeq: 1 REGISTER\r\nContact: <sip:1234@0.0.0.0;transport=UDP>;+sip.instance="<urn:uuid:4C3EFD2E-D131-4B86-94D8-30D6B0A24483>"\r\nAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, MESSAGE, SUBSCRIBE, REFER\r\nMax-Forwards: 70\r\nAllow-Events: org.3gpp.nwinitdereg\r\nUser-Agent: pyVoIP 2.0.0a5\r\nExpires: 120\r\nContent-Length: 0\r\n\r\n'

Received UDP Message:
SIP/2.0 401 Unauthorized

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('0.0.0.0', 5060), 'rport': 5060, 'received': '192.168.86.31', 'branch': 'z9hG4bK2a9a1cddafd74c788a91071be'}]
Call-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060
From: {'raw': '<sip:1234@FreePBX.local>;tag=9a3bfd69', 'tag': '9a3bfd69', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
To: {'raw': '<sip:1234@FreePBX.local>;tag=z9hG4bK2a9a1cddafd74c788a91071be', 'tag': 'z9hG4bK2a9a1cddafd74c788a91071be', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
CSeq: {'check': 1, 'method': 'REGISTER'}
WWW-Authenticate: {'header': 'WWW-Authenticate', 'method': 'Digest', 'realm': 'asterisk', 'nonce': '1724293562/82ca1d201999c38631cc6c4a65f99253', 'opaque': '7d8f3ce36354815c', 'algorithm': 'MD5', 'qop': ['auth']}
Server: FPBX-16.0.40.9(18.24.2)
Content-Length: 0

Body:
content: None

Raw:
b'SIP/2.0 401 Unauthorized\r\nVia: SIP/2.0/UDP 0.0.0.0:5060;rport=5060;received=192.168.86.31;branch=z9hG4bK2a9a1cddafd74c788a91071be\r\nCall-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060\r\nFrom: <sip:1234@FreePBX.local>;tag=9a3bfd69\r\nTo: <sip:1234@FreePBX.local>;tag=z9hG4bK2a9a1cddafd74c788a91071be\r\nCSeq: 1 REGISTER\r\nWWW-Authenticate: Digest realm="asterisk",nonce="1724293562/82ca1d201999c38631cc6c4a65f99253",opaque="7d8f3ce36354815c",algorithm=MD5,qop="auth"\r\nServer: FPBX-16.0.40.9(18.24.2)\r\nContent-Length:  0\r\n\r\n'
New Connection Started
Deregistering <pyVoIP.networking.sock.VoIPConnection object at 0x1053601d0>
self.conns=[<pyVoIP.networking.sock.VoIPConnection object at 0x1053601d0>]
listening: [["6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060", "9a3bfd69", "z9hG4bK2a9a1cddafd74c788a91071be", 0]]

msgs: []

SENT:
REGISTER sip:FreePBX.local:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('0.0.0.0', 5060), 'branch': 'z9hG4bK3ec50bde06fd449181afc8fc3'}]
From: {'raw': '<sip:1234@FreePBX.local>;tag=9a3bfd69', 'tag': '9a3bfd69', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
To: {'raw': '<sip:1234@FreePBX.local>', 'tag': '', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
Call-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060
CSeq: {'check': 2, 'method': 'REGISTER'}
Contact: {'raw': '<sip:1234@0.0.0.0;transport=UDP>;+sip.instance="<urn:uuid:4C3EFD2E-D131-4B86-94D8-30D6B0A24483>"', 'tag': '', 'uri': 'sip:1234@0.0.0.0', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '0.0.0.0', 'port': 5060}
Allow: ['INVITE', 'ACK', 'BYE', 'CANCEL', 'OPTIONS', 'NOTIFY', 'REGISTER', 'MESSAGE', 'SUBSCRIBE', 'REFER']
Max-Forwards: 70
Allow-Events: org.3gpp.nwinitdereg
User-Agent: pyVoIP 2.0.0a5
Expires: 120
Authorization: {'header': 'Authorization', 'method': 'Digest', 'username': '1234', 'realm': 'asterisk', 'nonce': '1724293562/82ca1d201999c38631cc6c4a65f99253', 'uri': 'sip:FreePBX.local;transport=UDP', 'response': '3fa380a237539698dec1aec8ed615d33', 'algorithm': 'md5', 'qop': ['auth'], 'cnonce': '69c6d9ecc2064fdcac3f7906d0228c38', 'nc': '00000001', 'userhash': False, 'opaque': '7d8f3ce36354815c'}
Content-Length: 0

Body:
content: None

Raw:
b'REGISTER sip:FreePBX.local:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 0.0.0.0:5060;branch=z9hG4bK3ec50bde06fd449181afc8fc3\r\nFrom: <sip:1234@FreePBX.local>;tag=9a3bfd69\r\nTo: <sip:1234@FreePBX.local>\r\nCall-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060\r\nCSeq: 2 REGISTER\r\nContact: <sip:1234@0.0.0.0;transport=UDP>;+sip.instance="<urn:uuid:4C3EFD2E-D131-4B86-94D8-30D6B0A24483>"\r\nAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, MESSAGE, SUBSCRIBE, REFER\r\nMax-Forwards: 70\r\nAllow-Events: org.3gpp.nwinitdereg\r\nUser-Agent: pyVoIP 2.0.0a5\r\nExpires: 120\r\nAuthorization: Digest username="1234",realm="asterisk",nonce="1724293562/82ca1d201999c38631cc6c4a65f99253",uri="sip:FreePBX.local;transport=UDP",response="3fa380a237539698dec1aec8ed615d33",algorithm=md5,qop=auth,cnonce="69c6d9ecc2064fdcac3f7906d0228c38",nc=00000001,userhash=false,opaque="7d8f3ce36354815c"\r\nContent-Length: 0\r\n\r\n'

Received UDP Message:
SIP/2.0 200 OK

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('0.0.0.0', 5060), 'rport': 5060, 'received': '192.168.86.31', 'branch': 'z9hG4bK3ec50bde06fd449181afc8fc3'}]
Call-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060
From: {'raw': '<sip:1234@FreePBX.local>;tag=9a3bfd69', 'tag': '9a3bfd69', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
To: {'raw': '<sip:1234@FreePBX.local>;tag=z9hG4bK3ec50bde06fd449181afc8fc3', 'tag': 'z9hG4bK3ec50bde06fd449181afc8fc3', 'uri': 'sip:1234@FreePBX.local', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': 'FreePBX.local', 'port': 5060}
CSeq: {'check': 2, 'method': 'REGISTER'}
Date: Thu, 22 Aug 2024 02:26:02 GMT
Contact: {'raw': '<sip:1234@0.0.0.0>;expires=119', 'tag': '', 'uri': 'sip:1234@0.0.0.0', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '0.0.0.0', 'port': 5060}
Expires: 120
Server: FPBX-16.0.40.9(18.24.2)
Content-Length: 0

Body:
content: None

Raw:
b'SIP/2.0 200 OK\r\nVia: SIP/2.0/UDP 0.0.0.0:5060;rport=5060;received=192.168.86.31;branch=z9hG4bK3ec50bde06fd449181afc8fc3\r\nCall-ID: 6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060\r\nFrom: <sip:1234@FreePBX.local>;tag=9a3bfd69\r\nTo: <sip:1234@FreePBX.local>;tag=z9hG4bK3ec50bde06fd449181afc8fc3\r\nCSeq: 2 REGISTER\r\nDate: Thu, 22 Aug 2024 02:26:02 GMT\r\nContact: <sip:1234@0.0.0.0>;expires=119\r\nExpires: 120\r\nServer: FPBX-16.0.40.9(18.24.2)\r\nContent-Length:  0\r\n\r\n'
New Connection Started
Deregistering <pyVoIP.networking.sock.VoIPConnection object at 0x105491550>
self.conns=[None, <pyVoIP.networking.sock.VoIPConnection object at 0x105491550>]
listening: [["6b86b273ff34fce19d6b804eff5a3f57@0.0.0.0:5060", "9a3bfd69", "z9hG4bK3ec50bde06fd449181afc8fc3", 1]]

msgs: []

New register thread

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'
New Connection Started

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

Received UDP Message:
INVITE sip:1234@192.168.86.31:5060 SIP/2.0

Headers:
Via: [{'type': 'SIP/2.0/UDP', 'address': ('192.168.86.35', 5060), 'rport': None, 'branch': 'z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91'}]
From: {'raw': '"CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c', 'tag': '551734e6-3253-4f5a-82cb-f4af2400298c', 'uri': 'sip:1337@192.168.86.35', 'uri-type': 'sip', 'user': '1337', 'password': '', 'display-name': 'CENSORED_NAME', 'host': '192.168.86.35', 'port': 5060}
To: {'raw': '<sip:1234@192.168.86.31>', 'tag': '', 'uri': 'sip:1234@192.168.86.31', 'uri-type': 'sip', 'user': '1234', 'password': '', 'display-name': '', 'host': '192.168.86.31', 'port': 5060}
Contact: {'raw': '<sip:asterisk@192.168.86.35:5060>', 'tag': '', 'uri': 'sip:asterisk@192.168.86.35:5060', 'uri-type': 'sip', 'user': 'asterisk', 'password': '', 'display-name': '', 'host': '192.168.86.35', 'port': 5060}
Call-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613
CSeq: {'check': 16613, 'method': 'INVITE'}
Allow: ['OPTIONS', 'REGISTER', 'SUBSCRIBE', 'NOTIFY', 'PUBLISH', 'INVITE', 'ACK', 'BYE', 'CANCEL', 'UPDATE', 'PRACK', 'MESSAGE', 'INFO', 'REFER']
Supported: ['100rel', 'timer', 'replaces', 'norefersub', 'histinfo']
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>
Max-Forwards: 70
User-Agent: FPBX-16.0.40.9(18.24.2)
Content-Type: application/sdp
Content-Length: 428

Body:
v: 0
o: {'username': '-', 'id': '1460456014', 'version': '1460456014', 'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35'}
s: Asterisk
c: [{'network_type': 'IN', 'address_type': 'IP4', 'address': '192.168.86.35', 'ttl': None, 'address_count': 1}]
t: {'start': '0', 'stop': '0'}
m: [{'type': 'audio', 'port': 13344, 'port_count': 1, 'protocol': <RTPProtocol.AVP: 'RTP/AVP'>, 'methods': ['0', '8', '107', '9', '3', '111', '101', '103'], 'attributes': {'0': {'rtpmap': {'id': '0', 'name': 'PCMU', 'frequency': '8000', 'encoding': None}}, '8': {'rtpmap': {'id': '8', 'name': 'PCMA', 'frequency': '8000', 'encoding': None}}, '107': {'rtpmap': {'id': '107', 'name': 'opus', 'frequency': '48000', 'encoding': '2'}}, '9': {'rtpmap': {'id': '9', 'name': 'G722', 'frequency': '8000', 'encoding': None}}, '3': {'rtpmap': {'id': '3', 'name': 'GSM', 'frequency': '8000', 'encoding': None}}, '111': {'rtpmap': {'id': '111', 'name': 'G726-32', 'frequency': '8000', 'encoding': None}}, '101': {'rtpmap': {'id': '101', 'name': 'telephone-event', 'frequency': '8000', 'encoding': None}, 'fmtp': {'id': '101', 'settings': ['0-16']}}, '103': {'rtpmap': {'id': '103', 'name': 'telephone-event', 'frequency': '48000', 'encoding': None}, 'fmtp': {'id': '103', 'settings': ['0-16']}}}}]
a: {'ptime': '20', 'maxptime': '60', 'transmit_type': <TransmitType.SENDRECV: 'sendrecv'>}

Raw:
b'INVITE sip:1234@192.168.86.31:5060 SIP/2.0\r\nVia: SIP/2.0/UDP 192.168.86.35:5060;rport;branch=z9hG4bKPj2088afaa-5794-4bc0-b08e-d332b42f7d91\r\nFrom: "CENSORED_NAME" <sip:1337@192.168.86.35>;tag=551734e6-3253-4f5a-82cb-f4af2400298c\r\nTo: <sip:1234@192.168.86.31>\r\nContact: <sip:asterisk@192.168.86.35:5060>\r\nCall-ID: 9b3bc102-a89f-41c6-b17b-fe2e75aaa613\r\nCSeq: 16613 INVITE\r\nAllow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, INFO, REFER\r\nSupported: 100rel, timer, replaces, norefersub, histinfo\r\nSession-Expires: 1800\r\nMin-SE: 90\r\nP-Asserted-Identity: "CENSORED_NAME" <sip:1337@192.168.86.35>\r\nMax-Forwards: 70\r\nUser-Agent: FPBX-16.0.40.9(18.24.2)\r\nContent-Type: application/sdp\r\nContent-Length:   428\r\n\r\nv=0\r\no=- 1460456014 1460456014 IN IP4 192.168.86.35\r\ns=Asterisk\r\nc=IN IP4 192.168.86.35\r\nt=0 0\r\nm=audio 13344 RTP/AVP 0 8 107 9 3 111 101 103\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 opus/48000/2\r\na=rtpmap:9 G722/8000\r\na=rtpmap:3 GSM/8000\r\na=rtpmap:111 G726-32/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-16\r\na=rtpmap:103 telephone-event/48000\r\na=fmtp:103 0-16\r\na=ptime:20\r\na=maxptime:60\r\na=sendrecv\r\n'

And the code used:

import pyVoIP
from pyVoIP.credentials import CredentialsManager
from pyVoIP.VoIP.call import VoIPCall
from pyVoIP.VoIP.error import InvalidStateError
from pyVoIP.VoIP.phone import VoIPPhone, VoIPPhoneParameter

class Call(VoIPCall):

    def ringing(self, invite_request):
        try:
            self.answer()
            self.hangup()
        except InvalidStateError:
            pass

if __name__ == "__main__":
    pyVoIP.DEBUG = True
    pyVoIP.TRANSMIT_DELAY_REDUCTION = .25 # without this, audio sounds funny
    cm = CredentialsManager()
    cm.add("1234", "xxx")
    params = VoIPPhoneParameter(
        server="FreePBX.local",
        port=5060,
        user="1234",
        credentials_manager=cm,
        call_class=Call,
        rtp_port_low=10000,
        rtp_port_high=20000
    )
    phone = VoIPPhone(params)
    phone.start()