[SR-Users] Which mode to capture "written to network" traffic with homer and topos
Karsten Horsmann
khorsmann at gmail.com
Thu Jun 11 11:35:48 CEST 2020
Hello Daniel,
thanks for the fast reply.
i changed the loadmodule order (siptrace.so before topos.so) and its the
same behavior. With sip_trace_mode("t");
For better understanding I attached the loading-part of my kamailio.cfg
with siptrace and topos.
The howl request route is not included, but didnt matter imho.
Cheers
Karsten
#!KAMAILIO
##
## kamailio 5.3.x
##
####### Include Local Config If Exists #########
import_file "kamailio-local.cfg"
# kamailio-define for local changes If Exists
import_file "kamailio-define.cfg"
####### Defined Values #########
#!define WITH_NAT 1
#!define WITH_NATSIPPING 1
#!define WITH_BLOCK3XX 1
#!define WITH_TRUNK 1
# NOT WITH_MULTIDOMAIN
# NOT WITH_REGISTER 1
# NOT WITH_DEBUG 1
#!define WITH_TOPOS
####### Defined Values #########
#!ifdef WITH_MULTIDOMAIN
#!define MULTIDOMAIN 1
#!else
#!define MULTIDOMAIN 0
#!endif
# use WITH_500_ERROR as define for serial-forking on 500-RC
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_NATS 5
#!define FLB_NATB 6
#!define FLB_NATSIPPING 7
#!define FLG_DIALOG 8
#!define WITH_SDP_REWRITE 1
#
####### Global Parameters #########
### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=2
log_stderror=no
#!endif
memdbg=5
memlog=5
log_name="kamailio"
log_facility=LOG_LOCAL4
log_prefix="{$hdr(CSeq) $ci} "
# number of SIP routing processes
fork=yes
children=8
auto_aliases=no
tos=0x60
##############
#!ifdef WITH_DNSMASQ_ONLY
dns_servers_no=1
#!endif
use_dns_cache=on # use internal DNS cache
use_dns_failover=on # depends on internal DNS cache
dns_srv_loadbalancing=on
dns_try_naptr=on
dns_retr_time=1 # seconds before retrying a DNS request
dns_retr_no=3 # number of DNS retransmissions
dns_naptr_ignore_rfc=yes # ignore target NAPTR priority
dns_tcp_pref=30 # TCP has second-highest priority
dns_udp_pref=10 # use UDP with least priority
#############
/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes
#!ifdef WITH_TLS
enable_tls=yes
#!endif
# life time of TCP connection when there is no traffic
# - a bit higher than registration expires to cope with UA behind NAT
tcp_connection_lifetime=3605
# sendsocket for homer
#!ifdef WITH_HOMER
#!substdef "!MY_HOMER_CAPTURE!sip:MY_HOMER_IP_ADDR:MY_HOMER_PORT!g"
#!substdef "!MY_LOCAL_SENDSOCK!sip:MY_PRV_IP:MY_LOCAL_SEND_PORT!g"
#!substdef "!MY_LOCAL_SENDLISTEN!udp:MY_PRV_IP:MY_LOCAL_SEND_PORT!g"
socket_workers=2
listen=MY_LOCAL_SENDLISTEN
#!endif
# allows reuse of TCP ports. OS must support SO_REUSPORT
tcp_reuse_port=yes
# control if printing routing tree and udp probing buffer debug
# should be printed
verbose_startup=yes
# noisy feedback, default 1, disabled 0
sip_warning=0
/* upper limit for TCP connections (it includes the TLS connections) */
tcp_max_connections=50000
####### Modules Section ########
# set paths to location of modules (to sources or installation folders)
#!ifdef WITH_SRCPATH
mpath="modules/"
#!else
mpath="/usr/lib64/kamailio/modules/"
#!endif
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
loadmodule "sqlops.so"
#!endif
loadmodule "jsonrpcs.so"
#!ifndef WITH_MYSQL
loadmodule "db_text.so"
#!endif
loadmodule "kex.so"
loadmodule "corex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "textops.so"
loadmodule "textopsx.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "cfg_rpc.so"
loadmodule "acc.so"
loadmodule "path.so"
loadmodule "counters.so"
loadmodule "ndb_redis.so"
#!ifdef WITH_HOMER
loadmodule "siptrace.so"
#!endif
#!ifdef WITH_TOPOS
loadmodule "topos_redis.so"
loadmodule "topos.so"
#!endif
loadmodule "uac.so"
loadmodule "avpops.so"
loadmodule "sdpops.so"
loadmodule "msrp.so"
#!ifdef WITH_AUTH
loadmodule "auth.so"
loadmodule "auth_db.so"
#!endif
loadmodule "permissions.so"
loadmodule "rtpengine.so"
loadmodule "nathelper.so"
loadmodule "nat_traversal.so"
loadmodule "htable.so"
loadmodule "pike.so"
#loadmodule "dialog.so"
loadmodule "dispatcher.so"
#!ifdef WITH_MULTIDOMAIN
loadmodule "domain.so"
#!endif
#!ifdef WITH_TLS
loadmodule "tls.so"
#!endif
#!ifdef WITH_DEBUG
loadmodule "debugger.so"
#!endif
#SDP_HIDE
# ----------------- setting module-specific parameters ---------------
modparam("path", "use_received", 1)
# ----- jsonrpcs params -----
modparam("jsonrpcs", "pretty_format", 1)
/* set the path to RPC fifo control file */
modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
/* set the path to RPC unix socket control file */
#modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
# ----- ctl params -----
#modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)
# Default value is "trying -- your call is important to us".
modparam("tm", "auto_inv_100_reason", "Trying")
# ----- rr params -----
# set next param to 1 to add value to ;lr param (helps with some UAs)
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 1)
# ----- acc params -----
/* what special events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 0)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 1)
modparam("acc", "log_flag", FLT_ACC)
modparam("acc", "log_facility", "LOG_LOCAL2")
modparam("acc", "log_missed_flag", FLT_ACCMISSED)
modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;src_ip=$si;"
"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
modparam("permissions", "db_url", "DBURL")
modparam("permissions", "db_mode", 1)
# ----- domain params -----
#!ifdef WITH_MULTIDOMAIN
modparam("domain", "db_url", "DBURL")
# register callback to match myself condition with domains list
modparam("domain", "register_myself", 1)
#!endif
#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam("rtpengine", "rtpengine_sock","0 == udp:127.0.0.1:2223")
modparam("rtpengine", "rtpengine_tout_ms", 2000)
modparam("rtpengine", "rtpengine_disable_tout", 20)
#!ifdef WITH_SDP_REWRITE
modparam("rtpengine", "read_sdp_pv", "$avp(sdp)")
#!endif
#modparam("rtpengine", "setid_avp", "$avp(setid)")
modparam("nat_traversal", "keepalive_from", "sip:keepalive at XXXXX")
modparam("nat_traversal", "keepalive_extra_headers", "User-Agent: SBC-OS
1.0\r\nX-KeepAlive: true\r\n")
modparam("nat_traversal", "keepalive_method", "OPTIONS")
modparam("nat_traversal", "keepalive_interval", 30)
modparam("nat_traversal", "keepalive_state_file",
"/var/run/kamailio/keepalive_state")
#!endif
#!ifdef WITH_TLS
# ----- tls params -----
modparam("tls", "config", "/etc/kamailio/tls.cfg")
#!endif
modparam("pike", "sampling_time_unit", 10)
modparam("pike", "reqs_density_per_unit", 160)
modparam("pike", "remove_latency", 30)
# ----- htable params -----
# ip ban htable with autoexpire after 5 minutes
modparam("htable", "htable", "ipban=>size=8;autoexpire=300;")
#!ifdef WITH_XMLRPC
# ----- xmlrpc params -----
modparam("xmlrpc", "route", "XMLRPC");
modparam("xmlrpc", "url_match", "^/RPC")
#!endif
#!ifdef WITH_DEBUG
# ----- debugger params -----
modparam("debugger", "cfgtrace", 1)
modparam("debugger", "log_level_name", "exec")
#!endif
# ----- dialog ---------
#modparam("dialog", "dlg_flag", FLG_DIALOG)
#modparam("dialog", "enable_stats", 1)
#modparam("dialog", "dlg_match_mode", 2)
#modparam("dialog", "profiles_with_value", "POCS2TE;TE2POCS;totals")
#modparam("dialog", "track_cseq_updates", 0) ## TRACK CSEQ
#Dispatcher
#!ifdef WITH_MYSQL
modparam("dispatcher", "db_url", "DBURL")
modparam("dispatcher", "table_name", "dispatcher")
#!endif
#!ifndef WITH_MYSQL
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
#!endif
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_from", "<sip:ping at XXXXX>")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshold", 2)
modparam("dispatcher", "setid_pvname", "$var(setid)")
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
modparam("dispatcher", "ds_ping_reply_codes", "class=2")
modparam("dispatcher", "ds_ping_latency_stats", 1)
#!ifdef WITH_500_ERROR
modparam("dispatcher", "flags", 2)
#!endif
#TOPOS
#modparam("ndb_redis", "server",
"name=srv8;addr=172.20.160.155;port=6379;db=8")
modparam("ndb_redis", "server",
"name=CFG_REDIS_NAME;addr=CFG_REDIS_ADDR;port=6379;db=CFG_REDIS_DB")
modparam("ndb_redis", "connect_timeout", 1500) # default 1000ms/1sec
modparam("ndb_redis", "cmd_timeout", 1500) # default 1000ms/1sec
#### $mb message debugging (see event-routes)
#!ifdef WITH_MB_DEBUG
modparam("corex", "network_io_intercept", 1)
modparam("corex", "min_msg_len", 32)
#!endif
#!ifdef WITH_TOPOS
modparam("topos", "storage", "redis")
modparam("topos_redis", "serverid", "CFG_REDIS_NAME")
modparam("topos", "branch_expire", 14400)
modparam("topos", "dialog_expire", 14400)
modparam("topos", "clean_interval", 60)
#!endif
#dont' restore
##modparam("uac","restore_mode","none") # SBC-OS
### modparam("uac","restore_dlg", 1) # needs dialog.so
#modparam("uac","restore_mode","manual")
#modparam("uac","restore_from_avp","$avp(s:original_uri_from)") # needed if
you dont activate dialog.so and set restore_mode auto!
#modparam("uac","restore_to_avp","$avp(s:original_uri_to)")
## UAC REGISTER
#!ifdef WITH_UAC_REGISTER
modparam("uac", "reg_contact_addr", "CFG_PROD_IP")
modparam("uac", "reg_timer_interval", 10)
modparam("uac", "reg_retry_interval", 10)
modparam("uac", "reg_db_url", "DBURL")
modparam("uac", "restore_mode", "auto") # auto is default
modparam("uac", "auth_username_avp", "$avp(AVP_AUTH_USERNAME)")
modparam("uac", "auth_password_avp", "$avp(AVP_AUTH_PASSWORD)")
modparam("uac", "auth_realm_avp", "$avp(AVP_AUTH_REALM)")
modparam("uac", "reg_keep_callid", 1) # set to 1 - RFC3261 conform
modparam("uac", "default_socket", "CFG_PROD_IP:5060") # tcp_reuse_port=yes
MUSS gesetzt werden.
#!endif
#!ifdef WITH_HOMER
#Siptrace
modparam("siptrace", "force_send_sock", "MY_LOCAL_SENDSOCK")
# local interface from where to send the duplicated traffic
modparam("siptrace", "duplicate_uri", "MY_HOMER_CAPTURE")
modparam("siptrace", "hep_mode_on", 1) # enable/disable Homer encapsulate
mode
modparam("siptrace", "hep_version", 3) # HEPv3 the timestamp and capture
agent ID will be included in the HEP header
modparam("siptrace", "trace_to_database", 0) # trace to database
modparam("siptrace", "trace_on", 1) # enable/disable trace
modparam("siptrace", "trace_mode", 0) # default 0, if 1 then you dont need
call siptrace flag or sip_trace()
modparam("siptrace", "hep_capture_id", 8) # capture agent id Limitation:
32-bit for HEPv3.
#!endif
#!ifdef WITH_MYSQL
modparam("sqlops","sqlcon","db=>DBURL")
#!endif
####### Routing Logic ########
include_file "kamailio-hmr.cfg"
remove.prack = 1 desc "1 true - 0 false"
mylog.logint = 0 desc "on the fly logging"
# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
# - note: this is the same as route { ... }
request_route {
#!ifdef WITH_HOMER
# Set the tracing mode: message, transaction or dialog. Need 5.3.x
sip_trace_mode("t");
#!endif
...
}
# vim: set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab:
Am Do., 11. Juni 2020 um 10:25 Uhr schrieb Daniel-Constantin Mierla <
miconda at gmail.com>:
> Hello,
>
> try to load siptrace module before the topos module, iirc they use the
> same event hooks. If doesn't work, then I will check the code.
>
> Cheers,
> Daniel
> On 11.06.20 10:05, Karsten Horsmann wrote:
>
> Hi Mailinglist,
>
> some of my kamailio-version is 5.3.4 with topos.
>
> During the last discussion about sip_trace_mode("t") i found new behaivor.
> With this tracingmode i see the "internal" before topos writing.
>
> Here my questions:
>
> Can i change it to "whats on the wire" (topos rewritten mode)? I
> didnt checked all modes.
> And if so, can i switch that on-the-fly with $var for example? For topos
> debugging its fine with sip_trace_mode("t") - not for "hey carrier, you
> made some mistakes".
>
>
> #!ifdef WITH_HOMER
> #Siptrace
> modparam("siptrace", "force_send_sock", "MY_LOCAL_SENDSOCK")
> # local interface from where to send the duplicated traffic
> modparam("siptrace", "duplicate_uri", "MY_HOMER_CAPTURE")
> modparam("siptrace", "hep_mode_on", 1) # enable/disable Homer encapsulate
> mode
> modparam("siptrace", "hep_version", 3) # HEPv3 the timestamp and capture
> agent ID will be included in the HEP header
> modparam("siptrace", "trace_to_database", 0) # trace to database
> modparam("siptrace", "trace_on", 1) # enable/disable trace
> modparam("siptrace", "trace_mode", 0) # default 0, if 1 then you dont need
> call siptrace flag or sip_trace()
> modparam("siptrace", "hep_capture_id", 8) # capture agent id Limitation:
> 32-bit for HEPv3.
> #!endif
>
>
> #!ifdef WITH_HOMER
> # Set the tracing mode: message, transaction or dialog. Need 5.3.x
> sip_trace_mode("t");
> #!endif
>
> *** captured on the topos kamailio:
>
> 2020-06-11 08:35:11 +0200 : 172.24.32.28:5060 -> 172.24.52.3:5060
> INVITE sip:+49XXXXXXXXXXXX at 172.24.52.3:5060 SIP/2.0
> Record-Route:
> <sip:172.24.32.28;r2=on;lr=on;ftag=1ea69f36;vsf=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO3VzZXI9cGhvbmU-;vst=AAAAAAAAAAAAAAAAAAAAAAAAAABLXVQATFVCVUheUUgcXAIBHnBvcnQ9dGNwO3VzZXI9cGhvbmU-;proxy_media=yes;nat=yes>
> Record-Route:
> <sip:100.80.0.20;transport=tcp;r2=on;lr=on;ftag=1ea69f36;vsf=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO3VzZXI9cGhvbmU-;vst=AAAAAAAAAAAAAAAAAAAAAAAAAABLXVQATFVCVUheUUgcXAIBHnBvcnQ9dGNwO3VzZXI9cGhvbmU-;proxy_media=yes;nat=yes>
> Via: SIP/2.0/UDP
> 172.24.32.28;branch=z9hG4bK34b.1b6e5fbd9cf7af26bb168d1469096714.0;i=74
> Via: SIP/2.0/TCP
> AA.AAA.AAA.AAA:5060;rport=5060;branch=z9hG4bKeca7a7f789c9f647560353e3cf1cd592.ba7930dc
> Max-Forwards: 52
> To: <sip:+49XXXXXXXXXXXX at some.provider.example>
> From: <sip:+49YYYYYYYYYYY at some.provider.example>;tag=1ea69f36
> Call-ID: 3af87db089119841 at AA.AAA.AAA.AAA
> Contact: <sip:TFFRA002 at AA.AAA.AAA.AAA:5060;transport=tcp>
> Supported: histinfo,replaces
> CSeq: 647169 INVITE
> Allow: ACK, BYE, CANCEL, INVITE, OPTIONS, REFER, REGISTER, UPDATE
> P-Asserted-Identity: <sip:+49BBBBBBBBBB at some.provider.example;user=phone>
> Content-Type: application/sdp
> Content-Disposition: session
> Content-Length: 298
> X-Group-SBC: 2006
> X-Routing-SBC: un2tr-cgn-trunk
>
> ---------------------------------------
> *** captured on the kamailio behind 172.24.52.3
>
> 2020-06-11 08:35:11 +0200 : 172.24.32.28:5060 -> 172.24.52.3:5060
> INVITE sip:+49XXXXXXXXXXXX at 172.24.52.3:5060 SIP/2.0
> Via: SIP/2.0/UDP
> 172.24.32.28;branch=z9hG4bK34b.1b6e5fbd9cf7af26bb168d1469096714.0;i=74
> Max-Forwards: 52
> To: <sip:+49XXXXXXXXXXXX at some.provider.example>
> From: <sip:+49YYYYYYYYYYY at some.provider.example>;tag=1ea69f36
> Call-ID: 3af87db089119841 at AA.AAA.AAA.AAA
> Supported: histinfo,replaces
> CSeq: 647169 INVITE
> Allow: ACK, BYE, CANCEL, INVITE, OPTIONS, REFER, REGISTER, UPDATE
> P-Asserted-Identity: <sip:+49BBBBBBBBBB at some.provider.example;user=phone>
> Content-Type: application/sdp
> Content-Disposition: session
> Content-Length: 298
> X-Group-SBC: 2006
> X-Routing-SBC: un2tr-cgn-trunk
> Contact: <sip:btpsh-5ee1105a-1903c-1 at 172.24.32.28>
>
>
>
> --
> Cheers
> *Karsten Horsmann*
>
> _______________________________________________
> Kamailio (SER) - Users Mailing Listsr-users at lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>
--
Mit freundlichen Grüßen
*Karsten Horsmann*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200611/1f709483/attachment.html>
More information about the sr-users
mailing list