Accounting plug in doesn't work

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
icx_zbigniew
Posts: 2
Joined: Thu Oct 20, 2011 3:37 am

Accounting plug in doesn't work

Post by icx_zbigniew »

1. Brekeke Product Name and version: Brekeke SIP Server 2.4.8.6/286.3

2. Java version: JSE 1.6.0_07

3. OS type and the version: MS Windows Server 2003 SP2

4. UA (phone), gateway or other hardware/software involved:

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html : Pattern 1

6. Your problem:

I followed the instructions for creating an accounting plugin and installed the plugin jar and all dependent jars in the location as specified. I also added the plugin as a session variable in my dial plan, again as documented but it does not work and I can not find out why. Could you please help?

1. Plug-in code

//Logging.jave file - I removed most of the codes and I left just something to see if it works. The file was compiled, jar & put into "C:\Program Files\Brekeke\proxy\webapps\proxy\WEB-INF\lib\Logging.jar"

package Logging;

import com.brekeke.net.sip.sv.session.*;
import com.brekeke.net.sip.sv.session.plugins.*;
import java.io.*;


public class Logging extends AccountingBase {


public int eventSessionStart( EventStat evstat, String[] argprm ) {

int ris =0;

try {
File f = new File("d:\\prova.txt");
FileOutputStream fos=new FileOutputStream(f);
PrintStream ps=new PrintStream(fos);
ps.println("test");
fos.close();

}
catch ( Exception ex ) {
}

return ris;

}

}


2. Dial Plan

MATCHING
$request=^INVITE

DEPLOY
$session=Logging
$continue=true



Thanks in advance
Laurie
Posts: 246
Joined: Mon Jan 07, 2008 12:25 pm

Post by Laurie »

Did you set the following variable in the [Config] -> [Advanced] page?
net.sip.session.plugins.pkg = Logging

Also, did you restart Brekeke SIP Server?
icx_zbigniew
Posts: 2
Joined: Thu Oct 20, 2011 3:37 am

Post by icx_zbigniew »

No, but after I did that it worked!

Thanks a lot Laurie!
Laurie
Posts: 246
Joined: Mon Jan 07, 2008 12:25 pm

Post by Laurie »

It seems you didn't read the API document until the end :)
Anyway Im glad to know you solved the problem.
Post Reply