I'm am attempting to return a 503 "Service Unavailable" after my kamailio server sends the provisional response to customer UA if we cannot find a route for the call. I am using:
t_reply("503", "Service Unavailable");
However this results in:
ERROR:tm:w_t_reply: failed to send a t_reply to a message for which no transaction-state has been established
Reading up on t_reply, it clearly states: "Sends a stateful reply after a transaction has been established." So, I guess thats means even though we have received the invite, and send 100 Trying back, a transaction does not actually exist.
So, my question is, how do I tell the sending UAC that we are 5XX so that it can stop sitting there waiting for session progress?
Thanks for any help.
David
On Sat, Apr 11, 2009 at 12:53 PM, David Aldworth daldworth@teliax.com wrote:
I'm am attempting to return a 503 "Service Unavailable" after my kamailio server sends the provisional response to customer UA if we cannot find a route for the call. I am using:
t_reply("503", "Service Unavailable");
However this results in:
ERROR:tm:w_t_reply: failed to send a t_reply to a message for which no transaction-state has been established
Reading up on t_reply, it clearly states: "Sends a stateful reply after a transaction has been established." So, I guess thats means even though we have received the invite, and send 100 Trying back, a transaction does not actually exist.
So, my question is, how do I tell the sending UAC that we are 5XX so that it can stop sitting there waiting for session progress?
Hello, you can send the reply statelessly: sl_send_reply("503", "Service Unavailable" );
or statefully: t_newtran(); t_reply("503", "Service Unavailable");
Before you can use t_reply, a transaction must be established. This can be done explicitly calling t_newtran() or it will be do internally by other functions like t_relay.
regards, takeshi.
David Aldworth writes:
kamailio server sends the provisional response to customer UA if we cannot find a route for the call. I am using:
t_reply("503", "Service Unavailable");
However this results in:
ERROR:tm:w_t_reply: failed to send a t_reply to a message for which no transaction-state has been established
use
send_reply("503", "Service Unavailable");
it works no matter if transaction exists or not. unfortunately corresponding reply_error() does not exist.
-- juha
I put this in:
if (t_check_trans()) { t_reply("503", "Service Unavailable"); } else { sl_send_reply("503", "Service Unavailable"); }
And it seems to work fine. But I suppose send_reply would be much simpler... :-)
On Apr 10, 2009, at 10:43 PM, Juha Heinanen wrote:
David Aldworth writes:
kamailio server sends the provisional response to customer UA if we cannot find a route for the call. I am using:
t_reply("503", "Service Unavailable");
However this results in:
ERROR:tm:w_t_reply: failed to send a t_reply to a message for which no transaction-state has been established
use
send_reply("503", "Service Unavailable");
it works no matter if transaction exists or not. unfortunately corresponding reply_error() does not exist.
-- juha