[sr-dev] where is s proxy_challenge function?

Juha Heinanen jh at tutpro.com
Thu Jul 1 21:30:00 CEST 2010


Juha Heinanen writes:

> i see that this thing in the code builds the challenge (p-a header):
> 
> 	if (ret < 0) {
> 	    if (auth_api.build_challenge(msg, (cred ? cred->stale : 0), realm, NULL, NULL, hftype) < 0) {
> 		ERR("Error while creating challenge\n");
> 		ret = -2;
> 	    }
> 
> is there a way to prevent p-a header from being added to reply in case
> after proxy_authorize failure i want to reply with "403 Forbidden"
> instead of "407 Proxy Authentication Required"?

jan,

i was able to figure this out.  auth_api.build_challenge stores the
header in a variable that defaults to $digest_challenge.  however, when
i write in config file as you suggested:

            if (defined $digest_challenge && $digest_challenge != "") {
                append_to_reply("%$digest_challenge");
            };
            send_reply("407", "Proxy Authentication Required");

i get these errors to syslog:

Jul  1 22:24:54 localhost /usr/sbin/sip-proxy[26750]: ERROR: <core> [mod_fix.c:246]: Cannot convert function parameter 1 to0
Jul  1 22:24:54 localhost /usr/sbin/sip-proxy[26750]: ERROR: <core> [route.c:1088]: fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:1019
Jul  1 22:24:54 localhost /usr/sbin/sip-proxy[26750]: ERROR: <core> [route.c:1088]: fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:1020
Jul  1 22:24:54 localhost /usr/sbin/sip-proxy[26750]: ERROR: <core> [route.c:1088]: fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:1023
Jul  1 22:24:54 localhost /usr/sbin/sip-proxy[26750]: ERROR: <core> [route.c:1088]: fixing failed (code=-1) at cfg:/etc/sip-proxy/sip-proxy.cfg:1042

what does % mean in "%$digest_challenge"?

-- juha



More information about the sr-dev mailing list