Re: [OpenSIPS-Users] CDR Accounting

2011-01-19 Thread a.zagorskiy

It was my conversation, and I told about
1) $Tsm is MICROseconds (6 digits)
2) It is microseconds of a current second.

On Wed, 19 Jan 2011 09:29:28 -0800
 Dave Singer  wrote:
Be careful when using $Tsm. I read a thread the other 
day that was just
talking about it and that it returns milliseconds since 
midnight, not epoch.
So if that is true you will need to somehow handle calls 
that cross midnight
for duration at least and start/answer/end of call if 
including the

precision in those timestamps.
I'd be interested to see what you find.
What I've seen with sub second accounting is for 
rounding purposes where for
example billing in 6 second increments and it is always 
rounded up. So a

call 6.001 seconds would be charged for 12 seconds.

Dave

On Wed, Jan 19, 2011 at 6:35 AM, Brett Nemeroff 
 wrote:


On Wed, Jan 19, 2011 at 8:32 AM, Andrew Philp 
wrote:


We are looking to use this for billing directly and for 
most of our

customers are billed on a hundredth of a second.

Does this make sense?


Sure it does, but I've never heard of sub second 
billing. The ACC module is
probably not going to help you for this need presently. 
I believe $Tsm
returns milliseconds. You may be able to manually 
account for the calls with

that.
-Brett


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Call limitation

2011-01-19 Thread a.zagorskiy

Hi Duane.

The concurrent call limitation isn't what I want.

I don't deal with money. I need to decide deny or allow 
call only on prefix of a call's number


Example:

user 100 from domain mydomain1 has blocked calls that 
begin from 811
user 200 from domain mydomain1 has blocked calls that 
begin from 812
other users from domain mydomain1 haven't such limitation 
and can call anywhere.



On Wed, 19 Jan 2011 11:07:52 -0600
 Duane Larson  wrote:
My pc is currently broken so I can't copy the link, but 
if you go to the
opensips tutorial page you will see concurrent call 
limitation.  You can use
that as a starting point.  What you need is the dialog 
module and avpops

module.

Sent from Droid
On Jan 19, 2011 10:15 AM, "Anton Zagorskiy" 


wrote:

Hi.

Please help me with advice.
I want to do a call limitation based on prefixes for 
each user in each
domain. In other words, I need to deny or allow call 
depend on username

and

domain and value on a field in a sql table.

Which module should I use?
Thanks!






WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagors...@oyster-telecom.ru
www.oyster-telecom.ru





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] b2b refer scenario

2011-01-05 Thread a.zagorskiy

Anca, thanks a lot!


On Wed, 05 Jan 2011 19:28:40 +0200
 Anca Vamanu  wrote:
On 01/05/2011 07:09 PM, a.zagors...@oyster-telecom.ru 
wrote:
Uh yes, I was completely inattentive while reading the 
tutorail..


So, there is no other way that call 
b2b_init_request("refer") on each first INVITE to catch 
potential REFER request?..


Yes, there is no other way but to call it on the initial 
Invite.
Also, I need to call top hiding scenario on certain 
INVITEs. Is it possible to call 2 b2b_init_request at one 
time (top hiding + refer)? Or I should make 2 B2B 
transactions - first for potential REFER and second for 
'my' INVITEs? Last case doesn't look good...



If you call b2b_init_request("refer"), then the B2BUA 
will do topology hiding except for when a REFER is 
received, so in fact you just need to call only once 
b2b_init_request with "refer" scenario.


Regards,

--
Anca Vamanu
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] b2b refer scenario

2011-01-05 Thread a.zagorskiy
Uh yes, I was completely inattentive while reading the 
tutorail..


So, there is no other way that call 
b2b_init_request("refer") on each first INVITE to catch 
potential REFER request?..


Also, I need to call top hiding scenario on certain 
INVITEs. Is it possible to call 2 b2b_init_request at one 
time (top hiding + refer)? Or I should make 2 B2B 
transactions - first for potential REFER and second for 
'my' INVITEs? Last case doesn't look good...



On Wed, 05 Jan 2011 14:52:37 +0200
 Anca Vamanu  wrote:

Hi Anton,

01/05/2011 02:09 PM, a.zagors...@oyster-telecom.ru 
wrote:

Hi Anca,
thanks for your reply, but could you explain a bit more?

I don't understand how B2B will understand that he 
should execute scenario on REFER request when 
b2b_init_request is calling on an INVITE request?


