New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong return code used by sl_reply_error() #2802
Comments
|
Hi @miconda . I think you misunderstood bug here. Issue is that if and switch statements change behaviour of sl_send_error(). Same examples as configuration from this bug report are in Kamailio documentation so it looks like a bug, if not maybe documentation needs an update. |
Then I still do not understand properly after your last comment. Note that $rc can be updated by any kamailio action, so you should save its value in a $var(...) if you want to use it later. If you do an xlog(), after it the $rc is updated to the return of xlog(). |
Please have a look at https://www.kamailio.org/docs/modules/devel/modules/outbound.html "Example 1.1. Edge Proxy Configuration" it uses exact same syntax. If expected behaviour is that any statement can affect sl_reply_error() then this example needs updating. |
Description
I wanted to change 478 response to 503 in case of t_relay() failure, but leave default behavior in rest error cases. I used part of code from "Example 1.1." inside https://www.kamailio.org/docs/modules/devel/modules/outbound.html. When I get -478 from t_relay() it works fine, but when this code is different sl_reply_erorr() don't use it as it should be.
This is my part of kamailio.cfg:
When I log $rc value before sl_reply_error() it is valid, but not used by sl_reply_error() as SIP error value, it sends 500 instead.
Troubleshooting
Reproduction
I've added incorrect hostnames with flag 16 to set where the message should be sent and t_relay() returns -478. To check the default case inside switch I changed case -478 to -479.
Log Messages
Logs with different route relay
Additional Information
kamailio -v
The text was updated successfully, but these errors were encountered: