One of the most useful features of the dialog module is the dialog validation. There are some cases where this can be very useful. It can prevent malicious BYEs to close dialogs without disconnecting the call causing billing problems and other injected in-dialog requests. The function used to perform dialog validation is validate_dialog()
and the result codes are displayed here:
1
: Dialog exists and is valid-1
: Invalid cseq-2
: Invalid remote target-3
: Invalid route set-4
: Other errors (parsing, no dlg, and so on)
There are cases where a UAS sends a reply with invalid information in the headers. You can fix these headers based on the dialog information stored in the memory using the fix_route_dialog()
function. This function recovers and fixes the RURI and Route headers and the destination URI using the data stored previously in the memory for the current dialog. The typical code for validation is as follows:
if (has_totag()) { loose_route...