[OpenSIPS-Devel] [NEW] Per-dialog flags and attributes

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Jan 14 19:57:18 CET 2009


The dialog module from OpenSIPS 1.5 provides now new features, like the possibility to have flags and attributes persistent across the entire dialog. These flags and attributes can be operated during the whole dialog life.

They can be used to store information across the dialog, without relying on the SIP signalling itself (like storing info in RR headers, or contact, etc). When processing the original INVITE, you can store in the dialog all the info you learned and use it later at re-INVITEs or BYE requests. Information like NAT status, accounting type, uids of involved parties, etc.

1) dialog persistent flags
Available functions:
	- set_dlg_flag("n");
	- reset_dlg_flag("n");
	- is_dlg_flag_set("n");
Available PVs:
	- $DLG_flags  (can be used directly from script via bitwise ops)

2) dialog persistent attributes. These attribute are visible for all the requests that belong to the sae dialog; they can be manipulated (added,fetched) during the dialog lifetime.
Available functions:
	- store_dlg_value("attr_name","attr_val");  // attr_val may contain PVs
	- fetch_dlg_value("attr_name","pv");  // pv is $var or $avp
Available PVs:
	- $dlg_val(attr_name);  // set and get capabilities

store_dlg_value("attr_name","some_string") is the same with $dlg_val(attr_name) = "some_string";

fetch_dlg_value("attr_name","$var(x)") is the same with $var(x) = $dlg_val(attr_name);


if (is_method("INVITE") {
if (is_method("BYE") {
	xlog("real caller for this BYE is $dlg_val(real_caller)");


More information about the Devel mailing list