Hi,
since you are not suspending the transaction ($http_req(suspend) = 0) you cannot reference the transaction itself in the http reply route. 
Nothing about the transaction has been stored, the transaction continued to be processed in the main route and might have already finished by the moment the http reply is received.
If you want to send a reply to a transaction after an http reply you need to suspend it.

Cheers,

Federico


On Sat, Apr 27, 2024 at 12:10 PM Masud Muborakshohi via sr-users <sr-users@lists.kamailio.org> wrote:
Hello!
I have a problem when sending a response sl_send_reply("415", "The other party does not support video calling!"); in route[HTTP_REPLY].
When I make a request using http_async_query() to send a push notification to a mobile device, I need to process the response from the push server and respond with a SIP message to the client. Before sending the request I do $http_req(suspend) = 0;
What am I doing wrong? Why are $fU and $ru equal to null ?
#processing HTTP responses
route[HTTP_REPLY] {
     if ($http_ok && $http_rs == 200) {
         xlog("L_INFO", "route[HTTP_REPLY]: status $http_rs\n");
         xlog("L_INFO", "route[HTTP_REPLY]: body $http_rb\n");
     } else if($http_rs == 415 || $http_rs == "415") {
         xlog("L_ERR", "route[HTTP_REPLY]: caller: $fU phone: $ru error: $http_err)\n");
         send_reply("415", "The other party does not support video calling!");
     } else {
         xlog("L_ALERT", "route[HTTP_REPLY]: error $http_err)\n");
    }
     #exit;
}
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: