reformattable URQ statusport message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi again, there is small patch to allow reformatting of URQ status port message like RCF,.
we use it to se terminal name/aliases then terminal goes down.

Because i have no expirience with sgml i put doc section here in plain text, please include it in docs if patch is.
acceptable to include in upstream.


URQ=%{IP:Port}|%{Aliases}|%{Endpoint_Type}|%{EndpointID}|%{NATType}|%{Vendor}|%{EndpointRASAddr}|%{URQReason}
Default: N/A

The URQ event has the following parameters available:
IP:Port - IP and port the registration was detected on (external NAT address if behind NAT)
Aliases - Complete list of aliases for the registration
Endpoint_Type - Endpoint type (ie terminal,gateway) of the registered endpoint
EndpointID - endpoint id assigned to the registration
NATType - NAT Method of registration (ie Native,GnuGk,H.460.17,H.460.18 etc)
Vendor - Vendor information of the registering device
EndpointRASAddr - Endpoint RAS address
URQReason - Unregistration reason

Example:
 [GkStatus::Message]
  Compact=0
  URQ=%{IP:Port}|%{Aliases}|%{Endpoint_Type}|%{EndpointID}|%{NATType}|%{Vendor}|%{EndpointRASAddr}|%{URQReason}


C уважением                       With Best Regards
Георгиевский Юрий.                Georgiewskiy Yuriy
+7 4872 711666                    +7 4872 711666
факс +7 4872 711143               fax +7 4872 711143
Компания ООО "Ай Ти Сервис"       IT Service Ltd
http://nkoort.ru                  http://nkoort.ru
JID: GHhost@xxxxxxxxxx            JID: GHhost@xxxxxxxxxx
YG129-RIPE                        YG129-RIPE
diff -ruN openh323gk/gk.cxx openh323gk-new/gk.cxx
--- openh323gk/gk.cxx	2013-10-25 10:39:36.000000000 +0400
+++ openh323gk-new/gk.cxx	2013-10-25 15:43:42.993297986 +0400
@@ -283,6 +283,7 @@
 	{ "GkStatus::Filtering", "NewRCFOnly" },
 	{ "GkStatus::Message", "Compact" },
 	{ "GkStatus::Message", "RCF" },
+	{ "GkStatus::Message", "URQ" },
 	{ "LogFile", "Filename" },
 	{ "LogFile", "Rotate" },
 	{ "LogFile", "RotateDay" },
diff -ruN openh323gk/RasTbl.cxx openh323gk-new/RasTbl.cxx
--- openh323gk/RasTbl.cxx	2013-10-24 19:08:48.000000000 +0400
+++ openh323gk-new/RasTbl.cxx	2013-10-25 16:08:14.996495340 +0400
@@ -1015,10 +1015,29 @@
 	}
 #endif
 
-	PString msg(PString::Printf, "URQ|%s|%s|%s;\r\n", 
+	PString format = GkConfig()->GetString("GkStatus::Message", "URQ", "");
+	PString msg;
+	if (!format.IsEmpty()) {
+		bool compact = Toolkit::AsBool(GkConfig()->GetString("GkStatus::Message", "Compact", "0")); 
+		std::map<PString, PString> params;
+		params["IP:Port"] = AsDotString(GetCallSignalAddress());
+		params["Aliases"] = AsString(GetAliases());
+		params["Endpoint_Type"] = AsString(GetEndpointType());
+		params["EndpointID"] = GetEndpointIdentifier().GetValue();
+		params["NATType"] = PrintNatInfo(!compact);
+		params["EndpointRASAddr"] = AsDotString(GetRasAddress());
+		params["URQReason"] = urq.m_reason.GetTagName();
+		PString vendor, version;
+		GetEndpointInfo(vendor, version);
+		params["Vendor"] = vendor + version;
+		msg = "URQ|"+ ReplaceParameters(format, params);
+	} else {
+		PString msg(PString::Printf, "URQ|%s|%s|%s;\r\n", 
 			(const unsigned char *) AsDotString(GetRasAddress()),
 			(const unsigned char *) GetEndpointIdentifier().GetValue(),
 			(const unsigned char *) urq.m_reason.GetTagName());
+	}
+        
         GkStatus::Instance()->SignalStatus(msg, STATUS_TRACE_LEVEL_RAS);
 
 	RasSrv->ForwardRasMsg(ras_msg);
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux