[OpenSIPS-Users] Fwd: uac_auth() segfault

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Feb 21 16:38:44 CET 2014


Hello,

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).

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 21.02.2014 10:04, Jayesh Nambiar wrote:
> Hi,
> This is how I do it on 1.11 dev version and it works absolutely as 
> expected:
>
> modparam("uac_auth","credential","username:domain:password")
> modparam("uac_auth","auth_realm_avp","$avp(domain)")
> modparam("uac_auth","auth_username_avp","$avp(username)")
> modparam("uac_auth","auth_password_avp","$avp(password)")
>
> route[uac_auth] {
>                 $avp(username) = "abc";
>                 $avp(password) = "12344556";
>                 $avp(domain) = "abc.com <http://abc.com>";
>
> uac_replace_from("sip:$avp(username)@$avp(domain)");
>                 $rd = $avp(siptrunk_domain);
>                 $avp(outbound_proxy) = "1.2.3.4" # ---This is the 
> destination IP---
>
>                 $var(duri) = "sip:"+$rU+"@"+$avp(outbound_proxy);
> $du = $var(duri);
>
>                 t_on_failure("UAC_AUTH_FAIL");
> if(!t_relay()) {
> sl_reply_error();
> exit;
> }
> exit;
> }
>
> failure_route[UAC_AUTH_FAIL] {
> if (t_check_status("40[17]")) {
> xlog("got challenged \n");
>
> uac_auth();
> xlog("L_INFO", "Return code is $retcode");
> $rd = $avp(outbound_proxy);
> t_relay();
> exit;
> }
> }
>
>
> On Fri, Feb 21, 2014 at 4:28 AM, James Palic <jpalic at onlc.com 
> <mailto:jpalic at onlc.com>> wrote:
>
>     Bogdan-Andrei Iancu <bogdan at ...> writes:
>
>     >
>     >
>     >     Hello,
>     >         Do you have still have the corefile ? Are you able to
>     extract a
>     >         backtrace from it . See:
>     >
>     > http://www.opensips.org/Documentation/TroubleShooting-Crash
>     >         Regards,
>     >       Bogdan-Andrei Iancu
>     > OpenSIPS Founder and Developer
>     > http://www.opensips-solutions.com
>     >       On 21.01.2014 15:35, Justin Zondagh wrote:
>     >
>     >
>     >
>     >
>     >           Hi All,
>     >
>     >             I'm running a compiled version of openSIPS 1.10 on
>     >               Ubuntu 12.04.
>     >
>     >             I'm getting a segfault in the uac_auth() function and
>     >               not too sure why. I am setting the username,
>     password and
>     >               realm avps before I call it.
>     >
>     >             The 401 comes in back from the UAS and then hits the
>     >               failure_route[1], does some stuff and then crashes
>     in what
>     >               seems like uac_auth()...
>     >
>     >
>     >             ==== Back trace =====
>     >
>     >             available upon request
>     >
>     >
>     >
>     >             Any ideas?
>     >
>     >             Regards,
>     >
>     >
>     >
>     >
>     >                   Justin Zondaghzondagh-
>     Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
>     <mailto:Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org>
>     >                   Cape Town | South Africa
>     >
>     >                     skype: jrzondagh
>     >                   m: +27 72 598
>     >                       4887 | f: +27 86 546
>     >                       1405
>     >
>     >                   uk: +44 20 328
>     >                       99610
>     >       _______________________________________________
>     > Users mailing list
>     > Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>     > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>     >
>
>     Hi Bogdan,
>
>     I'm am also experiencing a segfault with uac_auth() in OpenSIPS 1.10
>     (running on Debian). Following the Troubleshooting directions, bt full
>     shows:
>
>     #0 0x0000000000000000 in ?? ()
>     No symbol table info available.
>     #1 0x00007fa4987ee370 in ?? ()
>     No symbol table info available.
>     #2 0x00007fa4987ee370 in ?? ()
>     No symbol table info available.
>     #3 0x0000000000479383 in ?? ()
>     No symbol table info available.
>     #3 0x0000000000000000 in ?? ()
>     No symbol table info available.
>
>     Doesn't seem that useful for debugging.  What am I missing using gdb?
>
>     Jim
>
>
>
>
>
>
>     _______________________________________________
>     Users mailing list
>     Users at lists.opensips.org <mailto: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/20140221/cd9cb4c1/attachment.htm>


More information about the Users mailing list