From 2ad43bfc84a2879e620aa72ed642fd4bd1650c00 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Fri, 29 Oct 2010 14:41:16 +0200 Subject: [PATCH] sbc: support for using header and header components --- apps/sbc/SBC.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ doc/Readme.sbc.txt | 22 +++++++++++++++++++++- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/apps/sbc/SBC.cpp b/apps/sbc/SBC.cpp index 122f28a8..bdaec105 100644 --- a/apps/sbc/SBC.cpp +++ b/apps/sbc/SBC.cpp @@ -401,6 +401,50 @@ string SBCDialog::replaceParameters(const char* r_type, skip_chars = skip_p-p; } break; + case 'H': { // header + size_t name_offset = 2; + if (s[p+1] != '(') { + if (s[p+2] != '(') { + WARN("Error parsing H header replacement (missing '(')\n"); + break; + } + name_offset = 3; + } + if (s.length() + Examples: + o P-Caller-Uuid: 0004152379B8 + and + prepaid_caller_uuid=$H(P-Caller-Uuid) + + o P-NextHop-IP: 10.0.2.15 + and + next_hop_ip=$H(P-NextHop-IP) + + $HU(headername) - header (as URI) User + $Hd(headername) - header (as URI) domain (host:port) + ... + + Example: + o P-SomeNH-URI: sip:user@10.0.2.15:5092 + and + next_hop_ip=$Hh(P-SomeNH-URI) + next_hop_port=$Hp(P-SomeNH-URI) + + \\ -> \ \$ -> $ \* -> * @@ -121,7 +142,6 @@ Headers and messages may be filtered. A filter can be set to o transparent - no filtering done o whitelist - only let items pass that are in the filter list - o blacklist - filter out items that are in the filter list Note that if ACK messages should not be filtered.