Messagefactory
MessageFactory serves as a personal messaging constructor. It's responsible for creating both the questions (requests) and the answers (responses) in the SIP conversation.
Creating a Request: When you want to initiate a call or simply say "hello" over SIP, you create a request. This process is similar to sending a letter – this request is your letter, complete with the address and the content.
// Create a basic SIP request to invite someone to a call
URI requestURI = addressFactory.createURI("sip:friend@example.com");
Request request = messageFactory.createRequest(
requestURI,
"INVITE", // The method
callIdHeader, // Unique call identifier
cSeqHeader, // Sequence number for ordering messages
fromHeader, // Who the request is from
toHeader, // Who the request is to
viaHeaders, // "Via" headers specifying the transport route
maxForwardsHeader // Limits the number of hops a request can make
);
Sign in to read the full article
Start innovating with Mobius
What's next? Let's talk!