<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://docs.telcobridges.com/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://docs.telcobridges.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Song+tao+xie</id>
		<title>TBwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://docs.telcobridges.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Song+tao+xie"/>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Special:Contributions/Song_tao_xie"/>
		<updated>2026-04-10T21:02:54Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.18.1</generator>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-25T16:33:15Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
== Configuration: ==&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
== Usage: ==&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #if hash value begins with matchandreplace, it means the header has several possible values&lt;br /&gt;
    #we will try to compare the received value with settings and use the corresponding replacement&lt;br /&gt;
    #the following settings for P-Early-Media means if the received value includes string inactive, JF will be used as header value,&lt;br /&gt;
    #if the received value includes string sendrecv, inactive will be used as header value&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #we also support regex for replacing header value, the format is &amp;quot;regex:pattern|stringtouse&amp;quot;&lt;br /&gt;
    #the setting example is like  call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;regex:pattern|JF&amp;quot;&lt;br /&gt;
    #it means if the pattern exists in the received value, all the occurrences of pattern will be replaced by string JF&lt;br /&gt;
    #don't like &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;, we don't support several possible patterns for now&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot; &lt;br /&gt;
    &lt;br /&gt;
    call[&amp;quot;behaviorrbt&amp;quot;] = {}&lt;br /&gt;
    #if set call[&amp;quot;behaviorrbt&amp;quot;][&amp;quot;18x&amp;quot;] as 'no', sbc will not generate ring back tone&lt;br /&gt;
    call[&amp;quot;behaviorrbt&amp;quot;][&amp;quot;18x&amp;quot;] = &amp;quot;yes&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
  params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
== Limitations: ==&lt;br /&gt;
&lt;br /&gt;
# 'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see example below.&lt;br /&gt;
# Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
# If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
# Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
# SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Headers that cannot be used in 'SIP headers manipulation': ===&lt;br /&gt;
  Accept&lt;br /&gt;
  Accept-Contact&lt;br /&gt;
  Accept-Encoding&lt;br /&gt;
  Accept-Language&lt;br /&gt;
  Alert-Info&lt;br /&gt;
  Allow&lt;br /&gt;
  Allow-Events&lt;br /&gt;
  Also&lt;br /&gt;
  Anonymity&lt;br /&gt;
  Authentication-Info&lt;br /&gt;
  Authorization&lt;br /&gt;
  Call-ID&lt;br /&gt;
  Call-Info&lt;br /&gt;
  Contact&lt;br /&gt;
  Content-Disposition&lt;br /&gt;
  Content-Encoding&lt;br /&gt;
  Content-Language&lt;br /&gt;
  Content-Length&lt;br /&gt;
  Content-Type&lt;br /&gt;
  CSeq&lt;br /&gt;
  Date&lt;br /&gt;
  Encryption&lt;br /&gt;
  Error-Info&lt;br /&gt;
  Event&lt;br /&gt;
  Expires&lt;br /&gt;
  From&lt;br /&gt;
  In-Reply-To&lt;br /&gt;
  Max-Forwards&lt;br /&gt;
  MIME-version&lt;br /&gt;
  Min-Expires&lt;br /&gt;
  Min-SE&lt;br /&gt;
  Organization&lt;br /&gt;
  P-Asserted-Identity&lt;br /&gt;
  P-Media-Authorization&lt;br /&gt;
  P-Preferred-Identity&lt;br /&gt;
  Priority&lt;br /&gt;
  Privacy&lt;br /&gt;
  Proxy-Authenticate&lt;br /&gt;
  Proxy-Authorization&lt;br /&gt;
  Proxy-Require&lt;br /&gt;
  RAck&lt;br /&gt;
  Reason&lt;br /&gt;
  Record-Route&lt;br /&gt;
  Refer-To&lt;br /&gt;
  Referred-By&lt;br /&gt;
  Reject-Contact&lt;br /&gt;
  Remote-Party-ID&lt;br /&gt;
  Replaces&lt;br /&gt;
  Reply-To&lt;br /&gt;
  Request-Disposition&lt;br /&gt;
  Require&lt;br /&gt;
  Response-Key&lt;br /&gt;
  Retry-After&lt;br /&gt;
  Route&lt;br /&gt;
  RPID-Privacy&lt;br /&gt;
  RSeq&lt;br /&gt;
  Security-Client&lt;br /&gt;
  Security-Server&lt;br /&gt;
  Security-Verify&lt;br /&gt;
  Server&lt;br /&gt;
  Service-Route&lt;br /&gt;
  Session-Expires&lt;br /&gt;
  Subject&lt;br /&gt;
  Subscription-State&lt;br /&gt;
  Supported&lt;br /&gt;
  Timestamp&lt;br /&gt;
  To&lt;br /&gt;
  Unsupported&lt;br /&gt;
  User-Agen&lt;br /&gt;
  Via&lt;br /&gt;
  Warning&lt;br /&gt;
  WWW-Authenticate&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-25T16:16:49Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
