SipDevicesAlgo

Version 1 (Adrian Georgescu, 02/12/2013 06:52 pm)

1 1 Adrian Georgescu
h1. Algo doorbel
2 1 Adrian Georgescu
 
3 1 Adrian Georgescu
4 1 Adrian Georgescu
BYE message generated by the unit is 1st) broken (the Router headers are missing) and 2nd) sent to the wrong next hop.
5 1 Adrian Georgescu
6 1 Adrian Georgescu
I paste again the bug report describing the issue which you can reproduced with any SIP service provider that uses multiple SIP Proxies for the same domain like http://sip2sip.info
7 1 Adrian Georgescu
8 1 Adrian Georgescu
<<<<<<
9 1 Adrian Georgescu
The unit is not able to correctly terminate the calls when the next hop is a state-full SIP Proxy. A state-full SIP Proxy uses record route to maintain the same signaling path for all subsequent messages part of the same dialog. The unit does not handle this situation, which is standard setup of any VoIP provider that uses a SIP Proxy instead of using a VoIP switch like Asterisk or FreeSwitch, which behave like an end-point. 
10 1 Adrian Georgescu
11 1 Adrian Georgescu
Secondly, the unit does not correctly send the BYE to the right next hop when there is more than one SIP server for the same domain (regardless of whether it is a SIP Proxy or not).
12 1 Adrian Georgescu
13 1 Adrian Georgescu
The log is below:
14 1 Adrian Georgescu
15 1 Adrian Georgescu
2013-01-01T00:41:05+01:00 xs4all phone: sip recv 85.17.186.7:5060, size = 2095
16 1 Adrian Georgescu
2013-01-01T00:41:05+01:00 xs4all phone: [truncated] INVITE sip:1972@192.168.1.9:5060 SIP/2.0#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.a08d838>#015#012Record-Route: <sip:81.23.228.129;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.c5809b45>#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.908d838>#015#012Record-Route: <sip:81.23.228.129;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012Record-Route: <sip:81.23.228.129;transport=tcp;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.28ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.338f5a74.0#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.18ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.238f5a74.0;i=7db2#015#012Via: SIP/2.0/tcp 192.168.1.57:57428;received=82.161.39.123;rport=57428;branch=z9hG4bKPjkhvJ8eoLpQhZKMzod4XgVhJZrJxAEtUe#015#012Max-Forwards: 66#015#012From: "Adrian Georgescu" <sip:ag@ag-projects.c
17 1 Adrian Georgescu
18 1 Adrian Georgescu
Expanded messages below for clarity with the relevant headers, notice the Record-Route headers:
19 1 Adrian Georgescu
20 1 Adrian Georgescu
INVITE sip:1972@192.168.1.9:5060 SIP/2.0
21 1 Adrian Georgescu
Record-Route: <sip:81.23.228.129;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.c5809b45>
22 1 Adrian Georgescu
Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.908d838>
23 1 Adrian Georgescu
Record-Route: <sip:81.23.228.129;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>
24 1 Adrian Georgescu
Record-Route: <sip:81.23.228.129;transport=tcp;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>
25 1 Adrian Georgescu
From: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks
26 1 Adrian Georgescu
To: <sip:1972@ag-projects.com>
27 1 Adrian Georgescu
Contact: <sip:52138976@82.161.39.123:57428;transport=tcp>
28 1 Adrian Georgescu
Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7
29 1 Adrian Georgescu
30 1 Adrian Georgescu
31 1 Adrian Georgescu
2013-01-01T00:41:06+01:00 xs4all phone: sip send 85.17.186.7:5060, size = 1193
32 1 Adrian Georgescu
2013-01-01T00:41:06+01:00 xs4all phone: [truncated] SIP/2.0 180 Ringing#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.28ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.338f5a74.0#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.18ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.238f5a74.0;i=7db2#015#012Via: SIP/2.0/tcp 192.168.1.57:57428;received=82.161.39.123;rport=57428;branch=z9hG4bKPjkhvJ8eoLpQhZKMzod4XgVhJZrJxAEtUe#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.a08d838>#015#012Record-Route: <sip:81.23.228.129;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.c5809b45>#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.908d838>#015#012Record-Route: <sip:81.23.228.129;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012Record-Route: <sip:81.23.228.129;transport=tcp;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012From: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmk
33 1 Adrian Georgescu
2013-01-01T00:41:06+01:00 xs4all phone: sip send 85.17.186.7:5060, size = 1421
34 1 Adrian Georgescu
2013-01-01T00:41:06+01:00 xs4all phone: [truncated] SIP/2.0 200 OK#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.28ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.338f5a74.0#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.18ff94f5.0#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.238f5a74.0;i=7db2#015#012Via: SIP/2.0/tcp 192.168.1.57:57428;received=82.161.39.123;rport=57428;branch=z9hG4bKPjkhvJ8eoLpQhZKMzod4XgVhJZrJxAEtUe#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.a08d838>#015#012Record-Route: <sip:81.23.228.129;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.c5809b45>#015#012Record-Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.908d838>#015#012Record-Route: <sip:81.23.228.129;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012Record-Route: <sip:81.23.228.129;transport=tcp;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>#015#012From: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks#015#012To
35 1 Adrian Georgescu
2013-01-01T00:41:07+01:00 xs4all phone: sip recv 85.17.186.7:5060, size = 706
36 1 Adrian Georgescu
2013-01-01T00:41:07+01:00 xs4all phone: ACK sip:1972@82.161.39.123:61031 SIP/2.0#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.18ff94f5.2#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.238f5a74.2#015#012Via: SIP/2.0/UDP 85.17.186.7:5060;branch=z9hG4bK0159.18ff94f5.2#015#012Via: SIP/2.0/UDP 81.23.228.129:5060;branch=z9hG4bK0159.238f5a74.2;i=7db2#015#012Via: SIP/2.0/tcp 192.168.1.57:57428;received=82.161.39.123;rport=57428;branch=z9hG4bKPj6Uyn5PV6pApqRSblxHYaZ-7P.0Aid2IR#015#012Max-Forwards: 66#015#012From: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks#015#012To: <sip:1972@ag-projects.com>;tag=530668702#015#012Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7#015#012CSeq: 31053 ACK#015#012User-Agent: Blink Pro 2.0.3 (MacOSX)#015#012Content-Length:  0#015#012#015
37 1 Adrian Georgescu
2013-01-01T00:42:05+01:00 xs4all phone: sip send 81.23.228.129:5060, size = 429
38 1 Adrian Georgescu
2013-01-01T00:42:05+01:00 xs4all phone: BYE sip:52138976@82.161.39.123:57428;transport=tcp SIP/2.0#015#012Via: SIP/2.0/UDP 192.168.1.9:5060;rport;branch=z9hG4bK688014405#015#012From: <sip:1972@ag-projects.com>;tag=530668702#015#012To: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks#015#012Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7#015#012CSeq: 27636006 BYE#015#012Allow: INVITE, ACK, CANCEL, BYE, INFO#015#012Max-Forwards: 70#015#012User-Agent: Algo 8028 1.7.8#015#012Content-Length: 0#015#012#015
39 1 Adrian Georgescu
2013-01-01T00:42:05+01:00 xs4all phone: sip recv 81.23.228.129:5060, size = 495
40 1 Adrian Georgescu
2013-01-01T00:42:05+01:00 xs4all phone: SIP/2.0 200 OK#015#012Via: SIP/2.0/UDP 192.168.1.9:5060;rport=61031;received=82.161.39.123;branch=z9hG4bK688014405#015#012Record-Route: <sip:81.23.228.129;transport=tcp;lr;r2=on;ftag=530668702>#015#012Record-Route: <sip:81.23.228.129;lr;r2=on;ftag=530668702>#015#012Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7#015#012From: <sip:1972@ag-projects.com>;tag=530668702#015#012To: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks#015#012CSeq: 27636006 BYE#015#012Server: Blink Pro 2.0.3 (MacOSX)#015#012Content-Length:  0#015#012#015
41 1 Adrian Georgescu
42 1 Adrian Georgescu
43 1 Adrian Georgescu
Algo sends this BYE message, which never arrives at the original destination as the intermediate SIP proxy has no information where to route it (it has no Route headers):
44 1 Adrian Georgescu
45 1 Adrian Georgescu
BYE sip:52138976@82.161.39.123:57428;transport=tcp SIP/2.0
46 1 Adrian Georgescu
Via: SIP/2.0/UDP 192.168.1.9:5060;rport;branch=z9hG4bK688014405
47 1 Adrian Georgescu
From: <sip:1972@ag-projects.com>;tag=530668702
48 1 Adrian Georgescu
To: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks
49 1 Adrian Georgescu
Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7
50 1 Adrian Georgescu
CSeq: 27636006 BYE
51 1 Adrian Georgescu
Allow: INVITE, ACK, CANCEL, BYE, INFO
52 1 Adrian Georgescu
Max-Forwards: 69
53 1 Adrian Georgescu
User-Agent: Algo 8028 1.7.8
54 1 Adrian Georgescu
Content-Length: 0
55 1 Adrian Georgescu
56 1 Adrian Georgescu
57 1 Adrian Georgescu
The correct BYE message must be (observe the missing Route headers that the unit must add, they must be copied in reverse order from the original INVITE Record-Route headers same when Algo was building the 200 OK message, which incidentally is done correctly):
58 1 Adrian Georgescu
59 1 Adrian Georgescu
BYE sip:52138976@82.161.39.123:57428;transport=tcp SIP/2.0
60 1 Adrian Georgescu
Via: SIP/2.0/UDP 192.168.1.9:5060;rport;branch=z9hG4bK688014405
61 1 Adrian Georgescu
From: <sip:1972@ag-projects.com>;tag=530668702
62 1 Adrian Georgescu
Route: <sip:81.23.228.129;transport=tcp;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>
63 1 Adrian Georgescu
Route: <sip:81.23.228.129;r2=on;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.b5809b45>
64 1 Adrian Georgescu
Route: <sip:85.17.186.7;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.908d838>
65 1 Adrian Georgescu
Route: <sip:81.23.228.129;lr;ftag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks;did=1a8.c5809b45>
66 1 Adrian Georgescu
To: "Adrian Georgescu" <sip:ag@ag-projects.com>;tag=x0VdFW8sEn3bymiNLIQFWpc7Bqe0Hmks
67 1 Adrian Georgescu
Call-ID: YsTJTTdp5Kxb6eYrxDqViOkl2GaJUCd7
68 1 Adrian Georgescu
CSeq: 27636006 BYE
69 1 Adrian Georgescu
Allow: INVITE, ACK, CANCEL, BYE, INFO
70 1 Adrian Georgescu
Max-Forwards: 69
71 1 Adrian Georgescu
User-Agent: Algo 8028 1.7.8
72 1 Adrian Georgescu
Content-Length: 0
73 1 Adrian Georgescu
74 1 Adrian Georgescu
75 1 Adrian Georgescu
Also the BYE message must be sent exactly to the IP:port where you have received the INVITE from and not by performing a DNS lookup. By doing a DNS lookup you may find another SIP Proxy from the same domain that has no knowledge about this dialog, there should never be a DNS lookup performed in the middle of an established SIP dialog, the standard is explicit about this behavior.