I can not fully recall but I think we have a JIRA about this issue, since the transport is default to UDP when you don't specify the transport on your originate, so the naptr and srv operations would have to move up into mod_sofia, or work on libsofia to make it work correctly.

On Mon, Nov 9, 2015 at 5:49 PM, Brian West <brian@freeswitch.org> wrote:
Never mind on that, you've already failed the transport before it gets there.

On Mon, Nov 9, 2015 at 5:48 PM, Brian West <brian@freeswitch.org> wrote:
can you change "S" to "s" in your record and test again please.

On Mon, Nov 9, 2015 at 5:35 PM, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
sure, you can send your calls any time to:

sip:attendant@demo.voxserv.net
sip:attendant@tdemo.voxserv.net

or create NAPTR records in your own domain which point to my SRV records.

But so far, I couldn't find any error in the syntax, and the UDP record actually works.






On Tue, Nov 10, 2015 at 12:29 AM, Brian West <brian@freeswitch.org> wrote:
I think your NAPTR records are wrong.  I'll double check.

On Mon, Nov 9, 2015 at 5:24 PM, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
Brian, it doesn't look like there's a dependency on priority and weight:  the domain "tdemo.voxserv.net" has only one NAPTR record, and it's not taken into account. I will file a jira ticket for this.


sres.c:3572 sres_log_response() sres_resolver_receive(0xb5001798, 0xb5075bd8) id=32124 (from [10.1.31.38]:53)
nta.c:10465 outgoing_answer_naptr() nta: tdemo.voxserv.net. IN NAPTR 100 100 "S" "SIP+D2T" "" _sip._tcp.demo.voxserv.net. (tport not used)
nua_stack.c:271 nua_stack_event() nua(0xb5637938): event r_invite 503 DNS Error

On Mon, Nov 9, 2015 at 9:15 PM, Brian West <brian@freeswitch.org> wrote:
Set the priority to 0  (tcp) and 20 (udp), then the weight to 0 on both.  Then swap the priorities and see if sofia is just dyslexic 


/b

On Mon, Nov 9, 2015 at 12:01 PM, Lawrence Conroy <lconroy@insensate.co.uk> wrote:
Hi again,
 thanks for putting up the tdemo zone.
Looking at your log, fS DOES get both NAPTRs and process them in the correct order. fS *is* doing the sorting, as your DNS server appears to round robin randomisation on the records in the DNS. Good news: fS gets and parses the DNS correctly; Bad news: behaviour must be in the bowels of Sofia :/
all the best & thanks
  Lawrence

On 9 Nov 2015, at 16:59, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:

