0

I have a typical requirement, where I have a forwarding SBC between an endpoint and kamailio as shown below.

Endpoint ----> SBC ------> Kamailio

From endpoint I am sending REGISTER request. It reaches SBC. SBC sends the REGISTER request to Kamailio, Kamailio challenges it (401), and challenge response is received at endpoint through SBC.

Next endpoint adds authorization header and sends REGISTER to SBC, SBC forwards it to Kamailio.

Now Kamailio again responds with 401.

When we analysed Kamailio logs, we can see Kamailio log authorization response token and response token that was sent by Endpoint are same.

So my question is, why Kamailio sends 401 repeatedly even if it received proper Authorization header.

Is it because Kamailio received REGISTER from IP address different from endpoint.

Please guide, how can I avoid this issue.

4

1 回答 1

1

如果不知道您用于身份验证的函数和参数,很难猜测会发生什么。

如果像在默认的 kamailio.cfg 中一样完成身份验证,那么请注意,在匹配身份验证响应后会进行一些额外的检查:

  • 来自标头的用户名与身份验证用户名相同
  • To header username 与 authentication username 相同

如果您在配置中使用 debug=3 运行 kamailio,那么您应该会在 syslog 中看到一些日志消息,这些消息会提示与那里不匹配的内容,从而导致请求的身份验证失败。

于 2015-09-14T20:43:48.230 回答