Identify CDR accounting on dialog-timeout

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Identify CDR accounting on dialog-timeout

jay1017
Hi,
I am using CDR accounting with mysql in my script. I want a way to know if the CDR record is because of a dialog_timeout. Is there some standard way of notifying it from the script. I was thinking of something like this:
I have an extra column "timeout" in  my acc table which is inserted using db_extra parameter $avp(timeout) which is initialized to 0. If I know somewhere in the script that dialog has timed out, I set this $avp(timeout) to 1, so that the record inserted will have timeout column value as 1 and it will be easily identifiable.

I understand that AVPs are not dialog persistent, but probably I can use some dlg_val variables. Also I dont find any function that indicates the dialog_timeout event. Another idea was to set the bye_on_timeout flag by calling create_dialog("B") and in local_route catch the BYE request and set the dlg_val variables there.

Wanted to know if any of these ideas can work or is there some more standard way of doing it.

--- Jayesh

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

Razvan Crainea
Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the acc module from trunk version. There you have a new parameter, db_extra_bye[1], that can evaluate the pseudo variables after the BYE message is received.

An easier way to implement this, is to initialize a dlg_val with the value 1, and if you receive a BYE message, change it to 0. If you don't receive any BYE and a timeout is triggered, then the value will remain 1 and that is what you will see in the database. Otherwise, for a normal hang up, you should set it to 0 and this will  reflect in the DB. But once again, this will only work with the trunk version, adding the dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,
--
Răzvan Crainea
OpenSIPS Developer

On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
Hi,
I am using CDR accounting with mysql in my script. I want a way to know if the CDR record is because of a dialog_timeout. Is there some standard way of notifying it from the script. I was thinking of something like this:
I have an extra column "timeout" in  my acc table which is inserted using db_extra parameter $avp(timeout) which is initialized to 0. If I know somewhere in the script that dialog has timed out, I set this $avp(timeout) to 1, so that the record inserted will have timeout column value as 1 and it will be easily identifiable.

I understand that AVPs are not dialog persistent, but probably I can use some dlg_val variables. Also I dont find any function that indicates the dialog_timeout event. Another idea was to set the bye_on_timeout flag by calling create_dialog("B") and in local_route catch the BYE request and set the dlg_val variables there.

Wanted to know if any of these ideas can work or is there some more standard way of doing it.

--- Jayesh


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

jay1017
In reply to this post by jay1017
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer


On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

jay1017
Hi Razvan,
Not a very relevant question to ask, but is it possible to disable accounting when dialog times out?? So that no record is entered in the DB because of dialog timeout. I can probably setflag for syslog accounting where such calls will also get logged !!

--- Jayesh

On Wed, Jan 18, 2012 at 7:14 PM, Jayesh Nambiar <[hidden email]> wrote:
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer



On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

Razvan Crainea
Hi, Jayesh!

First of all, there are not so many changes between the 1.7.1 and trunk for the accounting module. Only this new parameter was added as far as I know, and it should be pretty stable. If you do want to use the module from trunk, you can simply copy it in your OpenSIPS 1.7.1 folder, and apply the patch I've attached in order to compile properly.

If you are using the automatic CDR accounting, then the scenario you described above can not be implemented. The accounting backend is only set at the initial invite.

Regards,
--
Răzvan Crainea
OpenSIPS Developer

On 01/18/2012 04:53 PM, Jayesh Nambiar wrote:
Hi Razvan,
Not a very relevant question to ask, but is it possible to disable accounting when dialog times out?? So that no record is entered in the DB because of dialog timeout. I can probably setflag for syslog accounting where such calls will also get logged !!

--- Jayesh

On Wed, Jan 18, 2012 at 7:14 PM, Jayesh Nambiar <[hidden email]> wrote:
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer



On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

