[OpenSIPS-Users] - Not sending ACK back!

Nitesh Divecha aviator.nitesh.d at gmail.com
Fri Oct 21 18:01:26 UTC 2022


Daniel,

Thanks for your detailed email. Much appreciated!

Yes I totally understand about OpenSIPS and I'm going over all the
documentations and tutorials I can find! My background is from Asterisk, so
with that mentality I'm tackling OpenSIPS.

Asterisk (Context) vs OpenSIPS (C-style script), it is a huge challenge but
getting the hang of it!

Lets pick option (3) Routing local calls (ATA to ATA)... Do you have any
examples I can follow and set up a local route? I set up two extensions
(8883456 and 7773456) via OpenSIPS Control Panel and I was able to register
two ATA's. I do have the Registrar module loaded... How can I call each
other?

#### REGISTRAR module

loadmodule "registrar.so"

modparam("registrar", "default_expires", 3600)

modparam("registrar", "min_expires", 60)

modparam("registrar", "max_expires", 120)

# modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")

# modparam("registrar", "received_avp", "$avp(received_nh)")/* uncomment
the next line not to allow more than 10 contacts per AOR */

modparam("registrar", "max_contacts", 10)

modparam("registrar", "received_avp", "$avp(rcv)")

modparam("registrar", "retry_after", 30)


Regarding option (4) - I have both options. IP to IP and User/Pass
authentication provider. Using User/Pass I was able to register OpenSIPS as
UAC to a remote server and I was able to make outbound calls but call keeps
on dropping due to no ACK.

Cheers,
Nitesh





On Fri, Oct 21, 2022 at 1:26 PM Daniel Zanutti <daniel.zanutti at gmail.com>
wrote:

> Hi Nitesh
>
> As you already know, opensips is a low level software. You have to
> understand several aspects of SIP, network, RTP, DNS that when you use
> Asterisk, most you don't need to understand deep.
>
> Trying to help you, your script is way simple for you achievements. You
> need:
> 1) Check NAT on all request + all replies. This is to fix your SIP
> messages.
>
> 2) Check if you need to apply RTPPROXY on the call. You can use the
> "engage" function on INVITE then forget about it OR you can use manual way
> with "offer" function and handle all scenarios manually. For example, call
> the "answer" function on the 200 OK. Then delete on BYE.
>
> 3) Routing local calls (ATA to ATA) you need to handle the Register first
> with "save" function, then later handle the INVITE with the "lookup"
> function, both of Registrar module.
>
> 4) PSTN can be used as a direct route or some dynamic routing solution.
> Make it work first with direct routing. Need to check how authenticate
> works on your carrier. If IP based will be fine, if user/pass you need to
> make your opensips authenticate, it's a little harder.
>
> 5) DID - You have to create some specific INBOUND rules. Calls will be
> anonymous or authenticated?
>
> 6) Fax - Better solve other issues first.
>
> Hope this gives you some direction. Look for some tutorials.
>
> Regards
>
> On Fri, Oct 21, 2022 at 11:11 AM Nitesh Divecha <
> aviator.nitesh.d at gmail.com> wrote:
>
>> Hello All,
>>
>> I have been scratching my head for a few days now... Just to recap:
>>
>> I'm a newbie with OpenSIPS so bear with me... I got OpenSIPS 3.3.1
>> (residential) running on Debian 11 with OpenSIPS Control Panel 9.3.2 and
>> MySQL.
>>
>> My goal is to:
>> 1) Make two ATA's register and call each other (locally)... *Stopped
>> working, I think routing logic is missing.*
>> 2) Make ATA to call PSTN via an outbound SIP trunk or DID provider... *No
>> ACK sent to Outbound provider.*
>> 3) Receive inbound calls from PSTN or SIP trunk and forward it to
>> registered ATA... *Getting rejected.*
>> 4) Able to send and receive faxes from and to PSTN... *Haven't even
>> touched.*
>>
>> Fast forward... I did achieve a few of my goals but they stopped
>> working... You fix one thing and you break others...
>>
>> My current issue is OpenSIPS is not sending ACK back to the Outbound
>> provider when I make calls to PSTN thus calls are getting dropped from the
>> Outbound provider due to no ACK. This issue started when I implemented
>> topology_hiding('C"), rtpproxy_offer("ro"), uac_replace_from( ,
>> "$avp(furi)").
>>
>> Here is my code snippet:
>>
>> ####### Routing Logic ########
>>
>>
>> # main request routing logic
>>
>>
>> route{
>>
>>
>> #if ($rU=~"^\+[1-9][0-9]+$") {
>>
>>         if (dp_translate(10 ,$rU ,$rU) ) {
>>
>>                 xlog("*** 2. Dial plan translate from source $avp(src)
>> to $rU ***\n");
>>
>>
>>                 $avp(furi) = "sip:aaabbbcccc at gothamcity.com";
>>
>>                 uac_replace_from( , "$avp(furi)");
>>
>>                 #strip(1);
>>
>>                 if (!do_routing(0)) {
>>
>>                         send_reply(500,"No PSTN Route found");
>>
>>                         exit;
>>
>>                 }
>>
>>                 # t_on_branch("change_from");
>>
>>                 route(relay);
>>
>>                 exit;
>>
>>         }
>>
>>
>>
>> route[relay] {
>>
>>         xlog("*** 3. Entering route relay ***\n");
>>
>>         # for INVITEs enable some additional helper routes
>>
>>         if (is_method("INVITE")) {
>>
>>                 topology_hiding("C");
>>
>>                 if(remove_hf("User-Agent")){
>>
>>                         xlog("*** 4. User-Agent found and removed.
>> ***\n");
>>
>>                 }
>>
>>
>>                 if (isflagset("NAT") && has_body("application/sdp")) {
>>
>>                         rtpproxy_offer("ro");
>>
>>                         #rtpproxy_offer();
>>
>>                 }
>>
>>
>>                 t_on_branch("per_branch_ops");
>>
>>                 t_on_reply("handle_nat");
>>
>>                 t_on_failure("missed_call");
>>
>>         }
>>
>>
>>         if (isflagset("NAT")) {
>>
>>                 add_rr_param(";nat=yes");
>>
>>         }
>>
>>
>>         if (!t_relay()) {
>>
>>                 send_reply(500,"Internal Error");
>>
>>         }
>>
>>         exit;
>>
>> }
>>
>> Any thoughts or suggestions on what to check for ACK?
>>
>> Cheers,
>> Nitesh
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20221021/47caeefb/attachment-0001.html>


More information about the Users mailing list