[kamailio/kamailio] dialog: set $rs when failed TCP send (#2867)
### 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
Thanks for the report. So you are saying that the $rs is not working for locally generated replies (e.g. the 408) in the dialog:failued route in all cases or only when you use TCP transport? -- 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#issuecomment-933506200
The $rs is for incoming SIP reply processing, no relation with tm or dialog module and I would keep it like that. If event_route[dialog:failed] happens in the context of transmission error and the transaction fails, then you should be able to use $T(reply_code). So it should provide what you look for in this particular case. Otherwise, event_route[dialog:failed] can be also executed with an internal faked msg, if it happens to be executed when no SIP traffic is handled. You can eventually add a new attribute for $dlg_ctx(): * https://www.kamailio.org/wiki/cookbooks/5.5.x/pseudovariables#dlg_ctx_attr And you set its value based on whether a reply was received from the network, transaction failed and value of $T(reply_code) should be used, etc. -- 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#issuecomment-938443325
Closed #2867 as completed. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2867#event-7268049697 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issue/2867/issue_event/7268049697@github.com>
Closing it due to long inactivity time. A PR can be made if someone decides to implement it. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/2867#issuecomment-1228547994 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/issues/2867/1228547994@github.com>
participants (3)
-
Daniel-Constantin Mierla -
Henning Westerholt -
sergey-safarov