ch.claudio.iax2
Class IAX2

java.lang.Object
  extended by ch.claudio.iax2.IAX2

public final class IAX2
extends java.lang.Object

Talk IAX2. Based on IETF draft-guy-iax-01 "IAX: Inter-Asterisk eXchange Version 2". This draft will expire on September 7, 2006.

The goal of this class is not to fully support IAX2 in all its aspects. It is a test-bed and will support in the short term set up of simple connections from IAX2 phones (clients) to IAX2 exchanges and other phones.

Version:
$Id: IAX2.java 184 2007-04-18 15:38:27Z claudio $
Author:
Claudio Nieder

Copyright (C) 2006 Claudio Nieder <private@claudio.ch>, CH-8610 Uster

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


Method Summary
 void authrep(java.lang.String user, java.lang.String md5Response)
          Send a AUTHREP packet
static IAX2 createConnection(java.lang.String serverName)
          Create a new IAX2 "connection".
 void dial(java.lang.String user, java.lang.String number)
          Set up a call to a number
 State getState()
           
static void main(java.lang.String[] args)
          Print license.
 void register(java.lang.String user, java.lang.String md5Response)
          Send a REQREQ packet
 void setPassword(java.lang.String passwordArg)
          Sets the password to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getState

public State getState()
Returns:
the state

createConnection

public static IAX2 createConnection(java.lang.String serverName)
Create a new IAX2 "connection". This binds the socket with a listener thread and verifies if the serverName is known. Returns null if it fails.

Parameters:
serverName - Name of peer for this connection.
Returns:
connection or null

register

public void register(java.lang.String user,
                     java.lang.String md5Response)
Send a REQREQ packet

Parameters:
user - user name
md5Response - answer to md5 challenge. May be null.

authrep

public void authrep(java.lang.String user,
                    java.lang.String md5Response)
Send a AUTHREP packet

Parameters:
user - user name
md5Response - answer to md5 challenge

dial

public void dial(java.lang.String user,
                 java.lang.String number)
Set up a call to a number

Parameters:
user -
number -

setPassword

public void setPassword(java.lang.String passwordArg)
Sets the password to use. Must be set before registering.

Parameters:
passwordArg -

main

public static final void main(java.lang.String[] args)
Print license.

Parameters:
args - ignored