Dailing a number using Asterisk-java

hai all!
i am get starting trouble, i am able to connect to asterisk server with java. but i am not able to ring to any number(including my mobile) can any one solve my proble. can any one send me a sample example to dail a number to my mail id chidambar_reddy@yahoo.com.

thanX in advns

Could you post the code you are trying to use? There are several examples with the Asterisk-Java distro itself you should have a look at.

import java.io.IOException;

import net.sf.asterisk.manager.AuthenticationFailedException;
import net.sf.asterisk.manager.ManagerConnection;
import net.sf.asterisk.manager.ManagerConnectionFactory;
import net.sf.asterisk.manager.TimeoutException;
import net.sf.asterisk.manager.action.OriginateAction;
import net.sf.asterisk.manager.response.ManagerResponse;

public class HelloManager
private ManagerConnection managerConnection;

public HelloManager() throws IOException
    ManagerConnectionFactory factory = new ManagerConnectionFactory();

    this.managerConnection = factory.getManagerConnection("localhost",
            "manager", "pa55w0rd");

public void run() throws IOException, AuthenticationFailedException,
    OriginateAction originateAction;
    ManagerResponse originateResponse;

    originateAction = new OriginateAction();
    originateAction.setPriority(new Integer(1));
    originateAction.setTimeout(new Integer(30000));

    // connect to Asterisk and log in

    // send the originate action and wait for a maximum of 30 seconds for Asterisk
    // to send a reply
    originateResponse = managerConnection.sendAction(originateAction, 30000);

    // print out whether the originate succeeded or not

    // and finally log off and disconnect

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

    helloManager = new HelloManager();


substitute the “Zap/2/9823459xxx” for the fxo channel configured
and the no to call.

You need to study in detail the manager api to get an idea of whats

Here you are connecting to the asterisk server(assuming localhost)
and asking asterisk to dial the phone no. When the phone is answered
its directed to the extension 1300 in the default context of the dialplan.

using the package from

also refer the tutorial