Hi folks,
I have a problem with setting billing party in my radius messages. My accounting is done by CDRTool via radius messages to radius server. The thing I don`t know is how to set billing party variable (by default $avp(s:billing_party) with reliable value. I can try adding Diversion header and fill the variable with it, but can I trust the Diversion header? When UAC sets redirect(302) and Invite comes, he replies 302 and Kamailio passes this message to origin. However is it possible to change Diversion header by UAC? This could be way how to make free calls and bill it to someone else.
I was thinking of uac_redirect module. If I get it right this module saves original number in memory and does not use message itself to store it. In documentation there is written that accounting can by done by setting modparam("uac_redirect", "acc_function", "acc_rad_request"). Even when I use exported function set_accept_filter() the accounting itself isn't done. I`d like to get original number from module uac_redirect and set it to $avp(s:billing_party). This would solve the problem of billing forwarded calls.
Am I getting it right? Is there anything else what can be passed to billing party variable to make correct bililng?
I'm using kamailio 3.1.x and CDRTool v 8.0.6
Thanks,
Efelin
Efelin Novak writes:
I have a problem with setting billing party in my radius messages. My accounting is done by CDRTool via radius messages to radius server. The thing I don`t know is how to set billing party variable (by default $avp(s:billing_party) with reliable value. I can try adding Diversion header and fill the variable with it, but can I trust the Diversion header? When UAC sets redirect(302) and Invite comes, he replies 302 and Kamailio passes this message to origin. However is it possible to change Diversion header by UAC? This could be way how to make free calls and bill it to someone else.
you bill the uac who sends an invite that results to 200 ok reply, not the party that replies with 302 (unless your proxy converts 302 to invite in which case you bill the uas).
-- juha
Hello Juha
thanks for answer. Yes, my server is proxy. Situation is like this:
UserA@domain ------> UserB@my_domain (redirect) --------> UserC@another_domain
I have to bill call to another_domain to UserB.
Regards,
Efelin
2010/10/27 Juha Heinanen jh@tutpro.com
Efelin Novak writes:
I have a problem with setting billing party in my radius messages. My accounting is done by CDRTool via radius messages to radius server. The thing I don`t know is how to set billing party variable (by default $avp(s:billing_party) with reliable value. I can try adding Diversion
header
and fill the variable with it, but can I trust the Diversion header? When UAC sets redirect(302) and Invite comes, he replies 302 and Kamailio
passes
this message to origin. However is it possible to change Diversion header
by
UAC? This could be way how to make free calls and bill it to someone else.
you bill the uac who sends an invite that results to 200 ok reply, not the party that replies with 302 (unless your proxy converts 302 to invite in which case you bill the uas).
-- juha
Efelin Novak writes:
thanks for answer. Yes, my server is proxy. Situation is like this:
UserA@domain ------> UserB@my_domain (redirect) --------> UserC@another_domain
I have to bill call to another_domain to UserB.
then you must make sure that your billing uri in the accounting record gets populated by uri of UserB, i.e., the request uri after redirect.
-- juha
The request uri after redirect will be UserC@another_domain. I have to store the original request_uri(UserB@my_domain) and after redirect, insert it to Billing Party header in radius message.
I need UserC not to be aware of the redirect. In this case I have to make a new call to UserC. This call is to the another network which I have to pay. I have to bill it to UserB.
Regards,
Efelin
2010/10/28 Juha Heinanen jh@tutpro.com
Efelin Novak writes:
thanks for answer. Yes, my server is proxy. Situation is like this:
UserA@domain ------> UserB@my_domain (redirect) --------> UserC@another_domain
I have to bill call to another_domain to UserB.
then you must make sure that your billing uri in the accounting record gets populated by uri of UserB, i.e., the request uri after redirect.
-- juha
Efelin Novak writes:
The request uri after redirect will be UserC@another_domain. I have to store the original request_uri(UserB@my_domain) and after redirect, insert it to Billing Party header in radius message.
yes, i had a typo in my answer. you, of course, need to use request uri before redirect as your billing uri. i wonder why you asked, when you knew the answer yourself.
-- juha
O, actually I have just found out that variables are stored across whole call. Thank you for your answers.
Regards, Efelin
2010/10/28 Juha Heinanen jh@tutpro.com
Efelin Novak writes:
The request uri after redirect will be UserC@another_domain. I have to
store
the original request_uri(UserB@my_domain) and after redirect, insert it
to
Billing Party header in radius message.
yes, i had a typo in my answer. you, of course, need to use request uri before redirect as your billing uri. i wonder why you asked, when you knew the answer yourself.
-- juha
Hello,
I wonder if there's a chance to use SWITCH in kamailio.cfg with intervals or ranges???
There's nothing to find in core cookbook about ranges with SWITCH.
something like:
switch ( $var(i) ){
case 1..10:
# instructions...
break;
case [11-20]:
# instructions...
break;
default: # default instructions }
Thank you...
Regards,
Nicolas
Hello,
On 10/28/10 3:35 PM, "Nicolas Rüger" wrote:
Hello,
I wonder if there's a chance to use SWITCH in kamailio.cfg with intervals or ranges???
no it is not possible now, you can have many 'case' values like:
swiych($var(x)) { case 1: case 2: case 4: case 8: .... break; ... }
Apart of doing "if" conditions with greater and less ops, an option, just for a nicer look maybe, would be to convert to some string and use regexp matching in switch:
$var(match) = "#" + $var(x) + "#";
switch($var(match)) { case /"#1#2#4#8#": ... }
But still no interval, so you need to list always all the values.
Cheers, Daniel
There's nothing to find in core cookbook about ranges with SWITCH.
something like:
switch ( $var(i) ){
case 1..10: # instructions... break; case [11-20]: # instructions... break; default: # default instructions
}
Thank you...
Regards,
Nicolas
Hello,
one more thing ...
When you start a new topic, please create a new message, do not reply to an old email received from the list because it will be added to that discussion thread. For example, your message is part of "Billing party and radius accounting". Starting a new thread makes easier to follow the discussion and the mailing list archive is much coherent.
Cheers, Daniel
On 10/28/10 3:35 PM, "Nicolas Rüger" wrote:
Hello,
I wonder if there's a chance to use SWITCH in kamailio.cfg with intervals or ranges???
There's nothing to find in core cookbook about ranges with SWITCH.
something like:
switch ( $var(i) ){
case 1..10: # instructions... break; case [11-20]: # instructions... break; default: # default instructions
}
Thank you...
Regards,
Nicolas
Hello Daniel,
thanks for the tips and sorry for the mistake.
I thougt that these messages and threads are identified by the subject. That was stupid of course.
I will create new completely messages from now.
Thank you...
Regards,
Nicolas
When you start a new topic, please create a new message, do not reply to an old email received from the list because it will be added to that discussion thread. For example, your message is part of "Billing party and radius accounting". Starting a new thread makes easier to follow the discussion and the mailing list archive is much coherent.
Unfortunately I was wrong about variables ($var). They are same across whole kamailio process. Neither $avp is good for me as they are transaction aware. I need to store variable in the current dialog. I was looking into dialog module, but no luck. I wasn't able to make dialog variables $dlg and $dlg-ctx work. Are they appropriate in this situation? Can you please give here some examples how to use them in configuration file?
Regards,
Efelin 2010/10/28 Efelin Novak efelin.novak@gmail.com
O, actually I have just found out that variables are stored across whole call. Thank you for your answers.
Regards, Efelin
2010/10/28 Juha Heinanen jh@tutpro.com
Efelin Novak writes:
The request uri after redirect will be UserC@another_domain. I have to
store
the original request_uri(UserB@my_domain) and after redirect, insert it
to
Billing Party header in radius message.
yes, i had a typo in my answer. you, of course, need to use request uri before redirect as your billing uri. i wonder why you asked, when you knew the answer yourself.
-- juha
Hello,
On 10/28/10 6:53 PM, Efelin Novak wrote:
Unfortunately I was wrong about variables ($var). They are same across whole kamailio process. Neither $avp is good for me as they are transaction aware. I need to store variable in the current dialog. I was looking into dialog module, but no luck. I wasn't able to make dialog variables $dlg and $dlg-ctx work. Are they appropriate in this situation? Can you please give here some examples how to use them in configuration file?
do you pass the 302 to caller? If so, then not even the dialog helps you, because the caller will start a new call, previous one is ended once 302 is sent out by the server.
There is htable module that can be used to store data in shared memory -- for a dialog, you can use callid plus some id as key (e.g., $sht(a=>$ci::billing) ). But for this case does not help.
If you handle 302 on the server, then you can use $avp(...), because the transaction is kept until there is a final reply from the redirected address.
Cheers, Daniel
Regards,
Efelin 2010/10/28 Efelin Novak <efelin.novak@gmail.com mailto:efelin.novak@gmail.com>
O, actually I have just found out that variables are stored across whole call. Thank you for your answers. Regards, Efelin 2010/10/28 Juha Heinanen <jh@tutpro.com <mailto:jh@tutpro.com>> Efelin Novak writes: > The request uri after redirect will be UserC@another_domain. I have to store > the original request_uri(UserB@my_domain) and after redirect, insert it to > Billing Party header in radius message. yes, i had a typo in my answer. you, of course, need to use request uri before redirect as your billing uri. i wonder why you asked, when you knew the answer yourself. -- juha
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