Mainly in Twilio if you are using sip trunk you should always call with international code prefix like you should put +1 before number for USA.

it looks like the number you are using in local format “ 5101112222”  it should "+xxx 510111   "



From: Adelia C. <hexade@hotmail.com>
To: "freeswitch-users@lists.freeswitch.org" <freeswitch-users@lists.freeswitch.org>
Date: December 10, 2014 at 7:45:40 PM GMT+3
Reply-To: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Subject: [Freeswitch-users] Twilio SIP trunk config - outbound call rejected



Any idea why this INVITE is rejected with 400 Invalid Phone Number by Twilio?
The first INVITE asks for Proxy Authentication, that seems to pass and this is rejected.
Thank you!

INVITE sip:5101112222@mycompany.pstn.twilio.com SIP/2.0
Via: SIP/2.0/UDP 10.50.1.116:5080;rport;branch=z9hG4bKa8QvU1B6QmeKc
Max-Forwards: 69
From: "unknown" <sip:4152221111@mycompany.pstn.twilio.com>;tag=6UetZr6rDZgHF
To: <sip:5101112222@mycompany.pstn.twilio.com>
Call-ID: 1ffda8b7-faaf-1232-8380-a9a65d1e96b1
CSeq: 68751485 INVITE
Contact: <sip:gw+twiliotrunk@10.50.1.116:5080;transport=udp;gw=twiliotrunk>
Expires: 3600
User-Agent: FreeSWITCH-mod_sofia/1.5.12b~64bit
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, refer
Proxy-Authorization: Digest username="4152221111", realm="sip.twilio.com", nonce="f722ae99d0a818bc422baa5d8", cnonce="IA1gJvqvEg6mmXR6WsQ", opaque="e89d2328e07da020d75a", algorithm=MD5, uri="sip:5101112222@mycompany.pstn.twilio.com", response="e65d3dea5b1e3b35306cfa121ec2ae4d", qop=auth, nc=00000001
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 268
X-FS-Support: update_display,send_info
Remote-Party-ID: "unknown" <sip:1000@mycompany.pstn.twilio.com>;party=calling;screen=yes;privacy=off

v=0
o=FreeSWITCH 1418153731 1418153732 IN IP4 10.50.1.116
s=FreeSWITCH
c=IN IP4 10.50.1.116
t=0 0
m=audio 21366 RTP/AVP 0 8 3 101 13
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
--

SIP/2.0 400 Invalid phone number
To: <sip:5101112222@ingenio.pstn.twilio.com>;tag=08602519_6772d868_5eef74bb-957c-486e-b261-2a2e63704d73
Via: SIP/2.0/UDP 10.50.1.116:5080;received=10.50.1.116;rport=5080;branch=z9hG4bKa8QvU1B6QmeKc
CSeq: 68751485 INVITE
Call-ID: 1ffda8b7-faaf-1232-8380-a9a65d1e96b1
From: "unknown" <sip:4152221111@ingenio.pstn.twilio.com>;tag=6UetZr6rDZgHF
Contact: <sip:171.118.14.130:5060>
Content-Length: 0



--