I'm talking about situation, where there are 2 UAs, they 
has established session, and one of them sending the 
REFER request to another.


Yes, this is exactly how it works, by calling the 
b2b_init_request on the initial Invite, so that B2BUA is 
in the middle of the call and can control it. If you look 
in the xml scenario file you will see that there is a 
rule for REFER there - this is how it know that when a 
REFER is received it has to do what it has to do.

Try this out  and you will see ;) .

Regards,

--
Anca Vamanu
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] b2b refer scenario

2011-01-05 Thread a.zagorskiy

Hi Anca,
thanks for your reply, but could you explain a bit more?

I don't understand how B2B will understand that he should 
execute scenario on REFER request when b2b_init_request is 
calling on an INVITE request?


I'm talking about situation, where there are 2 UAs, they 
has established session, and one of them sending the REFER 
request to another.



On Mon, 03 Jan 2011 15:19:42 +0200
 Anca Vamanu  wrote:

On 12/30/2010 01:31 PM, Anton Zagorskiy wrote:

Hi.

Inspecting b2b_entities/dlg.c I've found that 
b2b_new_dlg() rejects all

non-INVITE requests.

Line 861:
if(msg->first_line.u.request.method_value != 
METHOD_INVITE)

{
LM_ERR("Called b2b_init on a Cancel message\n");
   return 0;
}


So, how to use B2B REFER scenario from b2b tutorail? In 
this case

method_value is METHOD_REFER.




 "b2b_init_request" must be called on the initial 
INVITE. I will mark it in red in the tutorial.


Regards,

--
Anca Vamanu
www.voice-system.ro




WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagors...@oyster-telecom.ru
www.oyster-telecom.ru




-Original Message-
From: users-boun...@lists.opensips.org [mailto:users-
boun...@lists.opensips.org] On Behalf Of Anton Zagorskiy
Sent: Tuesday, December 28, 2010 8:20 PM
To: 'OpenSIPS users mailling list'
Subject: [OpenSIPS-Users] b2b refer scenario

Hi.

I'm trying to use b2b refer scenario
http://www.opensips.org/Resources/B2buaTutorial#toc15
But I've got errors in the log:

*** route: REFER request, call B2B(refer)
DBG:core:parse_headers: flags=
DBG:b2b_logic:b2bl_insert_new: new tuple 
[0xb60c1238]->[468.0]

DBG:core:parse_headers: flags=
ERROR:b2b_entities:b2b_new_dlg: Called b2b_init on a 
Cancel message
ERROR:b2b_entities:server_new: failed to create new 
dialog structure

entry
ERROR:b2b_logic:b2b_process_scenario_init: failed to 
create new b2b

server
instance
DBG:b2b_logic:b2bl_delete: Delete record 
[0xb60c1238]->[468.0],

hash_index=[468], local_index=[0]
*** route: REFER request, B2B(refer) called, exit

I'm catching REFER in a loose_route section:

