OpenSIPS 2.4 call forbidden

2019-04-16 00:15发布

问题:

I discovered OpenSIPS and all the possibilities a few days ago. I would just use it as a simple SIP proxy to get started. Proxy between my designated UAC and my UAS (asterisk, not natted). The goal is to use a proxy to prevent bot attacks on my UAS.

After installing OpenSIPS, I tried to configure my XLITE (natted) by simply adding the proxy URL in the configuration. It works, I register and I can see in my UAS peers my extensions with proxy IP. But when I make a call, I got a forbidden error. In debug mode, the log does not talk to me, I see a lot of information but nothing about this error.

I did not make any changes to the default configuration script. Is this behavior normal?

I also tried with VM on public IP as UAC (so not named), same thing.

Thank you for your help.

Olivier

回答1:

Most likely, your SIP INVITE is hitting this block:

if (!is_myself("$rd")) {                                                                                  
    send_reply("403", "Relay Forbidden");                                                                  
    exit;                                                                                                 
}

What this means is that your OpenSIPS does not consider itself responsible for the domain (or IP) that your SIP UA has placed in the Request-URI and is trying to route towards. To fix this, just whitelist the Asterisk IP as a local (recognized) domain using the alias statement:

listen = udp:*:5060   
alias = 1.1.1.1