== Configuration: ==&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
== Usage: ==&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #if hash value begins with matchandreplace, it means the header has several possible values&lt;br /&gt;
    #we will try to compare the received value with settings and use the corresponding replacement&lt;br /&gt;
    #the following settings for P-Early-Media means if the received value includes string inactive, JF will be used as header value,&lt;br /&gt;
    #if the received value includes string sendrecv, inactive will be used as header value&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #we also support regex for replacing header value, the format is &amp;quot;regex:pattern|stringtouse&amp;quot;&lt;br /&gt;
    #the setting example is like  call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;regex:pattern|JF&amp;quot;&lt;br /&gt;
    #it means if the pattern exists in the received value, all the occurrences of pattern will be replaced by string JF&lt;br /&gt;
    #don't like &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;, we don't support several possible patterns for now&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot; &lt;br /&gt;
    &lt;br /&gt;
    call[&amp;quot;behaviorrbt&amp;quot;] = {}&lt;br /&gt;
    call[&amp;quot;behaviorrbt&amp;quot;][&amp;quot;18x&amp;quot;] = &amp;quot;yes&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
  params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
== Limitations: ==&lt;br /&gt;
&lt;br /&gt;
# 'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see example below.&lt;br /&gt;
# Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
# If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
# Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
# SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Headers that cannot be used in 'SIP headers manipulation': ===&lt;br /&gt;
  Accept&lt;br /&gt;
  Accept-Contact&lt;br /&gt;
  Accept-Encoding&lt;br /&gt;
  Accept-Language&lt;br /&gt;
  Alert-Info&lt;br /&gt;
  Allow&lt;br /&gt;
  Allow-Events&lt;br /&gt;
  Also&lt;br /&gt;
  Anonymity&lt;br /&gt;
  Authentication-Info&lt;br /&gt;
  Authorization&lt;br /&gt;
  Call-ID&lt;br /&gt;
  Call-Info&lt;br /&gt;
  Contact&lt;br /&gt;
  Content-Disposition&lt;br /&gt;
  Content-Encoding&lt;br /&gt;
  Content-Language&lt;br /&gt;
  Content-Length&lt;br /&gt;
  Content-Type&lt;br /&gt;
  CSeq&lt;br /&gt;
  Date&lt;br /&gt;
  Encryption&lt;br /&gt;
  Error-Info&lt;br /&gt;
  Event&lt;br /&gt;
  Expires&lt;br /&gt;
  From&lt;br /&gt;
  In-Reply-To&lt;br /&gt;
  Max-Forwards&lt;br /&gt;
  MIME-version&lt;br /&gt;
  Min-Expires&lt;br /&gt;
  Min-SE&lt;br /&gt;
  Organization&lt;br /&gt;
  P-Asserted-Identity&lt;br /&gt;
  P-Media-Authorization&lt;br /&gt;
  P-Preferred-Identity&lt;br /&gt;
  Priority&lt;br /&gt;
  Privacy&lt;br /&gt;
  Proxy-Authenticate&lt;br /&gt;
  Proxy-Authorization&lt;br /&gt;
  Proxy-Require&lt;br /&gt;
  RAck&lt;br /&gt;
  Reason&lt;br /&gt;
  Record-Route&lt;br /&gt;
  Refer-To&lt;br /&gt;
  Referred-By&lt;br /&gt;
  Reject-Contact&lt;br /&gt;
  Remote-Party-ID&lt;br /&gt;
  Replaces&lt;br /&gt;
  Reply-To&lt;br /&gt;
  Request-Disposition&lt;br /&gt;
  Require&lt;br /&gt;
  Response-Key&lt;br /&gt;
  Retry-After&lt;br /&gt;
  Route&lt;br /&gt;
  RPID-Privacy&lt;br /&gt;
  RSeq&lt;br /&gt;
  Security-Client&lt;br /&gt;
  Security-Server&lt;br /&gt;
  Security-Verify&lt;br /&gt;
  Server&lt;br /&gt;
  Service-Route&lt;br /&gt;
  Session-Expires&lt;br /&gt;
  Subject&lt;br /&gt;
  Subscription-State&lt;br /&gt;
  Supported&lt;br /&gt;
  Timestamp&lt;br /&gt;
  To&lt;br /&gt;
  Unsupported&lt;br /&gt;
  User-Agen&lt;br /&gt;
  Via&lt;br /&gt;
  Warning&lt;br /&gt;
  WWW-Authenticate&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-16T12:14:47Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
