Android imsdroid to call PSTN not working

I use the FreeSWITCH server and integrate with twilio SIP turnk. I am using the imsdroid android application to make calls. imsdroid to call imsdroid. imsdroid to call PSTN no (ie mobile number) does not work. Gateway timeout error is shown in imsdroid. INVITE is sent to FreeSWITCH, and the freeswitch server routes the Twilio call. But not getting an answer. What could be the problem.

IP is allowed. From the SIPML5 client to the PSTN call, it works. Below is an INVITE that comes from FreeSWITCH

INVITE sip:+919986790176@nowconf.pstn.twilio.com SIP/2.0
Via: SIP/2.0/UDP 220.227.38.107:5080;rport;branch=z9hG4bK5yt865UUKDF4H
Max-Forwards: 69
From: "+919845217138" <sip:FreeSWITCH@nowconf.pstn.twilio.com>;tag=eFNKtBae4HN1r
To: <sip:+919986790176@nowconf.pstn.twilio.com>
Call-ID: 06f7df5f-1f81-1235-67b0-2e81eca04f81
CSeq: 98923179 INVITE
Contact: <sip:gw+Twilio-outbound@220.227.38.107:5080;transport=udp;gw=Twilio-outbound>
User-Agent: FreeSWITCH-mod_sofia/1.6.10+git~20160824T215404Z~726448d962~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 248
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000
X-FS-Support: update_display,send_info
Remote-Party-ID: "+919845217138" <sip:+919845217138@nowconf.pstn.twilio.com>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1478495490 1478495491 IN IP4 220.227.38.107
s=FreeSWITCH
c=IN IP4 220.227.38.107
t=0 0
m=audio 22996 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-16
a=ptime:20

SIPML5 INVITE

INVITE sip:+919742164769@nowconf.pstn.twilio.com SIP/2.0
Via: SIP/2.0/UDP 220.227.38.107:5080;rport;branch=z9hG4bKD5jv3tcpNtFDS
Max-Forwards: 69
From: "+919845217138" <sip:FreeSWITCH@nowconf.pstn.twilio.com>;tag=cvS8XKDp62Z5e
To: <sip:+919742164769@nowconf.pstn.twilio.com>
Call-ID: 69171aa5-1d0d-1235-67b0-2e81eca04f81
CSeq: 98788399 INVITE
Contact: <sip:gw+Twilio-outbound@220.227.38.107:5080;transport=udp;gw=Twilio-outbound>
User-Agent: FreeSWITCH-mod_sofia/1.6.10+git~20160824T215404Z~726448d962~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 488
X-FS-Support: update_display,send_info
Remote-Party-ID: "+919845217138" <sip:+919845217138@nowconf.pstn.twilio.com>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1478224523 1478224524 IN IP4 220.227.38.107
s=FreeSWITCH
c=IN IP4 220.227.38.107
t=0 0
m=audio 24404 RTP/AVP 102 9 0 8 103 101
a=rtpmap:102 opus/48000/2
a=fmtp:102 useinbandfec=0; cbr=1; maxaveragebitrate=30000; maxplaybackrate=48000; ptime=20; minptime=10; maxptime=40; stereo=1
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:103 telephone-event/48000
a=fmtp:103 0-16
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
ACK sip:172.18.22.113:5060 SIP/2.0
Via: SIP/2.0/UDP 220.227.38.107:5080;rport;branch=z9hG4bKeecN5NXSj35Zm
Route: <sip:54.172.60.3:5060;lr;ftag=cvS8XKDp62Z5e>
Max-Forwards: 70
From: "+919845217138" <sip:FreeSWITCH@nowconf.pstn.twilio.com>;tag=cvS8XKDp62Z5e
To: <sip:+919742164769@nowconf.pstn.twilio.com>;tag=70832428_6772d868_27e46324-e125-4895-a6ff-98031cdb43fc
Call-ID: 69171aa5-1d0d-1235-67b0-2e81eca04f81
CSeq: 98788399 ACK
Contact: <sip:gw+Twilio-outbound@220.227.38.107:5080;transport=udp;gw=Twilio-outbound>
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP 54.172.60.3:5060;branch=z9hG4bK763a.52f422d4.0
Via: SIP/2.0/UDP 172.18.22.113:5060;rport=5060;received=54.172.61.235;branch=z9hG4bK27e46324-e125-4895-a6ff-98031cdb43fc_6772d868_294770755291215
From: <sip:+919742164769@nowconf.pstn.twilio.com>;tag=70832428_6772d868_27e46324-e125-4895-a6ff-98031cdb43fc
To: "+919845217138" <sip:FreeSWITCH@nowconf.pstn.twilio.com>;tag=cvS8XKDp62Z5e
Call-ID: 69171aa5-1d0d-1235-67b0-2e81eca04f81
CSeq: 1 BYE
User-Agent: FreeSWITCH-mod_sofia/1.6.10+git~20160824T215404Z~726448d962~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Content-Length: 0
+4
source share
1 answer

Remove these two headers before submitting to Twilio:

P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel 

P-Access-Network-Info: ADSL;utran-cell-id-3gpp=00000000

Twilio sip:

<action application="unset" data="sip_h_P-Preferred-Service"/> 

<action application="unset" data="sip_h_P-Access-Network-Info"/>
+2

Source: https://habr.com/ru/post/1660139/


All Articles