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

Alex Massover alex at jajah.com
Thu Jan 15 09:07:10 CET 2009


That's really cool feature!

--
Best Regards,
Alex Massover

-----Original Message-----
From: devel-bounces at lists.opensips.org [mailto:devel-bounces at lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
Sent: Wednesday, January 14, 2009 8:57 PM
To: users at lists.opensips.org; devel at lists.opensips.org
Subject: [OpenSIPS-Devel] [NEW] Per-dialog flags and attributes

Hi,

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);



Ex:

....
if (is_method("INVITE") {
        store_dlg_value("real_caller","$hdr(p-asserted-identity)");
};
....
if (is_method("BYE") {
        xlog("real caller for this BYE is $dlg_val(real_caller)");
};
...


Regards,
Bogdan


_______________________________________________
Devel mailing list
Devel at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel



******************************************************************************

 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.

******************************************************************************




******************************************************************************
 This footnote confirms that this email message has been scanned by Jajah Inc. Mail system for the presence of malicious code, vandals & computer viruses.
******************************************************************************



More information about the Users mailing list