== Configuration: ==&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
== Usage: ==&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #if hash value begins with matchandreplace, it means the header has several possible values&lt;br /&gt;
    #we will try to compare the received value with settings and use the corresponding replacement&lt;br /&gt;
    #the following settings for P-Early-Media means if the received value includes string inactive, JF will be used as header value,&lt;br /&gt;
    #if the received value includes string sendrecv, inactive will be used as header value&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #we also support regex for replacing header value, the format is &amp;quot;regex:pattern|stringtouse&amp;quot;&lt;br /&gt;
    #the setting example is like  call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;regex:pattern|JF&amp;quot;&lt;br /&gt;
    #it means if the pattern exists in the received value, all the occurrences of pattern will be replaced by string JF&lt;br /&gt;
    #don't like &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;, we don't support several possible patterns for now&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot; &lt;br /&gt;
    &lt;br /&gt;
    params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
== Limitations: ==&lt;br /&gt;
&lt;br /&gt;
# 'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see example below.&lt;br /&gt;
# Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
# If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
# Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
# SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Headers that cannot be used in 'SIP headers manipulation': ===&lt;br /&gt;
  Accept&lt;br /&gt;
  Accept-Contact&lt;br /&gt;
  Accept-Encoding&lt;br /&gt;
  Accept-Language&lt;br /&gt;
  Alert-Info&lt;br /&gt;
  Allow&lt;br /&gt;
  Allow-Events&lt;br /&gt;
  Also&lt;br /&gt;
  Anonymity&lt;br /&gt;
  Authentication-Info&lt;br /&gt;
  Authorization&lt;br /&gt;
  Call-ID&lt;br /&gt;
  Call-Info&lt;br /&gt;
  Contact&lt;br /&gt;
  Content-Disposition&lt;br /&gt;
  Content-Encoding&lt;br /&gt;
  Content-Language&lt;br /&gt;
  Content-Length&lt;br /&gt;
  Content-Type&lt;br /&gt;
  CSeq&lt;br /&gt;
  Date&lt;br /&gt;
  Encryption&lt;br /&gt;
  Error-Info&lt;br /&gt;
  Event&lt;br /&gt;
  Expires&lt;br /&gt;
  From&lt;br /&gt;
  In-Reply-To&lt;br /&gt;
  Max-Forwards&lt;br /&gt;
  MIME-version&lt;br /&gt;
  Min-Expires&lt;br /&gt;
  Min-SE&lt;br /&gt;
  Organization&lt;br /&gt;
  P-Asserted-Identity&lt;br /&gt;
  P-Media-Authorization&lt;br /&gt;
  P-Preferred-Identity&lt;br /&gt;
  Priority&lt;br /&gt;
  Privacy&lt;br /&gt;
  Proxy-Authenticate&lt;br /&gt;
  Proxy-Authorization&lt;br /&gt;
  Proxy-Require&lt;br /&gt;
  RAck&lt;br /&gt;
  Reason&lt;br /&gt;
  Record-Route&lt;br /&gt;
  Refer-To&lt;br /&gt;
  Referred-By&lt;br /&gt;
  Reject-Contact&lt;br /&gt;
  Remote-Party-ID&lt;br /&gt;
  Replaces&lt;br /&gt;
  Reply-To&lt;br /&gt;
  Request-Disposition&lt;br /&gt;
  Require&lt;br /&gt;
  Response-Key&lt;br /&gt;
  Retry-After&lt;br /&gt;
  Route&lt;br /&gt;
  RPID-Privacy&lt;br /&gt;
  RSeq&lt;br /&gt;
  Security-Client&lt;br /&gt;
  Security-Server&lt;br /&gt;
  Security-Verify&lt;br /&gt;
  Server&lt;br /&gt;
  Service-Route&lt;br /&gt;
  Session-Expires&lt;br /&gt;
  Subject&lt;br /&gt;
  Subscription-State&lt;br /&gt;
  Supported&lt;br /&gt;
  Timestamp&lt;br /&gt;
  To&lt;br /&gt;
  Unsupported&lt;br /&gt;
  User-Agen&lt;br /&gt;
  Via&lt;br /&gt;
  Warning&lt;br /&gt;
  WWW-Authenticate&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-16T12:13:22Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
