Hi there,
I have a weird issue with kamailio (latest docker image kamailio-ci:5.5.2-alpine) and http_async_client.
Before posting a lot of logs, let me describe what I want to achieve.
I have a Kamailio and a SIP Phone.
The SIP phone sends a REGISTER to kamailio, then in my routing block, I check if I have an Authorization header.
Since I don't have an Authorization (first message), I use "www_challenge()". This replies to the SIP phone, and then the SIP phone sends a new REGISTER with the correct Authorization header.
So far so good.
Now, when I get the REGISTER with Authorization header, I want to ask an HTTP endpoint if this user is allowed to connect and check the password using http_async_query().
The problem is that when the transaction resumes, the tmx module is unhappy and throws this error :
`30(36) CRITICAL: tmx [t_var.c:546]: pv_get_tm_reply_code(): no picked branch (-1) for a final response in MODE_ONFAILURE ` And a 500 error is sent back to the sip phone. The AUTH_REPLY route is still called and I can use the $http* values.
it seems that my AUTH_REPLY route is called but considered as a "failure_route"
`19(27) exec: *** cfgtrace:dbg_cfg_trace(): failure_route=[AUTH_REPLY] c=[/etc/kamailio/kamailio.cfg] l=665 a=16 n=if ` Do you see something that I am doing wrong or missing in my logic? Is pausing/resuming to use the async http client is allowed if I'm handling a REGISTER transaction?
Here's a simplified version of my routing block (not far from reality):
```
request_route{ route(AUTH);
route[AUTH]{ if (is_method("REGISTER"){ if(no_auth_header){ www_challenge("$td","1"); exit; } else{ t_newtran(); http_async_query("http://xxx.xxx.xxx.xxx:9000/auth?foo=bar", "AUTH_REPLY"); } } }
route[AUTH_REPLY]{ xlog("L_INFO", "route[HTTP_REPLY]: status $http_rs\n"); }
} ```
Best regards!
Closed #3009.
For questions regarding the use of Kamailio and its configuration file, send emails to sr-users@lists.kamailio.org. If it proves to be an issue in the code, then a bug can be reported here on this tracker.
Hello @miconda,
I tried sending an e-mail yesterday, and got no information in return, tried to subscribe to the list (that worked) and didn't see my message in the archive/provided link.
I will try to re-send my e-mail.
Thanks!