<div dir="ltr"><div dir="ltr">A wise man once said, the online manual should be your bible here :)<div><a href="https://opensips.org/Documentation/Script-CoreVar-3-4#rU">openSIPS | Documentation / Core Variables - 3.4</a><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 21, 2024 at 1:09 PM Prathibha B <<a href="mailto:prathibhab.tvm@gmail.com">prathibhab.tvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am getting the source and destination URI from $fu and $ru. How to fetch the SIP username from the source and destination URI. <div><br></div><div>What I've tried and not working:</div><div># Extract destination URI from the R-URI (Request-URI)<br> $var(destination_uri) = $(ru);<br><br> # Find the position of "@" character in the URI<br> $var(at_position) = strstr($(ru), "@");<br><br> # If "@" is found, extract the substring before it as the SIP username<br> if ($var(at_position) != -1) {<br> $var(destination_username) = substr($var(destination_uri), 4, $var(at_position) - 5);<br> } else {<br> $var(destination_username) = "Unknown";<br> }<br><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,</div><div>B.Prathibha<br></div></div></div></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div>