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 ( even though I have “” set in sip.conf.

The OPTIONS packet to 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 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

Shows that I should add a bunch of extra sections for host= ( and when I do that, now it starts sending more OPTIONS packets out, one to each of the 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 get a OK response as it should. And the REGISTRATION is also sent to 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 servers seem to want to see "" in all the packets like REGISTRATION so I have to keep that set to “”.

I have also tried it without “” and that won’t get a registration at all because the REGISTRATION packets go to only.


I am behind several NAT routers.

sip.conf (important lines)


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 IPs :




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, 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 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 is gone right now for some unknown reason so Asterisk doesn’t know about the server which makes sense.’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:

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 ( as "USER@" instead of 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 instead of 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 ANY


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 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.


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?