== Configuration: ==&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
== Usage: ==&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #if hash value begins with matchandreplace, it means the header has several possible values&lt;br /&gt;
    #we will try to compare the received value with settings and use the corresponding replacement&lt;br /&gt;
    #the following settings for P-Early-Media means if the received value includes string inactive, JF will be used as header value,&lt;br /&gt;
    #if the received value includes string sendrecv, inactive will be used as header value&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    #we also support regex for replacing header value, the format is &amp;quot;regex:pattern|stringtouse&amp;quot;&lt;br /&gt;
    #the setting example is like  call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Early-Media&amp;quot;] = &amp;quot;regex:pattern|JF&amp;quot;&lt;br /&gt;
    #it means if the pattern exists in the received value, all the occurrences of pattern will be replaced by string JF&lt;br /&gt;
    #don't like &amp;quot;matchandreplace:inactive|JF,sendrecv|inactive&amp;quot;, we don't support several possible patterns for now&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
== Limitations: ==&lt;br /&gt;
&lt;br /&gt;
# 'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see example below.&lt;br /&gt;
# Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
# If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
# Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
# SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Headers that cannot be used in 'SIP headers manipulation': ===&lt;br /&gt;
  Accept&lt;br /&gt;
  Accept-Contact&lt;br /&gt;
  Accept-Encoding&lt;br /&gt;
  Accept-Language&lt;br /&gt;
  Alert-Info&lt;br /&gt;
  Allow&lt;br /&gt;
  Allow-Events&lt;br /&gt;
  Also&lt;br /&gt;
  Anonymity&lt;br /&gt;
  Authentication-Info&lt;br /&gt;
  Authorization&lt;br /&gt;
  Call-ID&lt;br /&gt;
  Call-Info&lt;br /&gt;
  Contact&lt;br /&gt;
  Content-Disposition&lt;br /&gt;
  Content-Encoding&lt;br /&gt;
  Content-Language&lt;br /&gt;
  Content-Length&lt;br /&gt;
  Content-Type&lt;br /&gt;
  CSeq&lt;br /&gt;
  Date&lt;br /&gt;
  Encryption&lt;br /&gt;
  Error-Info&lt;br /&gt;
  Event&lt;br /&gt;
  Expires&lt;br /&gt;
  From&lt;br /&gt;
  In-Reply-To&lt;br /&gt;
  Max-Forwards&lt;br /&gt;
  MIME-version&lt;br /&gt;
  Min-Expires&lt;br /&gt;
  Min-SE&lt;br /&gt;
  Organization&lt;br /&gt;
  P-Asserted-Identity&lt;br /&gt;
  P-Media-Authorization&lt;br /&gt;
  P-Preferred-Identity&lt;br /&gt;
  Priority&lt;br /&gt;
  Privacy&lt;br /&gt;
  Proxy-Authenticate&lt;br /&gt;
  Proxy-Authorization&lt;br /&gt;
  Proxy-Require&lt;br /&gt;
  RAck&lt;br /&gt;
  Reason&lt;br /&gt;
  Record-Route&lt;br /&gt;
  Refer-To&lt;br /&gt;
  Referred-By&lt;br /&gt;
  Reject-Contact&lt;br /&gt;
  Remote-Party-ID&lt;br /&gt;
  Replaces&lt;br /&gt;
  Reply-To&lt;br /&gt;
  Request-Disposition&lt;br /&gt;
  Require&lt;br /&gt;
  Response-Key&lt;br /&gt;
  Retry-After&lt;br /&gt;
  Route&lt;br /&gt;
  RPID-Privacy&lt;br /&gt;
  RSeq&lt;br /&gt;
  Security-Client&lt;br /&gt;
  Security-Server&lt;br /&gt;
  Security-Verify&lt;br /&gt;
  Server&lt;br /&gt;
  Service-Route&lt;br /&gt;
  Session-Expires&lt;br /&gt;
  Subject&lt;br /&gt;
  Subscription-State&lt;br /&gt;
  Supported&lt;br /&gt;
  Timestamp&lt;br /&gt;
  To&lt;br /&gt;
  Unsupported&lt;br /&gt;
  User-Agen&lt;br /&gt;
  Via&lt;br /&gt;
  Warning&lt;br /&gt;
  WWW-Authenticate&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Behaviors</id>
		<title>Behaviors</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Behaviors"/>
				<updated>2020-08-05T17:04:30Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Services must usually contain a variable number of features. Coding all these features in the ITBCAFCall subclasses might become hard to maintain has the number of features increase. Behaviors provide a way to implement these features in separate classes which are attached to a call at runtime. Basically a behavior traps all events for a call’s legs so it can act on the events and optionally forward them to the rest of the behavior chain. This chain is constructed at the initialization of the call as seen in the next section so that every call can have a different chain (therefore different features).&lt;br /&gt;
