This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorials:faq:main [2017/08/14 10:27] miconda |
tutorials:faq:main [2018/01/12 16:32] miconda [Configuration File Processing] |
||
---|---|---|---|
Line 553: | Line 553: | ||
However, if return code is 0, the next action after function() is not executed. It can be used only of positive or negative response code. | However, if return code is 0, the next action after function() is not executed. It can be used only of positive or negative response code. | ||
+ | |||
+ | ??? How is the SIP request retransmission handled? | ||
+ | |||
+ | !!! The next snippet is detecting retransmissions: | ||
+ | |||
+ | <code c> | ||
+ | # handle retransmissions | ||
+ | if (!is_method(" | ||
+ | if(t_precheck_trans()) { | ||
+ | t_check_trans(); | ||
+ | exit; | ||
+ | } | ||
+ | t_check_trans(); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The **ACK** request is skipped because it doesn' | ||
+ | |||
+ | The function **t_precheck_trans()** returns true if the same SIP request is processed at that time by another Kamailio process, so in this case it is a retransmission. The inner **t_check_trans()** has the role of detecting if the SIP transaction was created by the other process, and if yes, send again the last SIP response of the transaction, | ||
+ | |||
+ | If the function **t_precheck_trans()** returns false, the SIP request is not under processing by another Kamailio process, but it can be the case that the request processing was finished, request being sent out in stateful mode, therefore **t_check_trans()** is used to see if a transaction is found in shared memory corresponding to the same request. If such transaction is found in shared memory, then **t_check_trans()** triggers internally the **exit** for configuration file execution. | ||
=?==== Troubleshooting ===== | =?==== Troubleshooting ===== | ||