<div dir="ltr">Hi<br>I'm new developer on Asterisk and i have some questions:<br><br>I would like to write an application with Java api that does the following :<br><br>Lets assume we have 2 extensions SIP .<br>My application should dial to 1 Sip account and when answer is getting to astrisk farward the call to another extention.<br>
My astrisk server should be connected to some external operator SIP service that does the physical call for me.<br><br><u><b>My questions is (I would like to get <span style="color: rgb(255, 102, 102);">general </span>answers here ):</b></u><br>
<br>1-If i want to simulate this scenario - can i use some simulator that simulate the operator behavior ? (Or maybe i don't need one)<br>2-Which soft phone is recommended by you for my scenario ? (I uses x-lite but i cant add more than 1 SIP account )<br>
3-What (In general ) should be my architecture for this scenario ? <br>4-What (In general ) should be my configuration of the asterisk ? <br><br>5-I have downloaded asterisk win 32 and run some Java test application that does the following thing:<br>
Assume we have a phone connected via SIP that is available at SIP/3000 and we
want to initiate a call from that phone to extension 3001 in the default
context.<p>Here is the example from <a href="http://asterisk-java.org/0.2/tutorial.html">http://asterisk-java.org/0.2/tutorial.html</a> site:</p><p>(I have configured everything to work with Manager.)<br></p><pre><font size="4"><b style="color: rgb(0, 153, 0);">import java.io.IOException;<br>
<br>import net.sf.asterisk.manager.AuthenticationFailedException;<br>import net.sf.asterisk.manager.ManagerConnection;<br>import net.sf.asterisk.manager.ManagerConnectionFactory;<br>import net.sf.asterisk.manager.TimeoutException;<br>
import net.sf.asterisk.manager.action.OriginateAction;<br>import net.sf.asterisk.manager.response.ManagerResponse;<br><br>public class HelloManager<br>{<br> private ManagerConnection managerConnection;<br><br> public HelloManager() throws IOException<br>
{<br> ManagerConnectionFactory factory = new ManagerConnectionFactory();<br><br> this.managerConnection = factory.getManagerConnection("localhost",<br> "manager", "pa55w0rd");<br>
}<br><br> public void run() throws IOException, AuthenticationFailedException,<br> TimeoutException<br> {<br> OriginateAction originateAction;<br> ManagerResponse originateResponse;<br><br>
originateAction = new OriginateAction();<br> originateAction.setChannel("SIP/3000");<br> originateAction.setContext("default");<br> originateAction.setExten("3001");<br>
originateAction.setPriority(new Integer(1));<br> originateAction.setTimeout(new Integer(30000));<br><br> // connect to Asterisk and log in<br> managerConnection.login();<br><br> // send the originate action and wait for a maximum of 30 seconds for Asterisk<br>
// to send a reply<br> originateResponse = managerConnection.sendAction(originateAction, 30000);<br><br> // print out whether the originate succeeded or not<br> System.out.println(originateResponse.getResponse());<br>
<br> // and finally log off and disconnect<br> managerConnection.logoff();<br> }<br><br> public static void main(String[] args) throws Exception<br> {<br> HelloManager helloManager;<br><br> helloManager = new HelloManager();<br>
helloManager.run();<br> }<br>}</b></font><br></pre>But when running it i get an error with no explanation.<br><br>(I have configured one soft phone x-lite with 1 sip account 3000 ) and run astrisk.<br>The login to the asterisk manager is successful.)<br>
How can i add more SIP accounts to x-lite ? <br>How can i get more info about the error ? <br><br>Thanks (and hope its not to much questions.)<br><br><br><br><br><br><br></div>