Re: [SR-Users] Diameter AVP handling from kamaiio.cfg

2017-01-10 Thread Zoltán Miricz
Thank you very much.

I opened a feature request:
https://github.com/kamailio/kamailio/issues/922

If I will have time, I might try to implement such kind of functionality :)

*Cheers,*
*Zoltan*


On 9 January 2017 at 09:50, Carsten Bock <cars...@ng-voice.com> wrote:

> Hi Zoltan,
>
> i've added something like this for the IMS-Charging Module in order to
> retrieve the "full" Charging Response:
>
> case -1: #failure
> xlog("L_ERR", "CCR failure - error response sent from
> module\n");
> switch ($avp(s:cca_result_code)){
> case 5030:
> send_reply("403", "Charging User not found");
>break;
> case 5031:
> send_reply("403", "Rating failed");
>break;
> case 4010:
> send_reply("402", "Payment required - Unsufficient funds");
>break;
> case 5006:
> send_reply("486", "Line limit exceeded");
>break;
> default:
> send_reply("402","Payment required ($avp(s:cca_result_code))");
>break;
> }
>
> (it's in the Master repo/example:
> https://github.com/kamailio/kamailio/blob/master/misc/
> examples/scscf/kamailio.cfg)
>
> In addition, I have a generic Diameter Client/Server Module, which
> unfortunately was not finished for Kamailio 5 (development branch is
> frozen at the moment), but in that case, you'll have to do all the
> processing yourself. We currently use it as a "Diameter Adapter",
> which takes a Diameter Request and forwards it through a message bus
> to worker processes (acting as a HSS).
>
> Thanks,
> Carsten
>
>
> 2017-01-06 18:47 GMT+01:00 Zoltán Miricz <zoltan.mir...@gmail.com>:
> > Hi,
> >
> > Is somebody ever tried to manipulate and retrieve AVP variables from the
> > Sent/Received Diameter Messages via Config file?
> > Thank you very much in advance!
> >
> > Cheers,
> > Zoltan
> >
> > On 4 January 2017 at 20:37, Zoltán Miricz <zoltan.mir...@gmail.com>
> wrote:
> >>
> >>
> >> Dear All,
> >>
> >> I'm wondering is it possible to catch Diameter Messages and their AVP
> >> values from kamailio.cfg just like for SIP messages? (Using pseudo
> >> variables)
> >>
> >> I looked into this function from the attached S-CSCF example.
> >>
> >> route[REG_MAR_REPLY]
> >> {
> >>
> >> #this is async so to know status we have to check the reply avp
> >>
> >> xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n");
> >>
> >> Sadly it gives back only 1, -1, -2. (which is based on cxdx_mar.c the
> rc)
> >> What I mainly looking for is the EXPERIMENTAL_RESULT (experimental_rc)
> and
> >> some different AVP values besides.
> >>
> >>
> >> Thank you very much in advance!
> >>
> >> Cheers,
> >> Zoltan
> >
> >
> >
> > ___
> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> > sr-users@lists.sip-router.org
> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> >
>
>
>
> --
> Carsten Bock
> CEO (Geschäftsführer)
>
> ng-voice GmbH
> Millerntorplatz 1
> 20359 Hamburg / Germany
>
> http://www.ng-voice.com
> mailto:cars...@ng-voice.com
>
> Office +49 40 5247593-40
> Fax +49 40 5247593-99
>
> Sitz der Gesellschaft: Hamburg
> Registergericht: Amtsgericht Hamburg, HRB 120189
> Geschäftsführer: Carsten Bock
> Ust-ID: DE279344284
>
> Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
> http://www.ng-voice.com/imprint/
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Diameter AVP handling from kamaiio.cfg

2017-01-09 Thread Zoltán Miricz
Hi Carsten,

Thank you very much for your response!
Sadly for the UAR, LIR, SAR are not providing these kind of error codes.
As you can see only -1 coming back and not
Jan  4 06:17:15 localhost journal:
de.fhg.fokus.hss.cx.CxExperimentalResultException:
IMS_Diameter_Error_User_Unknown
Jan  4 06:17:15 localhost journal: #011at
de.fhg.fokus.hss.cx.op.UAR.processRequest(UAR.java:115)
Jan  4 06:17:15 localhost journal: #011at
de.fhg.fokus.hss.main.Task.execute(Task.java:169)
Jan  4 06:17:15 localhost journal: #011at
de.fhg.fokus.hss.main.Worker.run(Worker.java:66)
Jan  4 06:17:15 localhost journal: #033[0;39;49m#033[0;31;49m 7(46) ERROR:
ims_icscf [cxdx_uar.c:152]: async_cdp_uar_callback():
RC_IMS_DIAMETER_ERROR_USER_UNKNOWN
Jan  4 06:17:15 localhost journal: #033[0;39;49m#033[0;31;49m 7(46) ERROR:

[SR-Users] Diameter AVP handling from kamaiio.cfg

2017-01-04 Thread Zoltán Miricz
Dear All,

I'm wondering is it possible to catch Diameter Messages and their AVP
values from kamailio.cfg just like for SIP messages? (Using pseudo
variables)

I looked into this function from the attached S-CSCF example.

route[REG_MAR_REPLY]
{

#this is async so to know status we have to check the reply avp

xlog("L_DBG","maa_return code is *$avp(s:maa_return_code)*\n");

Sadly it gives back only 1, -1, -2. (which is based on cxdx_mar.c the rc)
What I mainly looking for is the EXPERIMENTAL_RESULT (experimental_rc) and
some different AVP values besides.


Thank you very much in advance!

*Cheers,*
*Zoltan*
#!KAMAILIO
#
# This config file implements the basic P-CSCF functionality
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
# for an explanation of possible statements, functions and parameters.
#
# Direct your questions about this file to: .
#
# For more information about the various parameters, functions and statements
# try http://sip-router.org/wiki/ .
#

### Defined Values #
# *** Value defines - IDs used later in config

# - flags
#   FLT_ - per transaction (message) flags
#   FLB_ - per branch flags

#!define FLT_CAPTURE 1
#!define FLT_DIALOG 2

#!define DLG_TIMEOUT_AVP "i:1"
#!define RR_CUSTOM_USER_AVP "i:2"
#!define DISPATCHER_DST_AVP "i:3"
#!define DISPATCHER_GRP_AVP "i:4"
#!define DISPATCHER_CNT_AVP "i:5"
#!define PDB_CARRIER "i:6"


### Global Parameters #

include_file "scscf.cfg"

#!ifdef WITH_DEBUG
debug=5
log_stderror=no
sip_warning=yes
#!else
debug=2
log_stderror=no
sip_warning=no
#!endif

### for foreground operation by FE
fork=no
log_stderror=yes
children=4

alias=HOSTNAME

user_agent_header="User-Agent: Kamailio S-CSCF"
server_header="Server: Kamailio S-CSCF"

/* comment the next line to enable the auto discovery of local aliases
   based on reverse DNS on IPs (default on) */
auto_aliases=no

check_via=no# (cmd. line: -v)
dns=no  # (cmd. line: -r)
rev_dns=no  # (cmd. line: -R)

# Do SRV-Loadbalancing:
dns_srv_lb=yes
# Always: Also try IPv6:
dns_try_ipv6=yes
# Always prefer IPv6:
dns_cache_flags=6
# DNS-Based failover
use_dns_failover = on
# Query NAPTR-Records as well:
dns_try_naptr=no

#!ifdef WITH_XMLRPC
#!ifndef WITH_TCP
#!define WITH_TCP
#!endif
#!ifndef TCP_PROCESSES
# Number of TCP Processes
#!define TCP_PROCESSES 3
#!endif
#!endif

#!ifdef WITH_TCP
# 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=3615
#!ifdef TCP_PROCESSES
tcp_children=TCP_PROCESSES
#!endif
#!else
disable_tcp=yes
#!endif

#children=64

system.shutdownmode = 0 desc "System shutdown mode"

# -- module loading --
#mpath="/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/:/usr/lib/kamailio/modules_k/:/usr/lib/kamailio/modules/"
# (we try both the lib64 and the lib directory)

loadmodule "tm.so"
loadmodule "pv.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "ims_dialog.so"
loadmodule "textops.so"
loadmodule "maxfwd.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "siputils.so"
loadmodule "kex.so"
#!ifdef DB_URL
loadmodule "presence"
#!endif

#!ifdef DB_URL
loadmodule "db_mysql"
#!ifdef DB_URL2
loadmodule "db_cluster"
#!endif
#!endif

#loadmodule "dispatcher"

loadmodule "enum"
loadmodule "uac"

# Control interfaces:
#loadmodule "ctl"
#loadmodule "cfg_rpc"
#loadmodule "mi_rpc"
#loadmodule "mi_fifo"
#!ifdef WITH_XMLRPC
loadmodule "xmlrpc"
#!endif

loadmodule "cdp.so"
loadmodule "cdp_avp.so"

loadmodule "ims_usrloc_scscf.so"
loadmodule "ims_registrar_scscf.so"
loadmodule "ims_auth.so"
loadmodule "ims_isc.so"

#!ifdef WITH_RO
loadmodule "ims_charging.so"
#!endif

#!ifdef CAPTURE_NODE
loadmodule "siptrace.so"
#!endif

#!ifdef WITH_DEBUG
loadmodule "debugger.so"
#!endif

# - setting module-specific parameters ---
#!ifdef DB_URL2
# - db_cluster params -
modparam("db_cluster", "connection", DB_URL)
modparam("db_cluster", "connection", DB_URL2)
modparam("db_cluster", "cluster", "cluster1=>con1=2s2s;con2=1s1s")
#!endif

# - presence params -
#!ifdef DB_URL
#!ifdef DB_URL2
modparam("presence", "db_url", "cluster://cluster1")
#!else
modparam("presence", "db_url", DB_URL)
#!endif
#modparam("presence", "fallback2db", 1)
modparam("presence", "db_update_period", 20)
#!endif

# - mi_fifo params -
#modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
#modparam("mi_fifo", "fifo_mode", 0666)
#modparam("mi_fifo", "fifo_user", "kamailio")
#modparam("mi_fifo", "fifo_group", "kamailio")

# - mi_fifo params -
#modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
#modparam("mi_fifo", "fifo_mode", 0666)
#modparam("mi_fifo", "fifo_user", "kamailio")
#modparam("mi_fifo", "fifo_group", "kamailio")

# - tm params -
# auto-discard