datso / react-native-pjsip

A PJSIP module for React Native.
http://datso.github.io/react-native-pjsip
GNU General Public License v3.0
273 stars 229 forks source link

sip proxy server returning 503 status #166

Open krajay015 opened 5 years ago

krajay015 commented 5 years ago

I'm trying proxy server for voip notification for react-native-app

my createAccount method for ios is something like this:

account = await endpoint.createAccount({
          name:""Device 2,
         username:"seconddev",
         password:"*****************",
         domain:"domain.name",
         proxy: `sip:${proxyIP}:5060`,
          transport: "UDP",
          contactUriParams,
        });

but in response I'm getting 503 response from server but same proxy server is working perfectly with linphone/x-lite app. Is there anything that I'm missing.

I'm providing my tcpdump here for request :

11:29:53.263833 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [S.], seq 2741863084, ack 2550952211, win 28160, options [mss 1420,sackOK,TS val 395130796 ecr 439902579,nop,wscale 7], length 0
E..<..@.4...#.%..........m....q...n..).........
..7..8as....
11:29:53.263905 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [.], ack 1, win 2068, options [nop,nop,TS val 439902938 ecr 395130796], length 0
E..4..@.@.......#.%.......q..m......lS.....
.8b...7.
11:29:53.264150 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [P.], seq 1:646, ack 1, win 2068, options [nop,nop,TS val 439902938 ecr 395130796], length 645
E.....@.@..c....#.%.......q..m.......}.....
.8b...7.REGISTER sip:domain.name SIP/2.0
Via: SIP/2.0/TCP 192.168.29.221:52014;rport;branch=z9hG4bKPjLCiOpkOK85qS-UqE8VJQWaXpGgBbny3a;alias
Route: <sip:${proxyIP}:5060;transport=udp;lr>
Max-Forwards: 70
From: "Device 2" <sip:seconddev@domain.name>;tag=5ZnpHNZUr7c6TtgTXsfrKQ7vZN4Wgh9T
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: AvfZmJmfm17VmysEhb8TS-KmanKYYpNp
CSeq: 22785 REGISTER
Contact: "Device 2" <sip:seconddev@192.168.29.221:51161;app-id=com.app.name;ob>
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