> the user@domain is a remote SIP URI, and the DNS points to port 5080 on the remote server.
>
> Here's sofia loglevel 9. It receives two NAPTR records, and takes the one for SIP. It prints "tport not used" -- probably that's the clue why it doesn't try to use TCP.
>
>
>
>
> sres.c:3572 sres_log_response() sres_resolver_receive(0x17af08, 0x1a3ff8) id=36650 (from [10.1.31.38]:53)
> nta.c:10465 outgoing_answer_naptr() nta: demo.voxserv.net. IN NAPTR 100 100 "S" "SIP+D2T" "" _sip._tcp.demo.voxserv.net. (tport not used)
> nta.c:10465 outgoing_answer_naptr() nta: demo.voxserv.net. IN NAPTR 110 100 "S" "SIP+D2U" "" _sip._udp.demo.voxserv.net.
> sres_cache.c:272 sres_cache_get() sres_cache_get(0x164408, SRV, "_sip._udp.demo.voxserv.net.") called
> sres_cache.c:318 sres_cache_get() sres_cache_get(0x164408, SRV, "_sip._udp.demo.voxserv.net.") returned 1 entries
> nta.c:10598 outgoing_query_srv() nta: for "demo.voxserv.net" query "_sip._udp.demo.voxserv.net." SRV (cached)
> nta.c:10694 outgoing_answer_srv() nta: _sip._udp.demo.voxserv.net. IN SRV 10 0  5080 ph02.trrtrr.net. (udp)
>
>
>
>
> On Mon, Nov 9, 2015 at 5:36 PM, Brian West <brian@freeswitch.org> wrote:
> sofia loglevel all 9, watch the debug, is user@domain locally registered or a remote user/domain?
>
> On Mon, Nov 9, 2015 at 9:45 AM, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
> the records are actually documented here, and you can feel free to
> send calls to these extensions:
> http://voxserv.ch/demolab.html
>
> The "tdemo.voxserv.net" points to the same service, but for TCP only.
>
>
>
>
> On Mon, Nov 9, 2015 at 4:00 PM, Lawrence Conroy <lconroy@insensate.co.uk> wrote:
> > Hi there,
> >  from experience of running NAPTR record interops, it was common for libraries/apps to ignore the "weights" and just take the first record in the DNS message.
> > [I don't have recent fS source to hand to check].
> >
> > More interesting is your comment that, with a single NAPTER, fS silently fails.
> > Perhaps give an example by removing the 100/110 udp NAPTR (just leaving the tcp NAPTR)?
> > [and flushing the fS local DNS cache, of course :]
> >
> > all the best,
> >   Lawrence
> >
> >
> > On 9 Nov 2015, at 13:17, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
> >
> >> $ dig naptr demo.voxserv.net
> >>
> >> ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> naptr demo.voxserv.net
> >> ;; global options: +cmd
> >> ;; Got answer:
> >> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19044
> >> ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
> >>
> >> ;; QUESTION SECTION:
> >> ;demo.voxserv.net.              IN      NAPTR
> >>
> >> ;; ANSWER SECTION:
> >> demo.voxserv.net.       600     IN      NAPTR   110 100 "S" "SIP+D2U" "" _sip._udp.demo.voxserv.net.
> >> demo.voxserv.net.       600     IN      NAPTR   100 100 "S" "SIP+D2T" "" _sip._tcp.demo.voxserv.net.
> >>
> >> ;; Query time: 206 msec
> >> ;; SERVER: 91.214.168.168#53(91.214.168.168)
> >> ;; WHEN: Mon Nov  9 14:17:30 2015
> >> ;; MSG SIZE  rcvd: 144
> >>
> >>
> >>
> >>
> >> On Mon, Nov 9, 2015 at 1:41 PM, Brian West <brian@freeswitch.org> wrote:
> >> You're in a NAPTR records may be incorrect, example pleas
> >>
> >>
> >> On Monday, November 9, 2015, Stanislav Sinyagin <ssinyagin@gmail.com> wrote:
> >> If I specify a bridge destination as "sofia/external/USER@DOMAIN", and
> >> that domain has a NAPTR record specifying TCP transport as more
> >> preferred, FreeSWITCH is still sending a UDP INVITE.
> >>
> >> If the domain has only a NAPTR record for TCP transport, the call
> >> fails without sending any INVITE.
> >>
> >> It works with TCP if I add ";transport=tcp" to the bridge string.
> >>
> >> does this look like a bug, or it was set so with some reason?
> >>
> >> _________________________________________________________________________
> >> Professional FreeSWITCH Consulting Services:
> >> consulting@freeswitch.org
> >> http://www.freeswitchsolutions.com
> >>
> >> Official FreeSWITCH Sites
> >> http://www.freeswitch.org
> >> http://confluence.freeswitch.org
> >> http://www.cluecon.com
> >>
> >> FreeSWITCH-users mailing list
> >> FreeSWITCH-users@lists.freeswitch.org
> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> >> http://www.freeswitch.org
> >>
> >>
> >> --
> >> Brian West
> >> brian@freeswitch.org
> >>
> >>
> >>
> >> Twitter: @FreeSWITCH , @briankwest
> >> http://www.freeswitchbook.com
> >> http://www.freeswitchcookbook.com
> >>
> >> Got Bugs? Report them here! | Reddit: /r/freeswitch
> >>
> >> T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
> >> iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest
> >>
> >>
> >>
> >> _________________________________________________________________________
> >> Professional FreeSWITCH Consulting Services:
> >> consulting@freeswitch.org
> >> http://www.freeswitchsolutions.com
> >>
> >> Official FreeSWITCH Sites
> >> http://www.freeswitch.org
> >> http://confluence.freeswitch.org
> >> http://www.cluecon.com
> >>
> >> FreeSWITCH-users mailing list
> >> FreeSWITCH-users@lists.freeswitch.org
> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> >> http://www.freeswitch.org
> >>
> >> _________________________________________________________________________
> >> Professional FreeSWITCH Consulting Services:
> >> consulting@freeswitch.org
> >> http://www.freeswitchsolutions.com
> >>
> >> Official FreeSWITCH Sites
> >> http://www.freeswitch.org
> >> http://confluence.freeswitch.org
> >> http://www.cluecon.com
> >>
> >> FreeSWITCH-users mailing list
> >> FreeSWITCH-users@lists.freeswitch.org
> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> >> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> >> http://www.freeswitch.org
> >
> >
> > _________________________________________________________________________
> > Professional FreeSWITCH Consulting Services:
> > consulting@freeswitch.org
> > http://www.freeswitchsolutions.com
> >
> > Official FreeSWITCH Sites
> > http://www.freeswitch.org
> > http://confluence.freeswitch.org
> > http://www.cluecon.com
> >
> > FreeSWITCH-users mailing list
> > FreeSWITCH-users@lists.freeswitch.org
> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> > http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting@freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
>
> --
> Brian West
> brian@freeswitch.org
>
>
>
> Twitter: @FreeSWITCH , @briankwest
> http://www.freeswitchbook.com
> http://www.freeswitchcookbook.com
>
> Got Bugs? Report them here! | Reddit: /r/freeswitch
>
> T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
> iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting@freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting@freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users@lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Brian West
brian@freeswitch.org


Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

Got Bugs? Report them here! | Reddit: /r/freeswitch

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Brian West
brian@freeswitch.org


Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

Got Bugs? Report them here! | Reddit: /r/freeswitch

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



--

Brian West
brian@freeswitch.org


Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

Got Bugs? Report them here! | Reddit: /r/freeswitch

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest




--

Brian West
brian@freeswitch.org


Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

Got Bugs? Report them here! | Reddit: /r/freeswitch

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest




--

Brian West
brian@freeswitch.org


Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

Got Bugs? Report them here! | Reddit: /r/freeswitch

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest