example.sip
Class BaseUAC

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.sip.BaseUAC
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener, javax.microedition.sip.SipClientConnectionListener, javax.microedition.sip.SipServerConnectionListener
Direct Known Subclasses:
Sippy_A, Sippy_B

public abstract class BaseUAC
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener, javax.microedition.sip.SipClientConnectionListener, javax.microedition.sip.SipServerConnectionListener

Application demonstrates sip clients talking via sip server and registrar. Both clients register to sip registrar. Send connection informations in INVITE message to each other and start to communicate via sockets. Application demonstrates REGISTER, INVITE, BYE requests and OK, RINGING responses.


Nested Class Summary
(package private)  class BaseUAC.Status
          Help to keep status of application.
 
Field Summary
protected  javax.microedition.lcdui.Form byeFrm
           
protected  javax.microedition.lcdui.Form failFrm
           
 java.lang.String friendDomain
          second client's domain
 java.lang.String friendName
          user name of second client
 int friendSipPort
          sip port of second client we need this because running both clients on the same machine.
 int friendSocket
          socket used by second client
protected  javax.microedition.lcdui.Form inviteFrm
           
 java.lang.String myDisplayName
          display name of the client
 java.lang.String myName
          user name if the client
 int mySipPort
          sip port the client is listening on
 int mySocket
          socket used by this client
protected  javax.microedition.lcdui.Form proxyFrm
          forms used in ui
protected  javax.microedition.lcdui.Form registerFrm
           
protected  javax.microedition.lcdui.Form ringingFrm
           
protected  javax.microedition.lcdui.Form sendFrm
           
protected  javax.microedition.lcdui.Form talkFrm
           
protected  javax.microedition.lcdui.Form waitScreen
           
 
Constructor Summary
BaseUAC()
           
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command command, javax.microedition.lcdui.Displayable displayable)
           
 void destroyApp(boolean unconditional)
           
 java.io.InputStream getSocketIStream()
           
 java.io.OutputStream getSocketOStream()
           
 void notifyRequest(javax.microedition.sip.SipConnectionNotifier sipConnectionNotifier)
           
 void notifyResponse(javax.microedition.sip.SipClientConnection sipClientConnection)
           
 void pauseApp()
           
 void setFriendIdentity(java.lang.String name, java.lang.String domain, int port)
          Setup all params of 2nd client.
 void setProxyAddress(java.lang.String address)
           
 void setSocket(int socket)
           
 void setUserIdentity(java.lang.String name, java.lang.String displayName, int port)
          Setup all params of the client.
 void start()
           
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest, startApp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myName

public java.lang.String myName
user name if the client


myDisplayName

public java.lang.String myDisplayName
display name of the client


mySocket

public int mySocket
socket used by this client


mySipPort

public int mySipPort
sip port the client is listening on


friendName

public java.lang.String friendName
user name of second client


friendSocket

public int friendSocket
socket used by second client


friendSipPort

public int friendSipPort
sip port of second client we need this because running both clients on the same machine. That isn't typical use case.


friendDomain

public java.lang.String friendDomain
second client's domain


proxyFrm

protected javax.microedition.lcdui.Form proxyFrm
forms used in ui


registerFrm

protected javax.microedition.lcdui.Form registerFrm

waitScreen

protected javax.microedition.lcdui.Form waitScreen

inviteFrm

protected javax.microedition.lcdui.Form inviteFrm

talkFrm

protected javax.microedition.lcdui.Form talkFrm

sendFrm

protected javax.microedition.lcdui.Form sendFrm

failFrm

protected javax.microedition.lcdui.Form failFrm

ringingFrm

protected javax.microedition.lcdui.Form ringingFrm

byeFrm

protected javax.microedition.lcdui.Form byeFrm
Constructor Detail

BaseUAC

public BaseUAC()
Method Detail

start

public void start()

pauseApp

public void pauseApp()
Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

public void destroyApp(boolean unconditional)
Specified by:
destroyApp in class javax.microedition.midlet.MIDlet

setProxyAddress

public void setProxyAddress(java.lang.String address)

setSocket

public void setSocket(int socket)

setUserIdentity

public void setUserIdentity(java.lang.String name,
                            java.lang.String displayName,
                            int port)
Setup all params of the client.

Parameters:
name - username of the client.
displayName - the display name of the user.
port - sip listener port

setFriendIdentity

public void setFriendIdentity(java.lang.String name,
                              java.lang.String domain,
                              int port)
Setup all params of 2nd client.

Parameters:
name - the username of 2nd client
domain - the domain of 2nd client
port - the listener sip port of 2nd client

commandAction

public void commandAction(javax.microedition.lcdui.Command command,
                          javax.microedition.lcdui.Displayable displayable)
Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener

notifyResponse

public void notifyResponse(javax.microedition.sip.SipClientConnection sipClientConnection)
Specified by:
notifyResponse in interface javax.microedition.sip.SipClientConnectionListener

notifyRequest

public void notifyRequest(javax.microedition.sip.SipConnectionNotifier sipConnectionNotifier)
Specified by:
notifyRequest in interface javax.microedition.sip.SipServerConnectionListener

getSocketIStream

public java.io.InputStream getSocketIStream()

getSocketOStream

public java.io.OutputStream getSocketOStream()