0

我想记录用户发送的所有 INVITE 请求,其中包含错误的身份验证详细信息

问题是我只需要真正失败的身份验证邀请尝试(使用错误的用户名/密码),而不是所有没有凭据发送的请求(在被 OpenSIPS 挑战之前)。

以下脚本日志也请求没有凭据,如果有人能帮助我更正它,那就太好了:

if (!check_source_address("0")) {
    if (!proxy_authorize("", "subscriber")) {
        xlog("L_ERROR","Auth error for $fU@$fd from $si cause -1 INVITE\n");
        proxy_challenge("", "0");
        exit;
    }
    if (!db_check_from()) {
        sl_send_reply("403","Forbidden, use FROM=ID");
        exit;
    }
    consume_credentials();
    # caller authenticated
}
4

1 回答 1

1
            Hi This code will h    

elp,这是有效的。

            $var(auth_code) = www_authorize("", "subscriber");
            if ( $var(auth_code) == -1 || $var(auth_code) == -2 ) {
            xlog("Authentication failed for $fU@$fd from $si cause $var(auth_code)");
            exit;
            }
            if ( $var(auth_code) < 0 ) {
            www_challenge("", "0");
            exit;
            }

            if (!db_check_to()) {
                    sl_send_reply("403","Forbidden auth ID");
                    exit;
            }

            if(!save("location")) {
                    xlog("Register: Saving contact failed for User $ru from $si");
                    sl_reply_error();
                    exit;
            }
            xlog( "User $fU Registered/Unregisterd Successfully From IP:$si");
            exit;
于 2012-03-27T12:42:27.020 回答