++ Need Help using (Asterisk-java0.3.1)UpdateConfigAction ++

Hi everyone,

I want to create a user dynamically in sip.conf from a java application. I took help from
asteriskguru.com/board/dy…rs-vt2997.html .
I have used MyUpdateConfigAction class in my java application ; but somehow i am not being able to edit sip.conf file file thru my java app.
Heres my code :

import java.io.IOException;

import org.asteriskjava.manager.AuthenticationFailedExcep tion;
import org.asteriskjava.manager.ManagerConnection;
import org.asteriskjava.manager.ManagerConnectionFactory;
import org.asteriskjava.manager.TimeoutException;
import org.asteriskjava.manager.action.CommandAction;
import org.asteriskjava.manager.action.OriginateAction;
import org.asteriskjava.manager.action.UpdateConfigAction ;
import org.asteriskjava.manager.response.CommandResponse;
import org.asteriskjava.manager.response.ManagerResponse;

public class HelloManager
{
public ManagerConnection managerConnection;
public ManagerConnectionFactory factory;

public HelloManager() throws IOException
{
factory = new ManagerConnectionFactory(“127.0.0.1”,5038, “admin”, “root”);
this.managerConnection = factory.createManagerConnection();
}

public void run() throws IOException, AuthenticationFailedException, TimeoutException
{

MyUpdateConfigAction muc = new MyUpdateConfigAction(“sip.conf”, “sip.conf”, true);

muc.addCommand(UpdateConfigAction.ACTION_UPDATE, “mitul”, “secret”, “xxx”, null);

managerConnection.login();
ManagerResponse originateResponse;
CommandResponse response = (CommandResponse) managerConnection.sendAction(muc);
// originateResponse = managerConnection.sendAction(muc);

managerConnection.logoff();

/*
MyUpdateConfigAction muc = new MyUpdateConfigAction(“sip.conf”, “sip.conf”, true);
//UpdateConfigAction.ACTION_NEWCAT, “test”, null, null, null);
muc.addCommand(muc.ACTION_NEWCAT, “test”, null, null, null);
//(UpdateConfigAction.ACTION_APPEND, “test”, “type”, “friend”, null);
// muc.addCommand(muc.ACTION_APPEND, “test”,“type”, “friend”, null);
//UpdateConfigAction.ACTION_APPEND, “test”, “username”, “test”, null);
muc.addCommand(muc.ACTION_APPEND, “test”, “username”, “friend”, null);
//(UpdateConfigAction.ACTION_APPEND, “test”, “secret”, “test”, null);
// muc.addCommand(muc.ACTION_APPEND, “test”, “secret”, “friend”, null);
//UpdateConfigAction.ACTION_APPEND, “test”, “callerid”, “212”, null);
// muc.addCommand(muc.ACTION_APPEND, “test”, “callerid”, “212”, null);
//UpdateConfigAction.ACTION_APPEND, “test”, “regexten”, “212”, null);
// muc.addCommand(muc.ACTION_APPEND, “test”, “regexten”, “212”, null);
//(UpdateConfigAction.ACTION_APPEND, “test”, “host”, “dynamic”, null);
// muc.addCommand(muc.ACTION_APPEND, “test”, “host”, “dynamic”, null);
muc.ghostActionString();
muc.getReload();
// connect to Asterisk and log in
managerConnection.login();

OriginateAction originateAction = new OriginateAction();
ManagerResponse originateResponse;
// originateAction = managerConnection.sendAction(muc, 30000);
// CommandResponse resp = (CommandResponse) managerConnection.sendAction(new CommandAction(muc.getAction()));
originateResponse = managerConnection.sendAction(muc,30000);
//--------------------------------
CommandAction commandAction = new CommandAction(“sip show users”);
CommandResponse response = (CommandResponse) managerConnection.sendAction(commandAction);
for (String line : response.getResult() )
{
System.out.println(line);
}
//------------------------------
// log off from Asterisk server
// managerConnection.logoff();
*/
}

public static void main(String[] args) throws Exception
{
HelloManager helloManager;

helloManager = new HelloManager();
helloManager.run();
}
}

//--------------------------------------
I can able to read from sip.conf via manager.
There is no exceptions ; but there is no writing on sip.config.

Can anyone help me and take me out from this problem ?
I am using Asterisks 1.2 .

regards,

Mitul