Doesn't seem to use outbound proxy setting right

This is going to get a bit technical…

I’m not sure if this is a bug or a settings problem. What it does is keep sending UDP OPTIONS packets to 81.23.228.140 (sip2sip.info) even though I have “outboundproxy=proxy.sipthor.net” set in sip.conf.

The OPTIONS packet to sip2sip.info does not get a OK reply like it should. It’s going to port 5060 like it should, I’m watching this via tcpdump.

Shouldn’t it know that we are going to use proxy.sipthor.net as outbound so it should send keep alive packets there? (I am pretty sure that’s what the OPTION packets are mostly for, and keeping NAT routes for UDP open)

The other thing, this site page wiki.sip2sip.info/projects/sip2sip/wiki/SipDevicesAsterisk

Shows that I should add a bunch of extra sections for host=81.23.228.129 (proxy.sipthor.net) and when I do that, now it starts sending more OPTIONS packets out, one to each of the proxy.sipthor.net IP addresses (there are 3).

That’s fine, because then it establishes NAT routes for those IPs and I am sure it works but that’s a lot of extra traffic they don’t need and I don’t need. I don’t think they are displaying a good way to configure Asterisk.

All the OPTIONS packets sent to proxy.sipthor.net get a OK response as it should. And the REGISTRATION is also sent to proxy.sipthor.net and that gets a OK and I am registered (at least the first time, see below).

So, is there something wrong with the way Asterisk is handling all this or what?

I’ve tried some other combinations of host= but sip2sip.info servers seem to want to see "UUUUU@sip2sip.info" in all the packets like REGISTRATION so I have to keep that set to “host=sip2sip.info”.

I have also tried it without “outboundproxy=proxy.sipthor.net” and that won’t get a registration at all because the REGISTRATION packets go to sip2sip.info only.

Info:

I am behind several NAT routers.

sip.conf (important lines)

[sip2sip.info]
type=peer
host=sip2sip.info
outboundproxy=proxy.sipthor.net
canreinvite=no
secret=XXXXX
qualify=yes
nat=yes
insecure=invite,port
fromuser=UUUUUU
defaultuser=UUUUUU
remotesecret=XXXXX

and I added the below to see what happens and if I do it sends more OPTION packets to thos IPs where it DOESN’T do that at all if I don’t add these, these are all theproxy.sipthor.net IPs :

[sp2sip-1]
type=peer
host=81.23.228.129

[sip2sip-2]
type=peer
host=81.23.228.150

[sip2sip-3]
type=peer
host=85.17.186.7

The second problem I have is that the first registration goes through OK after starting up Asterisk, but the next automatic one in 5 minutes fails with:

Probably a DNS error for registration to UUUUUU@sip2sip.info, trying REGISTER again (after 20 seconds)

Of course DNS is working fine and I can do a look up and it did that same lookup the first time it tried and got the proper IPs that time. I have “enable=yes” in dnsmgr.conf

And this I don’t understand at all since everything is OK the first time.

edit: forgot to say I’m using Asterisk 1.8.10.1 on Ubuntu

I’m learning more about this problem.

Looking through the code I found a number of things that might need a change. But I can’t say that I am 100% sure of how all this works.

What is happening is that the SRV record of sip2sip.info is gone right now for some unknown reason so Asterisk doesn’t know about the server proxy.sipthor.net which makes sense. proxy.sipthor.net’s DNS “A” record is OK, meaning it can be looked up if the SRV record existed.

For those who don’t know about this, basically a SRV record is like a e-mail server record, it will point to the e-mail server of a site if you go to get mail. A good info doc is here: voip-info.org/wiki/view/DNS+SRV

But I should be able to enter in that information statically into Asterisk and it should handle that. But I am not sure if the “outboundproxy” setting is the place to do that, it may have other functions, please let me know.

I don’t think it’s actions with the “outboundproxy” setting is correct, as explained in the previous post, it should have been sending ALL outgoing messages to the “outboundproxy” server I think.

Also, the “To:” and “From:” settings in the REGISTRATION packet were not right, they would contain the IP address 81.23.228.129 (proxy.sipthor.net) as "USER@81.23.228.129" instead of USER@sip2sip.info meaning it should have used the variable “r->regdomain” (what is called “domain” in the sip.conf file I think) in the source code if “outboundproxy” exists.

Once I hard coded that into the REGISTRATION section of the code it works and the packets are now correct. It’s only for me to get by for now of course.

The other problem is that it would still try to send that REGISTRATION packet to sip2sip.info instead of proxy.sipthor.net so I also hard coded that at the point where it does the DNS lookup, at the call to “create_addr()”.

Just for reference, all this was done in the routine “transmit_register()” in channels/chan_sip.c

Right now, until they fix it, you can see that the SRV record is gone even at the authority server:

dig @ns1.dns-hosting.info sip2sip.info ANY

Summary:

The registration should always use the “domain” variable “r->regdomain”?? when registering because that’s the guys login “username” on these systems.

When a “outboundproxy” setting exists, all REGISTRATION and other packets should go to that server.

Let me know if this isn’t correct.

The nice people at sip2sip have replied and the SRV record is actually there.

You have to specifically request the sip record and can’t just do “ANY” on just the domain name, which you would think would show you all records possible for that domain, oh well.

So the corrected command is below and shows the SRV record:

dig @ns1.dns-hosting.info _sip._udp.sip2sip.info ANY

Now I am at a loss as to why Asterisk wasn’t picking up the SRV record when it has been doing it for quite a while before this happened.

Hello,

I have question about outboundproxy option.
I have set outboundproxy in sip.conf under general section. It works well - Invites and other packets are sent through Proxy on outbound calls.
However, when I am placing call to T38 fax device:
Invite goes through proxy to T38 fax device;
T38 fax device responds with T38 reinvite, and here starts the problem: Asterisk sends Trying no to Proxy IP anymore, but to T38 fax device directly.
Are there any options to make Asterisk respond through Proxy in such case? Or maybe it depends on Headers used on T38 reinvite which comes from Proxy to Asterisk?
Thanks!