[sr-dev] [kamailio/kamailio] dialog: set $rs when failed TCP send (#2867)

sergey-safarov notifications at github.com
Fri Oct 1 16:48:56 CEST 2021


### Description

I use TCP transport to relay SIP messages.
When Kamailio cannot connect to another server then Kamailio generates response `408 Request Timeout`.
inside `event_route[dialog:failed]` route block I check error code `$rs` but this value is `null`.
This happens because Kamailio does not able to relay SIP messages and is not able to receive responses.
But `tm` module generates a response `408 Request Timeout` and will be fine to init `$rs` pseudo-variable using tm module response.

### Expected behavior
`$rs` pseudo-variable contains `tm` module response when kamailio does not receive a response from another server.

#### Actual observed behavior
`$rs` pseudo-variable contains `null` value when kamailio does not receive a response from another server.

To check you can use 
```
event_route[dialog:failed]
{
    $var(code_xxx) = $(rs{re.subst,/([0-9])[0-9]{2}/\1xx/});
    xlog("L_INFO", "websocket|log|dialog failed $rs; $var(code_xxx)\n");
}
```
And relay SIP message to host that reachable.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2867
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211001/fd20a230/attachment.htm>


More information about the sr-dev mailing list