<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><tt>Hello,<br>
<br>
In failure_route, when doing uac_auth() you should check the
return code of the function - only if the functions successfully
located the credentials and added the auth headers, only then
you should relay out a new branch. Otherwise you should simply
reply with error (if uac_auth() was not able to authenticate).<br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
On 21.02.2014 10:04, Jayesh Nambiar wrote:<br>
</div>
<blockquote
cite="mid:CANAYozu9T41ORDkaQ_h66jyh_5FHRemwgJa8ZZNGeda=7R_rLQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hi,</div>
This is how I do it on 1.11 dev version and it works absolutely
as expected:
<div><br>
</div>
<div>
<div><span>modparam</span><span>(</span>"uac_auth","credential","username<span>:</span>domain<span>:</span>password")</div>
<div><span><span id="a2e83d86-e8d8-432a-9c0a-434a35a15902"
class="GINGER_SOFTWARE_mark">modparam</span></span><span><span
id="20fc4ff8-f813-4c2d-9da3-6f38e46cd0a1"
class="GINGER_SOFTWARE_mark">(</span></span>"uac_auth","auth_realm_avp","$avp<span><span
id="26c138f0-76b6-4e92-81b3-06b9a48b3093"
class="GINGER_SOFTWARE_mark">(</span></span>domain)")</div>
<div><span><span id="e9b410c4-126c-4969-bc91-318c6e22090b"
class="GINGER_SOFTWARE_mark">modparam</span></span><span><span
id="e187e543-c335-496b-adc8-cac6560dee03"
class="GINGER_SOFTWARE_mark">(</span></span>"uac_auth","auth_username_avp","$avp<span><span
id="194b496b-6404-4e4f-9150-d56ded6e6f07"
class="GINGER_SOFTWARE_mark">(</span></span>username)")</div>
<div><span><span id="c349d19d-f15c-4da7-98af-9f46f177649e"
class="GINGER_SOFTWARE_mark">modparam</span></span><span><span
id="2d99a377-2979-44b2-a946-7631849ba8c6"
class="GINGER_SOFTWARE_mark">(</span></span>"uac_auth","auth_password_avp","$avp<span><span
id="4f2ead65-b0a5-4763-8e33-7ea00a1a9713"
class="GINGER_SOFTWARE_mark">(</span></span>password)")</div>
</div>
<div><br>
</div>
<div><span><span id="097ddf43-a6f7-4498-a3dc-86e464b7c8b3"
class="GINGER_SOFTWARE_mark">route</span></span><span><span
id="e11c130e-68d5-478c-b5f3-6e6e4db8ccb9"
class="GINGER_SOFTWARE_mark">[</span></span>uac_auth] {</div>
<div> $avp<span
id="e39f0839-dfa0-46af-ae59-bb0ec6f3c720"
class="GINGER_SOFTWARE_mark">(</span>username) = "<span
id="d2849208-dcab-477e-8169-616f62c2f3d5"
class="GINGER_SOFTWARE_mark">abc</span>";</div>
<div> $avp<span
id="746493c6-c207-4a0b-8e30-29a16e022274"
class="GINGER_SOFTWARE_mark">(</span>password) = "12344556";</div>
<div> $avp<span
id="b6a40e25-6407-418d-9724-43b976d57655"
class="GINGER_SOFTWARE_mark">(</span>domain) = "<a
moz-do-not-send="true" href="http://abc.com">abc.com</a>";</div>
<div><br>
</div>
<div>
<span style="white-space:pre-wrap"> </span>uac_replace_from<span><span
id="854d3264-cba9-46b1-a386-436daaee9674"
class="GINGER_SOFTWARE_mark">(</span></span>"sip<span><span
id="e9558c34-6f05-49b5-90ac-a1acd1d8f1f3"
class="GINGER_SOFTWARE_mark">:</span></span>$avp<span><span
id="6885f9e8-940f-4c6d-aebe-f0a1ff8cdb1e"
class="GINGER_SOFTWARE_mark">(</span></span>username<span><span
id="c4e082c5-4bc1-43a9-91e2-612c0df3570c"
class="GINGER_SOFTWARE_mark">)</span></span>@$avp<span><span
id="70d8af98-213e-4060-90bb-10c2526e996e"
class="GINGER_SOFTWARE_mark">(</span></span>domain)");</div>
<div> $rd = $avp<span><span
id="2741a564-a423-44cf-a7a1-2cc845e742c8"
class="GINGER_SOFTWARE_mark">(</span></span>siptrunk_domain);</div>
<div> $avp<span><span
id="0bf0e97f-7557-4da8-b6a5-c15b7bfc27dc"
class="GINGER_SOFTWARE_mark">(</span></span>outbound_proxy)
= "1.2.3.4" # ---This is the destination IP---</div>
<div><br>
</div>
<div> $var<span><span
id="f4cd4bc8-92bc-42d1-a688-7f1e0afaad96"
class="GINGER_SOFTWARE_mark">(</span></span><span><span
id="1828fc5f-b8ea-48e8-8de3-8e2a212d153b"
class="GINGER_SOFTWARE_mark">duri</span></span>) =
"sip:"+$rU+"@"+$avp<span><span
id="eb002fef-f55a-47b2-96e0-1aa2e43b6722"
class="GINGER_SOFTWARE_mark">(</span></span>outbound_proxy);</div>
<div><span style="white-space:pre-wrap"> </span>$du = $var<span><span
id="25fdf60e-dd8c-484c-abda-6d5a9c16580b"
class="GINGER_SOFTWARE_mark">(</span></span><span><span
id="171c7936-5fcd-48d6-803c-21a391fa3460"
class="GINGER_SOFTWARE_mark">duri</span></span>);</div>
<div><br>
</div>
<div> t_on_failure<span><span
id="2786bdb5-fb54-4fee-a460-609bb1ff4f21"
class="GINGER_SOFTWARE_mark">(</span></span>"UAC_AUTH_FAIL");</div>
<div><span style="white-space:pre-wrap"> </span><span><span
id="ffd64c2b-dcc3-43dc-8a81-c6345993f0d0"
class="GINGER_SOFTWARE_mark">if</span></span><span><span
id="1dca6a30-3d3d-4cfd-996b-ff8b5308ea14"
class="GINGER_SOFTWARE_mark">(</span></span><span><span
id="972b09b8-8a29-460f-b5e3-7c2b6c4eecea"
class="GINGER_SOFTWARE_mark">!</span></span>t_relay<span><span
id="a8d56d94-4037-47a9-81fb-e929e5a7c2f0"
class="GINGER_SOFTWARE_mark">(</span></span>)) {</div>
<div><span style="white-space:pre-wrap"> </span>sl_reply_error<span><span
id="d4b345b3-1780-492b-9e80-e35c25098c50"
class="GINGER_SOFTWARE_mark">(</span></span>);</div>
<div><span style="white-space:pre-wrap"> </span><span><span
id="572d8d5c-e20b-4cd5-9894-6be5ac3d323e"
class="GINGER_SOFTWARE_mark">exit</span></span>;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div><span style="white-space:pre-wrap"> </span><span
id="0a354b31-0802-4910-a8a6-007d7bc7759e"
class="GINGER_SOFTWARE_mark">exit</span>;</div>
<div>}<br>
</div>
<div>
<br>
</div>
<div>failure_route<span><span
id="3b02227f-ff51-4c40-9f69-3c8ad260ce85"
class="GINGER_SOFTWARE_mark">[</span></span>UAC_AUTH_FAIL]
{</div>
<div> <span><span
id="9b5326dc-8db1-4b85-a85e-ff15818bc008"
class="GINGER_SOFTWARE_mark">if</span></span>
(t_check_status<span><span
id="c24f5b6a-fe95-4d3e-b456-5c40b70ca0ed"
class="GINGER_SOFTWARE_mark">(</span></span>"40<span><span
id="cd2f58a3-ae40-40cb-85aa-5c24f188cf38"
class="GINGER_SOFTWARE_mark">[</span></span>17]")) {</div>
<div><span style="white-space:pre-wrap"> </span><span><span
id="79a45589-86e9-470d-bea2-3b332f679afd"
class="GINGER_SOFTWARE_mark">xlog</span></span><span><span
id="6aac22a7-dfe5-46ab-933e-04633e6551b8"
class="GINGER_SOFTWARE_mark">(</span></span>"got
challenged \n");</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"> </span>uac_auth<span><span
id="11b06b1a-9949-4ef4-9545-5c199c849a32"
class="GINGER_SOFTWARE_mark">(</span></span>);</div>
<div><span style="white-space:pre-wrap"> </span><span><span
id="63ca8c8f-ee1b-4cdc-9d91-0581f3c0c636"
class="GINGER_SOFTWARE_mark">xlog</span></span><span><span
id="c5a6ca64-c8df-41ed-ae20-105d246c90a9"
class="GINGER_SOFTWARE_mark">(</span></span>"L_INFO",
"Return code is $retcode");</div>
<div><span style="white-space:pre-wrap"> </span>$rd = $avp<span><span
id="1979982b-02f8-4574-8340-d15b4756eb8e"
class="GINGER_SOFTWARE_mark">(</span></span>outbound_proxy);</div>
<div><span style="white-space:pre-wrap"> </span>t_relay<span><span
id="1e5d7ef2-0320-4ee2-b184-c959b6b21a19"
class="GINGER_SOFTWARE_mark">(</span></span>);</div>
<div><span style="white-space:pre-wrap"> </span><span><span
id="8990ae7f-1650-4b0e-8e76-8bde24bbae56"
class="GINGER_SOFTWARE_mark">exit</span></span>;</div>
<div><span style="white-space:pre-wrap"> </span>}</div>
<div>
}</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Feb 21, 2014 at 4:28 AM, James
Palic <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:jpalic@onlc.com" target="_blank">jpalic@onlc.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">Bogdan-Andrei Iancu <a class="moz-txt-link-rfc2396E" href="mailto:bogdan@..."><bogdan@...></a> writes:<br>
<br>
><br>
><br>
> Hello,<br>
> Do you have still have the corefile ? Are you
able to extract a<br>
> backtrace from it . See:<br>
> <br>
> <a moz-do-not-send="true"
href="http://www.opensips.org/Documentation/TroubleShooting-Crash"
target="_blank">http://www.opensips.org/Documentation/TroubleShooting-Crash</a><br>
> Regards,<br>
> Bogdan-Andrei Iancu<br>
> OpenSIPS Founder and Developer<br>
> <a moz-do-not-send="true"
href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a><br>
> On 21.01.2014 15:35, Justin Zondagh wrote:<br>
><br>
><br>
><br>
><br>
> Hi All,<br>
><br>
> I'm running a compiled version of
openSIPS 1.10 on<br>
> Ubuntu 12.04.<br>
><br>
> I'm getting a segfault in the uac_auth()
function and<br>
> not too sure why. I am setting the
username, password and<br>
> realm avps before I call it.<br>
><br>
> The 401 comes in back from the UAS and
then hits the<br>
> failure_route[1], does some stuff and
then crashes in what<br>
> seems like uac_auth()...<br>
><br>
><br>
</div>
<div class="">> ==== Back trace =====<br>
><br>
> available upon request<br>
><br>
><br>
><br>
> Any ideas?<br>
><br>
> Regards,<br>
><br>
><br>
><br>
><br>
</div>
> Justin Zondaghzondagh-<br>
<a moz-do-not-send="true"
href="mailto:Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a><br>
<div class="">> Cape Town | South
Africa<br>
><br>
> skype: jrzondagh<br>
> m: +27 72 598<br>
> 4887 | f: +27 86 546<br>
> 1405<br>
><br>
> uk: +44 20 328<br>
> 99610<br>
> _______________________________________________<br>
> Users mailing list<br>
> <a moz-do-not-send="true"
href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a moz-do-not-send="true"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
</div>
Hi Bogdan,<br>
<br>
I'm am also experiencing a segfault with uac_auth() in
OpenSIPS 1.10<br>
(running on Debian). Following the Troubleshooting
directions, bt full<br>
shows:<br>
<br>
#0 0x0000000000000000 in ?? ()<br>
No symbol table info available.<br>
#1 0x00007fa4987ee370 in ?? ()<br>
No symbol table info available.<br>
#2 0x00007fa4987ee370 in ?? ()<br>
No symbol table info available.<br>
#3 0x0000000000479383 in ?? ()<br>
No symbol table info available.<br>
#3 0x0000000000000000 in ?? ()<br>
No symbol table info available.<br>
<br>
Doesn't seem that useful for debugging. What am I missing
using gdb?<br>
<br>
Jim<br>
<div class="HOEnZb">
<div class="h5"><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a moz-do-not-send="true"
href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a moz-do-not-send="true"
href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>