acc_module_port_1.7.1.patch (444 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

jay1017
Thank you very much Razvan. I will try this out.

--- Jayesh

On Wed, Jan 18, 2012 at 8:34 PM, Razvan Crainea <[hidden email]> wrote:
Hi, Jayesh!

First of all, there are not so many changes between the 1.7.1 and trunk for the accounting module. Only this new parameter was added as far as I know, and it should be pretty stable. If you do want to use the module from trunk, you can simply copy it in your OpenSIPS 1.7.1 folder, and apply the patch I've attached in order to compile properly.

If you are using the automatic CDR accounting, then the scenario you described above can not be implemented. The accounting backend is only set at the initial invite.

Regards,
--
Răzvan Crainea
OpenSIPS Developer

On 01/18/2012 04:53 PM, Jayesh Nambiar wrote:
Hi Razvan,
Not a very relevant question to ask, but is it possible to disable accounting when dialog times out?? So that no record is entered in the DB because of dialog timeout. I can probably setflag for syslog accounting where such calls will also get logged !!

--- Jayesh

On Wed, Jan 18, 2012 at 7:14 PM, Jayesh Nambiar <[hidden email]> wrote:
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer



On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>




_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

jay1017
Hi Razvan,
I copied the acc directory of revision 8673 into my opensips-1.7.1 and also applied the patch and it compiled properly. But I guess it does not work as expected. I did the following:

modparam("acc", "db_extra_bye", "timeout=$dlg_val(timeout)")

if(has_totag()) {
     if(match_dialog()) { # --- Match dialog to associate sequential requests ---
           if(is_method("BYE")) {
               $dlg_val(timeout) = "0";
               xlog("L_INFO", "Bye received and timeout is $dlg_val(timeout)");
           }
        t_relay();
     }
}

if(is_method("INVITE")) {
   $dlg_val(timeout) = "1";
   route(call_logic);
   exit;
}

Now here, When BYE is received, I can see the XLOG logging the values correct, but the value entered in the DB is still 1. Morepver now when dialog times out, no CDR record is generated and I can see the following in the syslog:

ERROR:acc:acc_dlg_callback: not enough info

Any pointers or directions that you can give me to test this properly. For information, I use the topology_hiding function in dialog module to route the calls. Also I have another 14 extra values that I enter in acc table using the normal db_extra parameter.

Thanks,

--- Jayesh


2012/1/19 Jayesh Nambiar <[hidden email]>
Thank you very much Razvan. I will try this out.

--- Jayesh


On Wed, Jan 18, 2012 at 8:34 PM, Razvan Crainea <[hidden email]> wrote:
Hi, Jayesh!

First of all, there are not so many changes between the 1.7.1 and trunk for the accounting module. Only this new parameter was added as far as I know, and it should be pretty stable. If you do want to use the module from trunk, you can simply copy it in your OpenSIPS 1.7.1 folder, and apply the patch I've attached in order to compile properly.

If you are using the automatic CDR accounting, then the scenario you described above can not be implemented. The accounting backend is only set at the initial invite.

Regards,
--
Răzvan Crainea
OpenSIPS Developer

On 01/18/2012 04:53 PM, Jayesh Nambiar wrote:
Hi Razvan,
Not a very relevant question to ask, but is it possible to disable accounting when dialog times out?? So that no record is entered in the DB because of dialog timeout. I can probably setflag for syslog accounting where such calls will also get logged !!

--- Jayesh

On Wed, Jan 18, 2012 at 7:14 PM, Jayesh Nambiar <[hidden email]> wrote:
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer



On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>





_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

jay1017
Hi,
Just missed in the snippet below, I do call create_dialog("B") before setting the $dlg_val(timeout) and the problems mentioned below are still there.

--- Jayesh

2012/1/19 Jayesh Nambiar <[hidden email]>
Hi Razvan,
I copied the acc directory of revision 8673 into my opensips-1.7.1 and also applied the patch and it compiled properly. But I guess it does not work as expected. I did the following:

modparam("acc", "db_extra_bye", "timeout=$dlg_val(timeout)")

if(has_totag()) {
     if(match_dialog()) { # --- Match dialog to associate sequential requests ---
           if(is_method("BYE")) {
               $dlg_val(timeout) = "0";
               xlog("L_INFO", "Bye received and timeout is $dlg_val(timeout)");
           }
        t_relay();
     }
}

if(is_method("INVITE")) {
   $dlg_val(timeout) = "1";
   route(call_logic);
   exit;
}

Now here, When BYE is received, I can see the XLOG logging the values correct, but the value entered in the DB is still 1. Morepver now when dialog times out, no CDR record is generated and I can see the following in the syslog:

ERROR:acc:acc_dlg_callback: not enough info

Any pointers or directions that you can give me to test this properly. For information, I use the topology_hiding function in dialog module to route the calls. Also I have another 14 extra values that I enter in acc table using the normal db_extra parameter.

Thanks,

--- Jayesh



2012/1/19 Jayesh Nambiar <[hidden email]>
Thank you very much Razvan. I will try this out.

--- Jayesh


On Wed, Jan 18, 2012 at 8:34 PM, Razvan Crainea <[hidden email]> wrote:
Hi, Jayesh!

First of all, there are not so many changes between the 1.7.1 and trunk for the accounting module. Only this new parameter was added as far as I know, and it should be pretty stable. If you do want to use the module from trunk, you can simply copy it in your OpenSIPS 1.7.1 folder, and apply the patch I've attached in order to compile properly.

If you are using the automatic CDR accounting, then the scenario you described above can not be implemented. The accounting backend is only set at the initial invite.

Regards,
--
Răzvan Crainea
OpenSIPS Developer

On 01/18/2012 04:53 PM, Jayesh Nambiar wrote:
Hi Razvan,
Not a very relevant question to ask, but is it possible to disable accounting when dialog times out?? So that no record is entered in the DB because of dialog timeout. I can probably setflag for syslog accounting where such calls will also get logged !!

--- Jayesh

On Wed, Jan 18, 2012 at 7:14 PM, Jayesh Nambiar <[hidden email]> wrote:
Hi Razvan,
Thanks for your reply. Is it possible to use only the acc module of trunk version with the 1.7.1 stable version or do I have to download and configure the entire latest trunk version of opensips.
I intend to use this in production setup, so just a little more worried about the reliability.

Thanks again,

--- Jayesh


Hello, Jayesh!

You can not achieve this scenario in OpenSIPS 1.7.1, but you can wit the
acc module from trunk version. There you have a new parameter,
db_extra_bye[1], that can evaluate the pseudo variables after the BYE
message is received.

An easier way to implement this, is to initialize a dlg_val with the
value 1, and if you receive a BYE message, change it to 0. If you don't
receive any BYE and a timeout is triggered, then the value will remain 1
and that is what you will see in the database. Otherwise, for a normal
hang up, you should set it to 0 and this will  reflect in the DB. But
once again, this will only work with the trunk version, adding the
dlg_val to the db_extra_bye parameter.

[1] http://www.opensips.org/html/docs/modules/devel/acc.html#id293815

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer



On 01/18/2012 01:35 PM, Jayesh Nambiar wrote:
> Hi,
> I am using CDR accounting with mysql in my script. I want a way to
> know if the CDR record is because of a dialog_timeout. Is there some
> standard way of notifying it from the script. I was thinking of
> something like this:
> I have an extra column "timeout" in  my acc table which is inserted
> using db_extra parameter $avp(timeout) which is initialized to 0. If I
> know somewhere in the script that dialog has timed out, I set this
> $avp(timeout) to 1, so that the record inserted will have timeout
> column value as 1 and it will be easily identifiable.
>
> I understand that AVPs are not dialog persistent, but probably I can
> use some dlg_val variables. Also I dont find any function that
> indicates the dialog_timeout event. Another idea was to set the
> bye_on_timeout flag by calling create_dialog("B") and in local_route
> catch the BYE request and set the dlg_val variables there.
>
> Wanted to know if any of these ideas can work or is there some more
> standard way of doing it.
>
> --- Jayesh
>
>






_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Identify CDR accounting on dialog-timeout

Brett Nemeroff
2012/1/19 Jayesh Nambiar <[hidden email]>
Hi,
Just missed in the snippet below, I do call create_dialog("B") before setting the $dlg_val(timeout) and the problems mentioned below are still there.

I just wanted to add my $0.02 in here.. I've had similar problems, but much of it arises from the fact that I don't know when exactly acc values are written to memory/disk etc. I've had issues where setting avps and placing them in db_extra doesn't produce the values expected.

Do you think you could give a little more detail on when it's ok to use a db_extra? when it'll take the value and when specifically it'll get written to disk?  Just.. generically?

Thanks,
Brett


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users