&lt;br /&gt;
Here are examples of features that make good behaviors:&lt;br /&gt;
*[[Sip_headers_manipulation]]&lt;br /&gt;
*[[Ringback tones]]&lt;br /&gt;
*Voicemail fallback&lt;br /&gt;
*Follow me&lt;br /&gt;
*[[call detail record|Call detail record]]&lt;br /&gt;
*[[Fax over IP]] (fax relay)&lt;br /&gt;
*Your 'bright ideas'...&lt;br /&gt;
&lt;br /&gt;
The decorator pattern is used by behaviors to provide this level of flexibility; behaviors decorate the default ITBCAFCall subclasses doings. A specific behavior can be used on any ITBCAFCall subclasses, as long as they are compatible in their doings e.g. Using a generic &amp;quot;Follow Me&amp;quot; behavior might not work as intended on a prepaid call).&lt;br /&gt;
&lt;br /&gt;
Additionally, protocol-specific behaviors can be created to remove any protocol-aware code in the base classes. These behaviors can then be dynamically added to calls depending on their protocol.&lt;br /&gt;
&lt;br /&gt;
Behaviors could be implemented through simple inheritance but this approach is somewhat less flexible. Indeed, a class for each combination of features would be required; so the classes needed for the example below would be:&lt;br /&gt;
*CMyCall&lt;br /&gt;
*CMyCallRingbackTone&lt;br /&gt;
*CMyVoiceMailFallback&lt;br /&gt;
*CMyCallRingbackToneVoiceMailFallback&lt;br /&gt;
*CMyVoiceMailFallbackCallRingbackTone (makes no sense in this case but it could make sense for some behaviors) Since the number of classes would be an exponetial of the number of features, we deemed this not acceptable and used decoration instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
Behaviors must be subclasses of CTBCAFCallBehavior which delegates all events to it’s parent by default. The new behavior must implement the event handlers only for the events it needs and must decide whether or not to delegate the event (capturing the event or letting others use it). The CTBCAFCallBehaviorRbt, CTBCAFCallBehaviorVoiceMail, CTBCAFCallBehaviorFollowMe, CTBCAFCallBehaviorFaxRelay classes are good examples of various kinds of simple behaviors.&lt;br /&gt;
&lt;br /&gt;
The following code demonstrates how to decorate a call with ringback tone and voicemail fallback behaviors:&lt;br /&gt;
&lt;br /&gt;
  {&lt;br /&gt;
    pCall = tbnew CMyCall(...);&lt;br /&gt;
    pRbtCall = tbnew CMyCallBehaviorRbt( pCall );&lt;br /&gt;
    pVoiceMailRbtCall = tbnew CMyCallBehaviorVoiceMailFallback( pRbtCall );&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
== Caveats ==&lt;br /&gt;
Behaviors should be careful with the state of the call since the may be used on any type of call. For example a check should be made to be sure a leg exists before using it. This should prevent crashes in case of invalid usage of the behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Return to the Toolpack [[User Guide]]&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-05T17:02:20Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
Configuration:&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
Limitations:&lt;br /&gt;
&lt;br /&gt;
1.'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see example below.&lt;br /&gt;
2.Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
3. If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
4. Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
5. SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
Headers:&lt;br /&gt;
    -Can be modified in 'SIP headers manipulation'. &lt;br /&gt;
        - All X- headers&lt;br /&gt;
        - Most P- headers? (except P-Asserted-Identity)&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    -Cannot not be used in 'SIP headers manipulation'&lt;br /&gt;
       - Accept&lt;br /&gt;
       - Accept-Encoding&lt;br /&gt;
       - Accept-Language&lt;br /&gt;
       - Alert-Info&lt;br /&gt;
       - Allow&lt;br /&gt;
       - Authorization&lt;br /&gt;
       - Authentication-Info&lt;br /&gt;
       - Also&lt;br /&gt;
       - Call-ID&lt;br /&gt;
       - Call-Info&lt;br /&gt;
       - Contact&lt;br /&gt;
       - Content-Disposition&lt;br /&gt;
       - Content-Encoding&lt;br /&gt;
       - Content-Language&lt;br /&gt;
       - Content-Length&lt;br /&gt;
       - Content-Type&lt;br /&gt;
       - CSeq&lt;br /&gt;
       - Date&lt;br /&gt;
       - Encryption&lt;br /&gt;
       - Error-Info&lt;br /&gt;
       - Expires&lt;br /&gt;
       - From&lt;br /&gt;
       - In-Reply-To&lt;br /&gt;
       - Max-Forwards&lt;br /&gt;
       - MIME-version&lt;br /&gt;
       - Min-Expires&lt;br /&gt;
       - Organization&lt;br /&gt;
       - Priority&lt;br /&gt;
       - Proxy-Authenticate&lt;br /&gt;
       - Proxy-Authorization&lt;br /&gt;
       - Proxy-Require&lt;br /&gt;
       - Record-Route&lt;br /&gt;
       - Reply-To&lt;br /&gt;
       - Require&lt;br /&gt;
       - Response-Key&lt;br /&gt;
       - Retry-After&lt;br /&gt;
       - Route&lt;br /&gt;
       - Server&lt;br /&gt;
       - Subject&lt;br /&gt;
       - Supported&lt;br /&gt;
       - Timestamp&lt;br /&gt;
       - To&lt;br /&gt;
       - Unsupported&lt;br /&gt;
       - User-Agen&lt;br /&gt;
       - Via&lt;br /&gt;
       - RAck&lt;br /&gt;
       - RSeq&lt;br /&gt;
       - Warning&lt;br /&gt;
       - WWW-Authenticate&lt;br /&gt;
       - Event&lt;br /&gt;
       - Allow-Events&lt;br /&gt;
       - Refer-To&lt;br /&gt;
       - Referred-By&lt;br /&gt;
       - Replaces&lt;br /&gt;
       - Session-Expires&lt;br /&gt;
       - Min-SE&lt;br /&gt;
       - Request-Disposition&lt;br /&gt;
       - Accept-Contact&lt;br /&gt;
       - Reject-Contact&lt;br /&gt;
       - Anonymity&lt;br /&gt;
       - RPID-Privacy&lt;br /&gt;
       - Remote-Party-ID&lt;br /&gt;
       - Subscription-State&lt;br /&gt;
       - Security-Client&lt;br /&gt;
       - Security-Server&lt;br /&gt;
       - Security-Verify&lt;br /&gt;
       - Reason&lt;br /&gt;
       - P-Media-Authorization&lt;br /&gt;
       - Privacy&lt;br /&gt;
       - P-Asserted-Identity&lt;br /&gt;
       - P-Preferred-Identity&lt;br /&gt;
       - Service-Route&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-05T16:56:30Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
Configuration:&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
Limitations:&lt;br /&gt;
          -'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see       examples below.&lt;br /&gt;
-Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
         -If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
         -Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
         -SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
Headers:&lt;br /&gt;
    -Can be modified in 'SIP headers manipulation'. &lt;br /&gt;
        - All X- headers&lt;br /&gt;
        - Most P- headers? (except P-Asserted-Identity)&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
    -Cannot not be used in 'SIP headers manipulation'&lt;br /&gt;
       - Accept&lt;br /&gt;
       - Accept-Encoding&lt;br /&gt;
       - Accept-Language&lt;br /&gt;
       - Alert-Info&lt;br /&gt;
       - Allow&lt;br /&gt;
       - Authorization&lt;br /&gt;
       - Authentication-Info&lt;br /&gt;
       - Also&lt;br /&gt;
       - Call-ID&lt;br /&gt;
       - Call-Info&lt;br /&gt;
       - Contact&lt;br /&gt;
       - Content-Disposition&lt;br /&gt;
       - Content-Encoding&lt;br /&gt;
       - Content-Language&lt;br /&gt;
       - Content-Length&lt;br /&gt;
       - Content-Type&lt;br /&gt;
       - CSeq&lt;br /&gt;
       - Date&lt;br /&gt;
       - Encryption&lt;br /&gt;
       - Error-Info&lt;br /&gt;
       - Expires&lt;br /&gt;
       - From&lt;br /&gt;
       - In-Reply-To&lt;br /&gt;
       - Max-Forwards&lt;br /&gt;
       - MIME-version&lt;br /&gt;
       - Min-Expires&lt;br /&gt;
       - Organization&lt;br /&gt;
       - Priority&lt;br /&gt;
       - Proxy-Authenticate&lt;br /&gt;
       - Proxy-Authorization&lt;br /&gt;
       - Proxy-Require&lt;br /&gt;
       - Record-Route&lt;br /&gt;
       - Reply-To&lt;br /&gt;
       - Require&lt;br /&gt;
       - Response-Key&lt;br /&gt;
       - Retry-After&lt;br /&gt;
       - Route&lt;br /&gt;
       - Server&lt;br /&gt;
       - Subject&lt;br /&gt;
       - Supported&lt;br /&gt;
       - Timestamp&lt;br /&gt;
       - To&lt;br /&gt;
       - Unsupported&lt;br /&gt;
       - User-Agen&lt;br /&gt;
       - Via&lt;br /&gt;
       - RAck&lt;br /&gt;
       - RSeq&lt;br /&gt;
       - Warning&lt;br /&gt;
       - WWW-Authenticate&lt;br /&gt;
       - Event&lt;br /&gt;
       - Allow-Events&lt;br /&gt;
       - Refer-To&lt;br /&gt;
       - Referred-By&lt;br /&gt;
       - Replaces&lt;br /&gt;
       - Session-Expires&lt;br /&gt;
       - Min-SE&lt;br /&gt;
       - Request-Disposition&lt;br /&gt;
       - Accept-Contact&lt;br /&gt;
       - Reject-Contact&lt;br /&gt;
       - Anonymity&lt;br /&gt;
       - RPID-Privacy&lt;br /&gt;
       - Remote-Party-ID&lt;br /&gt;
       - Subscription-State&lt;br /&gt;
       - Security-Client&lt;br /&gt;
       - Security-Server&lt;br /&gt;
       - Security-Verify&lt;br /&gt;
       - Reason&lt;br /&gt;
       - P-Media-Authorization&lt;br /&gt;
       - Privacy&lt;br /&gt;
       - P-Asserted-Identity&lt;br /&gt;
       - P-Preferred-Identity&lt;br /&gt;
       - Service-Route&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	<entry>
		<id>https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation</id>
		<title>Sip headers manipulation</title>
		<link rel="alternate" type="text/html" href="https://docs.telcobridges.com/tbwiki/Sip_headers_manipulation"/>
				<updated>2020-08-05T16:54:36Z</updated>
		
		<summary type="html">&lt;p&gt;Song tao xie: Created page with &amp;quot;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The behavior 'SIP headers manipulation' allows the SBC users to freely  add ,remove and modify the sip headers when SBC forwards the received invite, 18x and 200 sip messages (there are limitations, please refer to the limitations section below).&lt;br /&gt;
&lt;br /&gt;
Configuration:&lt;br /&gt;
To use the behavior, you need to select the option &amp;quot;Enable SIP headers manipulation&amp;quot; under the path &amp;quot;Gateway -&amp;gt; Advanced Parameters&amp;quot; and use the filter script &amp;quot;sip_headers_manipulation.rb&amp;quot; in routing script setting.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
The manipulation actions are based on what are defined in &amp;quot;sip_headers_manipulation.rb&amp;quot; dynamically or statically. In sip_headers_manipulation.rb, there is filter_sip_headers_manipulation that should be applied as 'after filter' in main script and need to use call[:manipulation] to save what you want SBC to do regarding headers manipulation. An example is :&lt;br /&gt;
  &lt;br /&gt;
  def filter_sip_headers_manipulation params&lt;br /&gt;
    &lt;br /&gt;
    # The following 4 lines are needed to initialize the hash table&lt;br /&gt;
    call = params[ :call ]&lt;br /&gt;
    call[:manipulation] = {}&lt;br /&gt;
    call[:manipulation][:invite] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;] = {}&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;] = {}&lt;br /&gt;
    &lt;br /&gt;
    # Will remove &amp;quot;P-Charging-Vector&amp;quot; header from the the invite if exists&lt;br /&gt;
    call[:manipulation][:invite][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;todelete&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;red&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:banana] = &amp;quot;red&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;blue&amp;quot; header from the invite&lt;br /&gt;
    call[:manipulation][:invite][:salad] = &amp;quot;blue&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    # Will add or modify &amp;quot;P-Charging-Vector&amp;quot; and set its value to &amp;quot;PCV&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;banana&amp;quot; and set its value to &amp;quot;yellow&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    # Will add or modify &amp;quot;salad&amp;quot; and set its value to &amp;quot;green&amp;quot; header from the 18x&lt;br /&gt;
    call[:manipulation][&amp;quot;18x&amp;quot;][:salad] = &amp;quot;green&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][&amp;quot;P-Charging-Vector&amp;quot;] = &amp;quot;PCV&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:banana] = &amp;quot;yellow&amp;quot;&lt;br /&gt;
    call[:manipulation][&amp;quot;200&amp;quot;][:TEST] = &amp;quot;STXIE&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
    params&lt;br /&gt;
  end &lt;br /&gt;
    &lt;br /&gt;
  &lt;br /&gt;
