{"action":"created","issue":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/1726","repository_url":"https://api.github.com/repos/kamailio/kamailio","labels_url":"https://api.github.com/repos/kamailio/kamailio/issues/1726/labels{/name}","comments_url":"https://api.github.com/repos/kamailio/kamailio/issues/1726/comments","events_url":"https://api.github.com/repos/kamailio/kamailio/issues/1726/events","html_url":"https://github.com/kamailio/kamailio/pull/1726","id":381671121,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNTg2Mjc1","number":1726,"title":"tmx: add t_drop","user":{"login":"lazedo","id":770988,"node_id":"MDQ6VXNlcjc3MDk4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/770988?v=4","gravatar_id":"","url":"https://api.github.com/users/lazedo","html_url":"https://github.com/lazedo","followers_url":"https://api.github.com/users/lazedo/followers","following_url":"https://api.github.com/users/lazedo/following{/other_user}","gists_url":"https://api.github.com/users/lazedo/gists{/gist_id}","starred_url":"https://api.github.com/users/lazedo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazedo/subscriptions","organizations_url":"https://api.github.com/users/lazedo/orgs","repos_url":"https://api.github.com/users/lazedo/repos","events_url":"https://api.github.com/users/lazedo/events{/privacy}","received_events_url":"https://api.github.com/users/lazedo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-11-16T16:29:16Z","updated_at":"2018-12-03T23:10:52Z","closed_at":"2018-12-03T19:55:44Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/kamailio/kamailio/pulls/1726","html_url":"https://github.com/kamailio/kamailio/pull/1726","diff_url":"https://github.com/kamailio/kamailio/pull/1726.diff","patch_url":"https://github.com/kamailio/kamailio/pull/1726.patch"},"body":"<!-- Kamailio Pull Request Template -->\r\n\r\n<!--\r\nIMPORTANT:\r\n  - for detailed contributing guidelines, read:\r\n    https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md\r\n  - pull requests must be done to master branch, unless they are backports\r\n    of fixes from master branch to a stable branch\r\n  - backports to stable branches must be done with 'git cherry-pick -x ...'\r\n  - code is contributed under BSD for core and main components (tm, sl, auth, tls)\r\n  - code is contributed GPLv2 or a compatible license for the other components\r\n  - GPL code is contributed with OpenSSL licensing exception\r\n-->\r\n\r\n#### Pre-Submission Checklist\r\n<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->\r\n<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->\r\n<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->\r\n- [X] Commit message has the format required by CONTRIBUTING guide\r\n- [X] Commits are split per component (core, individual modules, libs, utils, ...)\r\n- [X] Each component has a single commit (if not, squash them into one commit)\r\n- [X] No commits to README files for modules (changes must be done to docbook files\r\nin `doc/` subfolder, the README file is autogenerated)\r\n\r\n#### Type Of Change\r\n- [ ] Small bug fix (non-breaking change which fixes an issue)\r\n- [X] New feature (non-breaking change which adds new functionality)\r\n- [ ] Breaking change (fix or feature that would change existing functionality)\r\n\r\n#### Checklist:\r\n<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->\r\n- [ ] PR should be backported to stable branches\r\n- [X] Tested changes locally\r\n- [ ] Related to issue #XXXX (replace XXXX with an open issue number)\r\n\r\n#### Description\r\n<!-- Describe your changes in detail -->\r\n\r\nwe have a use case where we need to drop the request within a transaction, and that is not possible because tm module will always send the final reply.\r\n\r\n```\r\nroute[MYREQ]\r\n{\r\n    ## protect from retrans\r\n    if (!t_newtran()) {\r\n        xlog(\"L_ERROR\", \"$ci|log|failed to create transaction\\n\");\r\n        drop;\r\n    }\r\n\r\n    if(some early business use case that requires drop) {\r\n        xlog(\"L_INFO\", \"$ci|log|dropping request\\n\");\r\n        t_drop();\r\n    }\r\n\r\n    async_func_that_suspends_and_continues(\"$anyparam\", \"TR_OK\", \"TR_ERROR\");\r\n\r\n}\r\n\r\nfailure_route[TR_ERROR]\r\n{\r\n    xlog(\"L_INFO\", \"$ci|log|failed $T_reply_code $T_reply_reason\\n\");\r\n    t_drop();\r\n}\r\n\r\nonreply_route[TR_OK]\r\n{\r\n    xlog(\"L_INFO\", \"$ci|log|checking transaction result\\n\");\r\n   if(some business use case that requires dropping the request) {\r\n      t_drop();\r\n   }\r\n...\r\n}\r\n```\r\nif we use `drop` instead of `t_drop` , we always get a final reply sent to the requestor\r\n\r\nnot sure if this is the right approach to the problem but at least fixes for us and can start the discussion.\r\n"},"comment":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/comments/443906127","html_url":"https://github.com/kamailio/kamailio/pull/1726#issuecomment-443906127","issue_url":"https://api.github.com/repos/kamailio/kamailio/issues/1726","id":443906127,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzkwNjEyNw==","user":{"login":"lazedo","id":770988,"node_id":"MDQ6VXNlcjc3MDk4OA==","avatar_url":"https://avatars0.githubusercontent.com/u/770988?v=4","gravatar_id":"","url":"https://api.github.com/users/lazedo","html_url":"https://github.com/lazedo","followers_url":"https://api.github.com/users/lazedo/followers","following_url":"https://api.github.com/users/lazedo/following{/other_user}","gists_url":"https://api.github.com/users/lazedo/gists{/gist_id}","starred_url":"https://api.github.com/users/lazedo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazedo/subscriptions","organizations_url":"https://api.github.com/users/lazedo/orgs","repos_url":"https://api.github.com/users/lazedo/repos","events_url":"https://api.github.com/users/lazedo/events{/privacy}","received_events_url":"https://api.github.com/users/lazedo/received_events","type":"User","site_admin":false},"created_at":"2018-12-03T23:10:52Z","updated_at":"2018-12-03T23:10:52Z","author_association":"CONTRIBUTOR","body":"@miconda thanks"}}
{"actor":{"display_login":"lazedo"}}