A wise man once said, the online manual should be your bible here :)
openSIPS | Documentation / Core Variables - 3.4
<https://opensips.org/Documentation/Script-CoreVar-3-4#rU>


On Thu, Mar 21, 2024 at 1:09 PM Prathibha B <[email protected]>
wrote:

> I am getting the source and destination URI from $fu and $ru.  How to
> fetch the SIP username from the source and destination URI.
>
> What I've tried and not working:
> # Extract destination URI from the R-URI (Request-URI)
>             $var(destination_uri) = $(ru);
>
>             # Find the position of "@" character in the URI
>             $var(at_position) = strstr($(ru), "@");
>
>             # If "@" is found, extract the substring before it as the SIP
> username
>             if ($var(at_position) != -1) {
>                 $var(destination_username) = substr($var(destination_uri),
> 4, $var(at_position) - 5);
>             } else {
>                 $var(destination_username) = "Unknown";
>             }
>
> --
> Regards,
> B.Prathibha
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to