tm_user.sgml

来自「性能优秀的SIP Proxy」· SGML 代码 · 共 1,224 行 · 第 1/3 页

SGML
1,224
字号
		</para>		<example>		<title>Set <varname>unix_tx_timeout</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "unix_tx_timeout", 5)...</programlisting>		</example>	</section>	<section>		<title><varname>restart_fr_on_each_reply</varname> (integer)</title>		<para>		If true (non null value), the final response timer will be re-triggered		for each received provisional reply. In this case, final response		timeout may occure after a time longe than fr_inv_timer (if UAS keeps		sending provisional replies)		</para>		<para>		<emphasis>			Default value is 1 (true).		</emphasis>		</para>		<example>		<title>Set <varname>restart_fr_on_each_reply</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "restart_fr_on_each_reply", 0)...</programlisting>		</example>	</section>	<section>		<title><varname>fr_timer_avp</varname> (string)</title>		<para>		Full specification (NAME, ID, Alias) of an AVP which contains a final		response timeout value. If present, ths value will overeide the 		static fr_timer parameter.		</para>		<para>		If set to empty string, the whole mechanism for variable timeout will		be disabled, falling back to the static value.		</para>		<para>		<emphasis>			Default value is "callee_fr_timer".		</emphasis>		</para>		<example>		<title>Set <varname>fr_timer_avp</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "fr_timer_avp", "i:24")...</programlisting>		</example>	</section>	<section>		<title><varname>fr_inv_timer_avp</varname> (string)</title>		<para>		Full specification (NAME, ID, Alias) of an AVP which contains a final		INVITE response timeout value. If present, ths value will overeide the 		static fr_inv_timer parameter.		</para>		<para>		If set to empty string, the whole mechanism for variable timeout will		be disabled, falling back to the static value.		</para>		<para>		<emphasis>			Default value is "callee_fr_inv_timer".		</emphasis>		</para>		<example>		<title>Set <varname>fr_inv_timer_avp</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "fr_inv_timer_avp", "i:25")...</programlisting>		</example>	</section>	<section>		<title><varname>tw_append</varname> (string)</title>		<para>		List of additional information to be appended by t_write_fifo and		t_write_unix functions.		</para>		<para>		<emphasis>			Default value is null string.		</emphasis>		</para>		<para>		Syntax of the parameter is:		<itemizedlist>			<listitem><para><emphasis>			tw_append = append_name':' element (';'element)*			</emphasis></para></listitem>			<listitem><para><emphasis>			element = ( [name '='] pseudo_variable)			</emphasis></para></listitem>		</itemizedlist>		</para>		<para>		The full list of supported pseudo-variables in &ser; is availabe at: 		<ulink url="http://openser.org/docs/pseudo-variables.html-1.1.x">		http://openser.org/docs/pseudo-variables-1.1.x.html</ulink>		</para>		<para>		Each element will be appended per line in 		<quote>name: value</quote> format. Element 		<quote>$rb (message body)</quote>		is the only one which does not accept name; the body it will be		printed all the time at the end, disregarding its position in the		definition string.		</para>		<example>		<title>Set <varname>tw_append</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "tw_append",   "test: ua=$hdr(User-Agent) ;avp=$avp(i:10);$rb;time=$Ts")...</programlisting>		</example>	</section>	<section id="branch-flag-mask">		<title><varname>branch_flag_mask</varname> (string)</title>		<para>		Defined which flags shall be as branch flags. The branch flags will be		visible only in the messages belonging to that branch (in branch, 		onreply and failure route). The global flags are visible for all 		messages of the corresponding transaction.		</para>		<para>		The value of the parameter is a 32-bits mask. It may be defined using		2, 10 or 16 bases.		</para>		<para>		<emphasis>			Default value is NULL (no branch flags, all being global).		</emphasis>		</para>		<example>		<title>Set <varname>branch_flag_mask</varname> parameter</title>		<programlisting format="linespecific">...# using base 16modparam("tm", "branch_flag_mask", "0xff000000")# or using base 2modparam("tm", "branch_flag_mask", "b11111111000000000000000000000000")# or using base 10modparam("tm", "branch_flag_mask", "4278190080")...</programlisting>		</example>	</section>	<section>		<title><varname>pass_provisional_replies</varname> (integer)</title>		<para>		Enable/disable passing of provisional replies to FIFO applications.		</para>		<para>		<emphasis>			Default value is 0.		</emphasis>		</para>		<example>		<title>Set <varname>pass_provisional_replies</varname> parameter</title>		<programlisting format="linespecific">...modparam("tm", "pass_provisional_replies", 1)...</programlisting>		</example>	</section>	</section>	<section>	<title>Exported Functions</title>	<section>		<title>		<function moreinfo="none">t_newtran()</function>		</title>		<para>		Creates a new transaction, returns a negative value on error. This is 		the only way a script can add a new transaction in an atomic way. 		Typically, it is used to deploy a &uas;.		</para>		<warning>			<para>			NOTE that the changes on the request that are made after this 			function call will not be saved into transaction!!!			</para>		</warning>		<para>		This function can be used from REQUEST_ROUTE.		</para>		<example>		<title><function>t_newtran</function> usage</title>		<programlisting format="linespecific">...if (t_newtran()) { 	log("UAS logic"); 	t_reply("999","hello"); } else sl_reply_error();...</programlisting>		</example>	</section>	<section>		<title>		<function moreinfo="none">t_lookup_request()</function>		</title>		<para>		Checks if a transaction exists. Returns a positive value if so, 		negative otherwise. Most likely you will not want to use it, as a 		typical application of a looku-up is to introduce a new transaction if 		none was found. However this is safely (atomically) done using 		<function>t_newtran</function>.		</para>		<para>		This function can be used from REQUEST_ROUTE.		</para>		<example>		<title><function>t_lookup_request</function> usage</title>		<programlisting format="linespecific">...if (t_lookup_request()) {	...};...</programlisting>		</example>	</section>	<section id="trelay-1">		<title>		<function moreinfo="none">t_relay(proto:host:port)</function>,		</title>		<para>		Relay a message statefully to a fixed destination. The destination is		specified as <quote>[proto:]host[:port]</quote>.		</para>		<para>		This functions can be used from REQUEST_ROUTE, FAILURE_ROUTE.		</para>		<example>		<title><function>t_relay</function> usage</title>		<programlisting format="linespecific">...t_relay("tcp:192.168.1.10:5060");t_relay("mydomain.com:5070");t_relay("udp:mydomain.com");...</programlisting>		</example>	</section>	<section>		<title>		<function moreinfo="none">t_relay()</function>		</title>		<para>		Relay a message statefully to destination indicated in current URI. 		(If the original URI was rewritten by UsrLoc, RR, strip/prefix, etc., 		the new URI will be taken). Returns a negative value on failure--you 		may still want to send a negative reply upstream statelessly not to 		leave upstream UAC in lurch.		</para>		<para>		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.		</para>		<example>		<title><function>t_relay</function> usage</title>		<programlisting format="linespecific">...if (!t_relay()) { sl_reply_error(); break; };...</programlisting>		</example>	</section>	<section id="tforwardnonack">		<title>		<function moreinfo="none">t_forward_nonack()</function>		<function moreinfo="none">t_forward_nonack(proto:host:port)</function>		</title>		<para>		Similar to t_relay() but it expects the transaction to be already		created - this why it cannot handle ACK (which are statelessly		forwarded). It should be used along with t_newtran().		</para>		<para>		The destination is specified either as parameter ( in 		<quote>[proto:]host[:port]</quote> format), either is taken from		the current URI.		</para>		<para>		This functions can be used from REQUEST_ROUTE.		</para>		<example>		<title><function>t_forward_nonack</function> usage</title>		<programlisting format="linespecific">...t_forward_nonack("tcp:1.2.3.4:5060");t_forward_nonack("udp:1.2.3.4");t_forward_nonack();         # use RURI for destination...</programlisting>		</example>	</section>	<section>		<title>		<function moreinfo="none">t_reply(code, reason_phrase)</function>		</title>		<para>		Sends a stateful reply after a transaction has been established. See		<function>t_newtran</function> for usage.		</para>		<para>Meaning of the parameters is as follows:</para>		<itemizedlist>		<listitem>			<para><emphasis>code</emphasis> - Reply code number.			</para>		</listitem>		<listitem>			<para><emphasis>reason_phrase</emphasis> - Reason string.			</para>		</listitem>		</itemizedlist>		<para>		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.		</para>		<example>		<title><function>t_reply</function> usage</title>		<programlisting format="linespecific">...t_reply("404", "Not found");...</programlisting>		</example>	</section>	<section>		<title>		<function moreinfo="none">t_retransmit_reply()</function>		</title>		<para>		Retransmits a reply sent previously by &uas; transaction.		</para>		<para>		This function can be used from REQUEST_ROUTE, FAILURE_ROUTE and		BRANCH_ROUTE.		</para>		<example>		<title><function>t_retransmit_reply</function> usage</title>		<programlisting format="linespecific">...t_retransmit_reply();...</programlisting>		</example>	</section>	<section id="treplicate">		<title>		<function moreinfo="none">t_replicate(URI)</function>		</title>		<para>		Replicates a request to another destination. No information due the		replicated request (like reply code) will be forwarded to the 		original SIP UAC.		</para>		<para>		The destination is specified by a SIP URI. If multiple destinations are		to be used, the additional SIP URIs have to be set as branches.		</para>		<para>		This functions can be used from REQUEST_ROUTE.		</para>		<example>		<title><function>t_replicate</function> usage</title>		<programlisting format="linespecific">...t_replicate("sip:1.2.3.4:5060");t_replicate("sip:1.2.3.4:5060;transport=tcp");t_replicate("sip:1.2.3.4");...</programlisting>		</example>	</section>	<section>		<title>		<function moreinfo="none">t_release()</function>		</title>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?