Klaus Darilion wrote:
Btw: how are dialogs in dialog module and transactions in tm module are exactly identified? For example a response with proper callid and fromtag but faked Via branch, will it be accepted by dialog module but ignored (drop or stateless forwarding) by tm?
Good question. IMHO it should be discarded as TM and dialog level (and not relayed stateless).
The dialog module handles responses in the dlg_onreply() function which is called by the tm module when the TMCB_RESPONSE_PRE_OUT (named TMCB_RESPONSE_READY in 3.x) tm callback is triggered.
If dialog module receives this callback - will it check fromtag/callid or is the dialog already identified by the callback?
The latter is true: The dialog module does not need to check the dialog identifier (From-tag, To-Tag, Call-ID) because the dialog that the response is associated with will be given as one of the callback parameters. When the dlg_onreq() function initially established the dialog, it passed a pointer to the dialog data-structure (dlg_cell *) to the callback registration function for TMCB_RESPONSE_PRE_OUT.
The whole effort of matching dialogs (including the dialog identifier) is only done in dlg_onroute() which is called for every loose_route'ed message, i.e., in-dialog request.
Cheers,
--Timo