Limitations:&lt;br /&gt;
-'SIP headers manipulation' can only affect SIP headers who are not already modified/generated by the other SBC behaviors, see headers     examples below.&lt;br /&gt;
-Header values are viewed as a constant string, the routing script cannot pass variable to SBC.&lt;br /&gt;
-If the manipulated header is already present, it will be overwritten.&lt;br /&gt;
-Manipulate headers hash can only be set once per call (on the incoming invite message). It is not possible to update the hash later during the call.&lt;br /&gt;
-SIP header in Re-invite and 200 OK attached to Re-invite cannot be affected by this behavior.&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
Headers:&lt;br /&gt;
-Can be modified in 'SIP headers manipulation'. &lt;br /&gt;
        - All X- headers&lt;br /&gt;
        - Most P- headers? (except P-Asserted-Identity)&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
-Cannot not be used in 'SIP headers manipulation'&lt;br /&gt;
       - Accept&lt;br /&gt;
       - Accept-Encoding&lt;br /&gt;
       - Accept-Language&lt;br /&gt;
       - Alert-Info&lt;br /&gt;
       - Allow&lt;br /&gt;
       - Authorization&lt;br /&gt;
       - Authentication-Info&lt;br /&gt;
       - Also&lt;br /&gt;
       - Call-ID&lt;br /&gt;
       - Call-Info&lt;br /&gt;
       - Contact&lt;br /&gt;
       - Content-Disposition&lt;br /&gt;
       - Content-Encoding&lt;br /&gt;
       - Content-Language&lt;br /&gt;
       - Content-Length&lt;br /&gt;
       - Content-Type&lt;br /&gt;
       - CSeq&lt;br /&gt;
       - Date&lt;br /&gt;
       - Encryption&lt;br /&gt;
       - Error-Info&lt;br /&gt;
       - Expires&lt;br /&gt;
       - From&lt;br /&gt;
       - In-Reply-To&lt;br /&gt;
       - Max-Forwards&lt;br /&gt;
       - MIME-version&lt;br /&gt;
       - Min-Expires&lt;br /&gt;
       - Organization&lt;br /&gt;
       - Priority&lt;br /&gt;
       - Proxy-Authenticate&lt;br /&gt;
       - Proxy-Authorization&lt;br /&gt;
       - Proxy-Require&lt;br /&gt;
       - Record-Route&lt;br /&gt;
       - Reply-To&lt;br /&gt;
       - Require&lt;br /&gt;
       - Response-Key&lt;br /&gt;
       - Retry-After&lt;br /&gt;
       - Route&lt;br /&gt;
       - Server&lt;br /&gt;
       - Subject&lt;br /&gt;
       - Supported&lt;br /&gt;
       - Timestamp&lt;br /&gt;
       - To&lt;br /&gt;
       - Unsupported&lt;br /&gt;
       - User-Agen&lt;br /&gt;
       - Via&lt;br /&gt;
       - RAck&lt;br /&gt;
       - RSeq&lt;br /&gt;
       - Warning&lt;br /&gt;
       - WWW-Authenticate&lt;br /&gt;
       - Event&lt;br /&gt;
       - Allow-Events&lt;br /&gt;
       - Refer-To&lt;br /&gt;
       - Referred-By&lt;br /&gt;
       - Replaces&lt;br /&gt;
       - Session-Expires&lt;br /&gt;
       - Min-SE&lt;br /&gt;
       - Request-Disposition&lt;br /&gt;
       - Accept-Contact&lt;br /&gt;
       - Reject-Contact&lt;br /&gt;
       - Anonymity&lt;br /&gt;
       - RPID-Privacy&lt;br /&gt;
       - Remote-Party-ID&lt;br /&gt;
       - Subscription-State&lt;br /&gt;
       - Security-Client&lt;br /&gt;
       - Security-Server&lt;br /&gt;
       - Security-Verify&lt;br /&gt;
       - Reason&lt;br /&gt;
       - P-Media-Authorization&lt;br /&gt;
       - Privacy&lt;br /&gt;
       - P-Asserted-Identity&lt;br /&gt;
       - P-Preferred-Identity&lt;br /&gt;
       - Service-Route&lt;/div&gt;</summary>
		<author><name>Song tao xie</name></author>	</entry>

	</feed>