tirfil / pysipfullproxy Goto Github PK
View Code? Open in Web Editor NEWBasic Sip Proxy written in Python (All requests and responses go through proxy)
Basic Sip Proxy written in Python (All requests and responses go through proxy)
The direct connection between 2 baresips works fine. Through the proxy the receiving end closes the connection after 30 seconds
This is the output of the /sipstat in the receiving baresip:
client transactions:
server transactions:
INVITE ACCEPTED 25s (z9hG4bK5d5f6adb2cedb306)
transports:audio=63573/64000 (bit/s) [====== ] [==== ]
192.168.1.63:5060 (UDP)
192.168.1.63:5060 (TCP)
192.168.1.63:5061 (TLS)
[aa02:a03f:3e4f:df00:9add:a4b2:75d1:801a]:5060 (UDP)
[aa02:a03f:3e4f:df00:9add:a4b2:75d1:801a]:5060 (TCP)
[aa02:a03f:3e4f:df00:9add:a4b2:75d1:801a]:5061 (TLS)
When those 25s above become 0 the receiver closes the connection. It looks like there is something not being relayed.
This is the output of the proxy using DEBUG in the logger:
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:>>> SIP/2.0 180 Ringing
23:01:14:DEBUG:---
>> server received [592]:
SIP/2.0 180 Ringing
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Length: 0
---
23:01:14:DEBUG:Received from 192.168.1.63:5060
23:01:14:DEBUG:origin raul-cell2@raspberry
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:<<< SIP/2.0 180 Ringing
23:01:14:DEBUG:---
<< server send [506]:
SIP/2.0 180 Ringing
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Length: 0
---
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:>>> SIP/2.0 200 Answering
23:01:14:DEBUG:---
>> server received [961]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:14:DEBUG:Received from 192.168.1.63:5060
23:01:14:DEBUG:origin raul-cell2@raspberry
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:<<< SIP/2.0 200 Answering
23:01:14:DEBUG:---
<< server send [875]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:>>> SIP/2.0 200 Answering
23:01:14:DEBUG:---
>> server received [961]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:14:DEBUG:Received from 192.168.1.63:5060
23:01:14:DEBUG:origin raul-cell2@raspberry
23:01:14:DEBUG:(23:01:14)
23:01:14:INFO:<<< SIP/2.0 200 Answering
23:01:14:DEBUG:---
<< server send [875]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:15:DEBUG:(23:01:15)
23:01:15:INFO:>>> SIP/2.0 200 Answering
23:01:15:DEBUG:---
>> server received [961]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:15:DEBUG:Received from 192.168.1.63:5060
23:01:15:DEBUG:origin raul-cell2@raspberry
23:01:15:DEBUG:(23:01:15)
23:01:15:INFO:<<< SIP/2.0 200 Answering
23:01:15:DEBUG:---
<< server send [875]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:17:DEBUG:(23:01:17)
23:01:17:INFO:>>> SIP/2.0 200 Answering
23:01:17:DEBUG:---
>> server received [961]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
23:01:17:DEBUG:Received from 192.168.1.63:5060
23:01:17:DEBUG:origin raul-cell2@raspberry
23:01:17:DEBUG:(23:01:17)
23:01:17:INFO:<<< SIP/2.0 200 Answering
23:01:17:DEBUG:---
<< server send [875]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
---
spam To: <sip:[email protected]:5060>
spam To: <sip:[email protected]:5060>
23:01:21:DEBUG:(23:01:21)
23:01:21:INFO:>>> SIP/2.0 200 Answering
23:01:21:DEBUG:---
>> server received [961]:
SIP/2.0 200 Answering
Record-Route: <sip:127.0.1.1:5060;lr>
Via: SIP/2.0/UDP 127.0.1.1:5060;branch=z9hG4bK6565fa2de56343dcm;received=192.168.1.9
Via: SIP/2.0/UDP 192.168.1.54:5060;branch=z9hG4bK6565fa2de56343dc;received=192.168.1.54;rport=5060
To: <sip:thinkpad@raspberry>;tag=cffef0fc284a1588
From: <sip:raul-cell2@raspberry>;tag=7df45690fbf05f5d
Call-ID: 29634a379391ffac
CSeq: 43510 INVITE
Server: baresip v0.5.10 (x86_64/linux)
Contact: <sip:[email protected]:5060>
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Content-Type: application/sdp
Content-Length: 334
v=0
o=- 1239775700 1560154066 IN IP4 192.168.1.63
s=-
c=IN IP4 192.168.1.63
t=0 0
a=tool:baresip 0.5.10
m=audio 18130 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=label:1
a=rtcp-rsize
a=ssrc:3293230915 cname:sip:thinkpad@raspberry
a=ptime:20
Please let me know if you need more details or you want me to run some experiments
Cheers!
Proxy Server unable to connect to Call Server but started to Accepting for connections
This is the perfect companion for baresip in my raspberry pie.
Now I can have the raspberry at my doorbell call my cellphone thanks to you!!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.