SIP Stack Launch
You can launch the SIP stack from user code by creating an instance of com.mobius.software.protocols.sip.web.SIPRunner and calling its startServer() method. This method initializes the SIP stack using configuration stored in the system (via the management interface) and returns a reference to SIPServerInterface. This interface allows other modules (such as call controllers or billing systems) to send and receive SIP messages programmatically.
Methods of SIPServerInterface
Method | Description |
public void setCallbackInterface(SIPCallbackInterface callbackInterface) | Registers a callback interface for receiving and handling incoming SIP requests and responses (e.g., INVITE, BYE, REGISTER). This is your entry point for app logic. |
public String getLocalAddress() | Returns the IP address used by the local stack for outbound and listening links. |
public void setExternalListener(SipExternalListener listener) | Sets a listener used for integrating with external systems (e.g., monitoring or routing layers). |
public SipExternalListener getExternalListener() | Retrieves the external listener that was set earlier, if any. |
public Boolean isDestinationUp(String destinationID) | Checks whether a configured SIP destination (i.e., domain or peer) is reachable and operational. |
public Boolean isServerUp(String destinationID, String serverID) | Checks the operational status of a specific server link under a given destination. |
public Boolean isLinkUp(String destinationID, String linkID) | Checks if a specific client or server SIP link is up and running. |
public String getDestinationByName(String destinationName) | Returns the internal ID or object reference for a destination by its name (as defined in the UI/config). |
public SipStack getSipStack() | Returns a reference to the underlying JAIN SIP stack for lower-level access or customization. |
public ListeningPoint getLinkListeningPoint(SipLink currLink) | Returns the ListeningPoint (IP, port, transport) for a specific SIP link. Can be used to inspect or debug socket-level setup. |
public void sendRequestToServer(Request request) | Sends a SIP request (like INVITE, BYE, REGISTER) from the stack to a remote server link. Used to initiate calls or SIP flows. |
public void sendRequestToUser(Request request) | Sends a SIP request directly to a registered user (if acting as a registrar). Used for server-initiated calls. |
public void sendResponse(Response response) | Sends a SIP response to a received request (e.g., 200 OK, 486 Busy, etc.). |
Launching SIP Stack and Registering a Callback
SIPRunner runner = new SIPRunner();
SIPServerInterface sipServer = runner.startServer();
// Set your handler for SIP messages
sipServer.setCallbackInterface(new MySIPCallbackHandler());
Sign in to read the full article
Start innovating with Mobius
What's next? Let's talk!