Version

AddressFactory

The AddressFactory interface is tasked with creating the very essence of addresses and URIs. Whether you're dialing into a SIP session or reaching out via telephone URL (TelURL), AddressFactory provides the tools necessary to create these essential components. Let's dive into the key methods provided by AddressFactory and translate their functionalities into more accessible terms.

Key Methods

createURI(String uri): This is go-to method for forging a URI (Uniform Resource Identifier) from a string representation. It's akin to formatting a specific address on a map; the string could lead to a web resource, a SIP address, or a telephone number. The feature of this method is its ability to decrypt and form a string into a navigable URI.

createSipURI(String user, String host): Tailored specifically for SIP communications, this method assembles a SIP URI using a user and host. This is similar to creating an email address, but for SIP, allowing direct communication with another entity in the SIP universe.

createTelURL(String phoneNumber): In the realm where telephone networks meet the digital age, this method crafts a TelURL based on a given phone number. It's the bridge connecting traditional telephone systems with modern, internet-based communications.

createAddress(String address): This versatile method takes a string – which could be a raw URI, a SIP URI, or a display name paired with a URI – and transforms it into an Address object. It's like taking a raw gemstone and cutting it to fit perfectly into a piece of jewelry.

createAddress(URI uri): For scenarios where you already have a URI object and need to encapsulate it within an Address object, this method comes to the rescue. It's a straightforward way to wrap a URI, providing it with additional context or display information if needed.

createAddress(String displayName, URI uri): This method allows for the creation of a more detailed address, complete with a display name. It's particularly useful for user-friendly applications where the raw URI might be too cryptic. It is akin to assigning a contact name to a phone number in contact list. This method does something similar for SIP addresses.

Practical Use

Let's see how one might use these methods in practice:

AddressFactory addressFactory = ...; // Obtained from SipFactory
// Crafting a SIP URI for a user named Alice at example.com
SipURI sipURI = addressFactory.createSipURI("alice", "example.com");
// Creating a telephone URL for the number +123456789
TelURL telURL = addressFactory.createTelURL("+123456789");
// Formulating an Address object from a SIP URI string
Address sipAddress = addressFactory.createAddress("sip:alice@example.com");
// Wrapping a URI object into an Address
Address uriAddress = addressFactory.createAddress(sipURI);
// Constructing an Address with a display name
Address namedAddress = addressFactory.createAddress("Alice <sip:alice@example.com>");

AddressFactory empowers you to craft and manage the fundamental elements of SIP communication addresses and URIs. From the creating a specific SIP URI to the developing a user-friendly address with a display name, understanding and utilizing these methods enable seamless navigation and management of SIP communications. Whether you're setting up calls, messages, or sessions, AddressFactory lays the groundwork for a flexible SIP communication framework.

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com