[OpenSIPS-Users] Calling multiple contacts

Karsten Wemheuer kwem at gmx.de
Wed Mar 30 18:04:09 UTC 2022


Hi,

Am Dienstag, dem 29.03.2022 um 17:01 +0200 schrieb Karsten Wemheuer:
> Hi *,
>
> I am new to the list and I have a problem of understanding that
> unfortunately I could not solve with Google and reading the
> documentation.
>
> My setup:
> Phones register to OpenSIPs. Calls from the phones are transferred to
> a
> PBX via t_relay. This part is working fine.
>
> Requests from the PBX arrive in a route block to "lookup()". Now it
> is
> so that some AOR are found with multiple contacts. t_relay() directs
> these to the correct targets. Phones are ringing in parallel.
>
> My problem: In some cases, manipulations have to be done on only some
> of the outgoing requests. Think of one contact reachable by udp,
> others
> by tcp or tls. I thought of using record_route_preset in the
> branch_route. But this leads to an error (calling rr twice is not
> possible).
>
> Do You have any hints or examples for such a use case?
>
> Thanks in advance,
>
> Karsten

to make the whole thing a bit more concrete, here is the section from
the configuration:

route[TOPHONES] {
  if ( !lookup("location") ) {
    sl_send_reply(404, "Not Found");
    exit;
  }

  t_on_branch("AST2PHONE");

  if ( $rm == "CANCEL" ) {
    if (!t_relay(8)) {
      sl_reply_error();
    }
    exit;
  }

  if (!t_relay()) {
    sl_reply_error();
  }
}

branch_route[AST2PHONE] {
  t_on_reply("PHONE_REPlY");
}

In some cases lookup() returns multiple responses. The entries found
must be partially reached via UDP or TLS or via NAT. Should I use
record_route? Where could this happen?

Thanks for any hints!

Best regards,

Karsten




More information about the Users mailing list