if (has_totag())
{
if (loose_route())
   {
   	if ( ($DLG_status != NULL)&& 
(!validate_dialog()) )

 {
xlog("*** !!! [ROUTE]: bad dialog");
 }
 else
 {
if (is_method("REFER"))
   {
xlog("*** route: REFER request, call
B2B(refer)");
 b2b_init_request("refer");
 xlog("*** route: REFER request, 
B2B(refer)

called,
exit");
 exit;
 };

...

 };
};
};


What I'm doing wrong?



WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagors...@oyster-telecom.ru
www.oyster-telecom.ru





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] drouting module

2010-12-10 Thread a.zagorskiy
Yes, you were right! Thank you. But now openSIPS goes to 
crash...


[6176]: *** route[invite]: call do_routing()
[6176]: DBG:core:db_new_result: allocate 28 bytes for 
result set at 0x81db470
[6176]: DBG:db_mysql:db_mysql_get_columns: 1 columns 
returned from the query
[6176]: DBG:core:db_allocate_columns: allocate 16 bytes 
for result columns at 0x81d994c
[6176]: DBG:db_mysql:db_mysql_get_columns: 
RES_NAMES(0x81d9950)[0]=[groupid]
[6176]: DBG:db_mysql:db_mysql_get_columns: use DB_INT 
result type
[6176]: DBG:core:db_allocate_rows: allocate 28 bytes for 
result rows and values at 0x81db49c

[6176]: DBG:db_mysql:db_mysql_str2val: converting INT [0]
[6176]: DBG:core:db_free_columns: freeing result columns 
at 0x81d994c

[6176]: DBG:core:db_free_rows: freeing 1 rows
[6176]: DBG:core:db_free_row: freeing row values at 
0x81db4a4

[6176]: DBG:core:db_free_rows: freeing rows at 0x81db49c
[6176]: DBG:core:db_free_result: freeing result set at 
0x81db470

[6176]: DBG:drouting:do_routing: using dr group 0
[6176]: DBG:drouting:do_routing: no matching for prefix 
"89112599077"
[6176]: DBG:drouting:internal_check_rt: found rgid 0 (rule 
list 0xb6110988)
[6168]: INFO:core:handle_sigs: child process 6176 exited 
by a signal 11

[6168]: INFO:core:handle_sigs: core was not generated
[6168]: INFO:core:handle_sigs: terminating due to SIGCHLD
[6187]: INFO:core:sig_usr: signal 15 received
[6186]: INFO:core:sig_usr: signal 15 received
[6185]: INFO:core:sig_usr: signal 15 received
[6184]: INFO:core:sig_usr: signal 15 received
[6180]: INFO:core:sig_usr: signal 15 received
[6178]: INFO:core:sig_usr: signal 15 received
[6191]: INFO:core:sig_usr: signal 15 received
[6182]: INFO:core:sig_usr: signal 15 received
[6188]: INFO:core:sig_usr: signal 15 received


There is 'xlog("*** route[invite]: do_routing() passed");' 
right after do_routing()




On Fri, 10 Dec 2010 15:05:15 +0200
 Anca Vamanu  wrote:

On 12/10/2010 01:47 PM, Anton Zagorskiy wrote:

Hello.

It seems that when I call do_route() the route[1] was 
automatically called..
As I understand I should manually call relay functions 
after do_routing().


   
Have you set the routeid field in in the dr_rules table 
record to 1 :) ?
If you set the routeid to something different than 0, 
then the route with that index is automatically called.


Regards,

--
Anca Vamanu
www.voice-system.ro



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Handle end of a transaction/dialog

2010-11-19 Thread a.zagorskiy
So, you explained how to store and grouping counters. 
Thanks.
But how to catch the moment when the opensips transaction 
is going down? I need to react immediately.


I can catch a BYE request when a established sip session 
is ending. What about other cases?



On Fri, 19 Nov 2010 09:27:38 -0800
 Dave Singer  wrote:
You can use a combination of the following dialog 
profiles (grouping calls)

functions for this:
get_profile_size(profile,[value],size)
Check
if a prifile is at limit.
set_dlg_profile(profile,[value])
If
not at limit, increment the count for the profile (NOTE 
the value option is

not actually supported yet)
unset_dlg_profile(profile,[value])
If
need to remove from a profile like carrier failover
is_in_profile(profile,[value])
Not
sure this would be needed but...

When a call ends it will automatically be removed from 
any profiles it was

part of.

On Fri, Nov 19, 2010 at 1:29 AM, Anton Zagorskiy <
a.zagors...@oyster-telecom.ru> wrote:

Nobody uses limitation on amount of established 
sessions?  I don't believe!

=)






WBR, Anton Zagorskiy
VoIP Developer, Oyster Telecom
Phone.: +7 812 601-0666
Fax: +7 812 601-0593
a.zagors...@oyster-telecom.ru
www.oyster-telecom.ru



> -Original Message-
> From: users-boun...@lists.opensips.org [mailto:users-
> boun...@lists.opensips.org] On Behalf Of Anton 
Zagorskiy

> Sent: Thursday, November 18, 2010 4:58 PM
> To: 'OpenSIPS users mailling list'
> Subject: [OpenSIPS-Users] Handle end of a 
transaction/dialog

>
> Hello.
>
> I need to control how much SIP dialogs (established or 
pending) has

> each
> domain. If that value is equal to certain constant 
then I should drop

> any
> new INVITE from that domain.
> There is no problem with catching initial requests, 
but with

> terminating.
> How can I control that an openSIPS transaction is in 
the terminating

> stage?
>
>
>
>
>
>
> WBR, Anton Zagorskiy
> VoIP Developer, Oyster Telecom
> Phone.: +7 812 601-0666
> Fax: +7 812 601-0593
> a.zagors...@oyster-telecom.ru
> www.oyster-telecom.ru
>
>
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users