Brekeke SIP Server 2.1.5.6/239
2. Java version:
jre1.6.0_03
jdk1.6.0_03
3. OS type and the version:
Windows 2003 server
4. UA (phone), gateway or other hardware/software involved:
Siemens gigaset S450IP phone
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
Pattern 1
6. Your problem:
I came upon http://www.brekeke-sip.com/download/bss ... plugin.txt and tried to create a dialplan plugin of my own, with a goal to replace dialed number X with SIP Uri from file C:\Documents and Settings\All Users\phonebook.props .This because personal edition of the SIP server can handle only 5 dialplan rules and my SIP phone can only dial numbers and not vanity SIP uri's. But I am having trouble with it and have no experience in Java, here is the source code for my phonebook class:
Code: Select all
package plugin;
import java.util.*;
import java.io.*;
public class phonebook {
// get new address from phonebook file
//
// Syntax:
// $phonebook.findentry( dialednumber )
//
// Returns:
// aliased SIP-URI from phonebook if such exists
static public String findentry( String[] arg, com.brekeke.net.sip.SIPpacket sippacket, Properties pr ) throws Exception {
if ( ( arg != null ) && ( arg[0] != null) ) {
String sipnumber = arg[0] ;
try {
Properties aliaslist = new Properties();
File phonebookdir = new File(System.getenv("ALLUSERSPROFILE"));
File phonebookfile = new File(phonebookdir, "phonebook.props");
aliaslist.load(new FileInputStream(phonebookfile));
return ( aliaslist.getProperty(sipnumber) );
}
catch(Exception e) {
return ( null ) ;
}
}
return ( null ) ;
}
}
-the compile produced no errors.
Then I moved the resulting phonebook.class to directory: C:\Program Files\Brekeke\proxy\webapps\proxy\WEB-INF\classes
-Such directory did not exist I had to create it
And I added line: dialplan.plugins.matching.pkg=com.brekeke.plugin
To file: C:\Program Files\Brekeke\proxy\webapps\proxy\WEB-INF\work\sv\sv.properties
-I tried also line: dialplan.plugins.matching.pkg=plugin,but that did not work either.
when I try to make Dialplan with: $phonebook.findentry( "%1" )=(.+) it is colored red, this indicates error I think? Should the new class be in the variable dropdown list when all is OK?
Restarting SIP server or computer did not help.
I sure that someone who has done this succesfully, can tell me what I am doing wrong...