11:29:53.586786 IP ${reverseProxyIP}bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [.], ack 646, win 231, options [nop,nop,TS val 395131220 ecr 439902938], length 0
E..4..@.5.bN#.%..........m....s.....oS.....
..9T.8b.
11:29:53.586999 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [P.], seq 1:424, ack 646, win 231, options [nop,nop,TS val 395131221 ecr 439902938], length 423
E.....@.5.`.#.%..........m....s......H.....
..9U.8b.SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.29.221:52014;rport=52014;branch=z9hG4bKPjLCiOpkOK85qS-UqE8VJQWaXpGgBbny3a;alias;received=49.36.1.215
From: "Device 2" <sip:seconddev@domain.name>;tag=5ZnpHNZUr7c6TtgTXsfrKQ7vZN4Wgh9T
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: AvfZmJmfm17VmysEhb8TS-KmanKYYpNp
CSeq: 22785 REGISTER
Server: Flexisip/1.0.13 (sofia-sip-nta/2.0)
Content-Length: 0

11:29:53.587032 IP 192.168.29.221.52014 >${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [.], ack 424, win 2061, options [nop,nop,TS val 439903247 ecr 395131221], length 0
E..4..@.@.......#.%.......s..m.T....eP.....
.8d...9U
11:29:55.786381 IP 192.168.29.221.52014 >${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [P.], seq 646:1290, ack 424, win 2061, options [nop,nop,TS val 439905371 ecr 395131221], length 644
E.....@.@..d....#.%.......s..m.T....H......
.8l[..9UREGISTER sip:domain.namel SIP/2.0
Via: SIP/2.0/TCP 192.168.29.221:51161;rport;branch=z9hG4bKPjV2Ma6pG0Wm43MQVm1r1QQrtG5NFI9XT6;alias
Route: <sip:${proxyIP}:5060;transport=udp;lr>
Max-Forwards: 70
From: "Device 2" <sip:seconddev@domain.name>;tag=NgkypgPiNPqR3TLHsO7GD87Os6f-CWLD
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: .qpf3X1XfYgzKoyYYhA1p7-BwcofnoSL
CSeq: 9994 REGISTER
Contact: "Device 2" <sip:seconddev@192.168.29.221:51161;app-id=com.app.name;ob>
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

11:29:56.216898 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [P.], seq 424:846, ack 1290, win 241, options [nop,nop,TS val 395133681 ecr 439905371], length 422
E.....@.4.a.#.%..........m.T..v.....nT.....
..B..8l[SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.29.221:51161;rport=52014;branch=z9hG4bKPjV2Ma6pG0Wm43MQVm1r1QQrtG5NFI9XT6;alias;received=49.36.1.215
From: "Device 2" <sip:seconddev@domain.name>;tag=NgkypgPiNPqR3TLHsO7GD87Os6f-CWLD
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: .qpf3X1XfYgzKoyYYhA1p7-BwcofnoSL
CSeq: 9994 REGISTER
Server: Flexisip/1.0.13 (sofia-sip-nta/2.0)
Content-Length: 0

11:29:56.216973 IP 192.168.29.221.52014 > ${reverseProxyIP}bc.googleusercontent.com.sip: Flags [.], ack 846, win 2054, options [nop,nop,TS val 439905779 ecr 395133681], length 0
E..4..@.@.......#.%.......v..m......M......
.8m...B.
11:29:57.528940 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [P.], seq 1290:1935, ack 846, win 2054, options [nop,nop,TS val 439907064 ecr 395133681], length 645
E.....@.@..c....#.%.......v..m......=......
.8r...B.REGISTER sip:domain.name SIP/2.0
Via: SIP/2.0/TCP 192.168.29.221:52014;rport;branch=z9hG4bKPjCsAlIFljaGGSsO4XfYYlVslQU3GeLJlP;alias
Route: <sip:${proxyIP}5060;transport=udp;lr>
Max-Forwards: 70
From: "Device 2" <sip:seconddev@domain.name>;tag=vvM2HLEX9hjDXapI.ulSo8d55XiZIftp
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: 0Vm3D9oxM11qUqzxDA1tGV8cFqNyHTYC
CSeq: 24795 REGISTER
Contact: "Device 2" <sip:seconddev@192.168.29.221:51161;app-id=com.app.name;ob>
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

11:29:57.974015 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [P.], seq 846:1269, ack 1935, win 251, options [nop,nop,TS val 395135429 ecr 439907064], length 423
E.....@.4.a.#.%..........m....x............
..I..8r.SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.29.221:52014;rport=52014;branch=z9hG4bKPjCsAlIFljaGGSsO4XfYYlVslQU3GeLJlP;alias;received=49.36.1.215
From: "Device 2" <sip:seconddev@domain.name>;tag=vvM2HLEX9hjDXapI.ulSo8d55XiZIftp
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: 0Vm3D9oxM11qUqzxDA1tGV8cFqNyHTYC
CSeq: 24795 REGISTER
Server: Flexisip/1.0.13 (sofia-sip-nta/2.0)
Content-Length: 0

11:29:57.974122 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [.], ack 1269, win 2048, options [nop,nop,TS val 439907502 ecr 395135429], length 0
E..4..@.@.......#.%.......x..m......;......
.8t...I.
11:30:28.144264 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [P.], seq 1935:2580, ack 1269, win 2048, options [nop,nop,TS val 439937152 ecr 395135429], length 645
E.....@.@..c....#.%.......x..m.............
.8....I.REGISTER sip:domain.name SIP/2.0
Via: SIP/2.0/TCP 192.168.29.221:51161;rport;branch=z9hG4bKPjm56mG1HO4rdpJtWhhbWmwlHdTK3KuWo6;alias
Route: <sip:${proxyIP};transport=udp;lr>
Max-Forwards: 70
From: "Device 2" <sip:seconddev@domain.name>;tag=YvNydpb1Y6x9R4Qa8aBzOuaqg-t8lxGO
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: mA0cZPbcL-8ZaohNLxMx6oki52eso1Wf
CSeq: 48823 REGISTER
Contact: "Device 2" <sip:seconddev@192.168.29.221:51161;app-id=com.app.name;ob>
Expires: 600
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0

11:30:28.482845 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [P.], seq 1269:1692, ack 2580, win 261, options [nop,nop,TS val 395166070 ecr 439937152], length 423
E.....@.4.a.#.%..........m....{&...........
...v.8..SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.29.221:51161;rport=52014;branch=z9hG4bKPjm56mG1HO4rdpJtWhhbWmwlHdTK3KuWo6;alias;received=49.36.1.215
From: "Device 2" <sip:seconddev@domain.name>;tag=YvNydpb1Y6x9R4Qa8aBzOuaqg-t8lxGO
To: "Device 2" <sip:seconddev@domain.name>
Call-ID: mA0cZPbcL-8ZaohNLxMx6oki52eso1Wf
CSeq: 48823 REGISTER
Server: Flexisip/1.0.13 (sofia-sip-nta/2.0)
Content-Length: 0

11:30:28.483074 IP 192.168.29.221.52014 > ${reverseProxyIP}.bc.googleusercontent.com.sip: Flags [.], ack 1692, win 2041, options [nop,nop,TS val 439937484 ecr 395166070], length 0
E..4..@.@.......#.%.......{&.m.H....K......
.8.....v
11:30:28.711733 IP ${reverseProxyIP}.bc.googleusercontent.com.sip > 192.168.29.221.52014: Flags [P.], seq 1692:2101, ack 2580, win 261, options [nop,nop,TS val 395166338 ecr 439937152], length 409
E.....@.5.`.#.%..........m.H..{&.....Z.....
.....8..SIP/2.0 503 Service Unavailable
Via: SIP/2.0/TCP 192.168.29.221:51161;rport=52014;branch=z9hG4bKPjm56mG1HO4rdpJtWhhbWmwlHdTK3KuWo6;alias;received=49.36.1.215
From: "Device 2" <sip:seconddev@domain.namel>;tag=YvNydpb1Y6x9R4Qa8aBzOuaqg-t8lxGO
To: "Device 2" <sip:seconddev@domain.name>;tag=FaZXr6Q5p21Kg
Call-ID: mA0cZPbcL-8ZaohNLxMx6oki52eso1Wf
CSeq: 48823 REGISTER
Content-Length: 0

@cmendes0101 @datso can you provide me anything that I'm missing

krajay015 commented 5 years ago

@akolpakov @rodrigowbazevedo @datso @cmendes0101 only difference I'm getting in tcpdump in compared to linPhone and x-lite is that extra Route header is available if I add proxy : Route: <sip:${proxyIP};transport=udp;lr> . is there any way to remove this Route option while firing createAccount request