public class SipMessageFactory extends BasicSipMessageFactory
A valid SIP request sent by a UAC MUST, at least, contain the following header fields: To, From, CSeq, Call-ID, Max-Forwards, and Via; all of these header fields are mandatory in all SIP requests. These sip header fields are the fundamental building blocks of a SIP message, as they jointly provide for most of the critical message routing services including the addressing of messages, the routing of responses, limiting message propagation, ordering of messages, and the unique identification of transactions. These header fields are in addition to the mandatory request line, which contains the method, Request-URI, and SIP version.
Constructor and Description |
---|
SipMessageFactory() |
Modifier and Type | Method and Description |
---|---|
static SipMessage |
create2xxAckRequest(DialogInfo dialog,
SipMessage resp,
java.lang.String content_type,
byte[] body)
Creates an ACK request for a 2xx response.
|
static SipMessage |
create2xxAckRequest(SipMessage method,
SipMessage resp,
java.lang.String content_type,
byte[] body)
Creates an ACK request for a 2xx response.
|
static SipMessage |
createByeRequest(DialogInfo dialog)
Creates a BYE request.
|
static SipMessage |
createCancelRequest(SipMessage req)
Creates a CANCEL request.
|
static SipMessage |
createInviteRequest(Dialog dialog,
java.lang.String content_type,
byte[] body)
Creates a new INVITE request within a dialog (re-invite).
|
static SipMessage |
createInviteRequest(GenericURI request_uri,
NameAddress to,
NameAddress from,
NameAddress contact,
java.lang.String call_id,
java.lang.String content_type,
byte[] body)
Creates a new INVITE request out of any pre-existing dialogs.
|
static SipMessage |
createMessageRequest(NameAddress recipient,
NameAddress from,
java.lang.String call_id,
java.lang.String subject,
java.lang.String content_type,
byte[] body)
Creates a new MESSAGE request (RFC3428).
|
static SipMessage |
createNon2xxAckRequest(DialogInfo dialog,
SipMessage resp)
Creates an ACK request for a non-2xx response.
|
static SipMessage |
createNon2xxAckRequest(SipMessage method,
SipMessage resp)
Creates an ACK request for a non-2xx response.
|
static SipMessage |
createNotifyRequest(Dialog dialog,
java.lang.String event,
java.lang.String id,
java.lang.String sipfragment)
Creates a new NOTIFY request (RFC3265) within a dialog, with a SIP fragment ("message/sipfrag") as message body.
|
static SipMessage |
createNotifyRequest(Dialog dialog,
java.lang.String event,
java.lang.String id,
java.lang.String content_type,
byte[] body)
Creates a new NOTIFY request (RFC3265) within a dialog.
|
static SipMessage |
createPrackRequest(Dialog dialog,
SipMessage resp_1xx,
java.lang.String content_type,
byte[] body)
Creates a new PRACK request (RFC3262).
|
static SipMessage |
createReferRequest(Dialog dialog,
NameAddress refer_to,
NameAddress referred_by)
Creates a new REFER request (RFC3515) within a dialog
|
static SipMessage |
createReferRequest(NameAddress recipient,
NameAddress from,
NameAddress contact,
java.lang.String call_id,
NameAddress refer_to)
Creates a new REFER request (RFC3515).
|
static SipMessage |
createRegisterRequest(GenericURI registrar,
NameAddress to,
NameAddress from,
NameAddress contact,
java.lang.String call_id)
Creates a new REGISTER request.
|
static SipMessage |
createSubscribeRequest(Dialog dialog,
java.lang.String event,
java.lang.String id,
java.lang.String content_type,
byte[] body)
Creates a new SUBSCRIBE request (RFC3265) within a dialog (re-subscribe).
|
static SipMessage |
createSubscribeRequest(GenericURI recipient,
NameAddress to,
NameAddress from,
NameAddress contact,
java.lang.String call_id,
java.lang.String event,
java.lang.String id,
java.lang.String content_type,
byte[] body)
Creates a new SUBSCRIBE request (RFC3265) out of any pre-existing dialogs.
|
createRequest, createRequest, createRequest, createResponse, createResponse
public static SipMessage createInviteRequest(GenericURI request_uri, NameAddress to, NameAddress from, NameAddress contact, java.lang.String call_id, java.lang.String content_type, byte[] body)
request_uri
- the request URIto
- name address in the To header fieldfrom
- name address in the From header fieldcall_id
- the Call-ID valuecontact
- contact address, that is the name address in the Contact header field, or nullcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createInviteRequest(Dialog dialog, java.lang.String content_type, byte[] body)
dialog
- the current dialogcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage create2xxAckRequest(DialogInfo dialog, SipMessage resp, java.lang.String content_type, byte[] body)
dialog
- the current dialogresp
- the response message to be confirmedcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage create2xxAckRequest(SipMessage method, SipMessage resp, java.lang.String content_type, byte[] body)
method
- the initial request message, accepted by the 2xx responseresp
- the response message to be confirmedcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createNon2xxAckRequest(SipMessage method, SipMessage resp)
method
- the initial request message, refused by the non-2xx responseresp
- the response message to be confirmedpublic static SipMessage createNon2xxAckRequest(DialogInfo dialog, SipMessage resp)
dialog
- the current dialogresp
- the response message to be confirmedpublic static SipMessage createCancelRequest(SipMessage req)
req
- the request message that is going to be cancelledpublic static SipMessage createByeRequest(DialogInfo dialog)
dialog
- dialog to be closedpublic static SipMessage createRegisterRequest(GenericURI registrar, NameAddress to, NameAddress from, NameAddress contact, java.lang.String call_id)
registrar
- the address of the registrar serverto
- name address in the To header fieldfrom
- name address in the From header fieldcontact
- contact address, that is the name address in the Contact header field, or nullcall_id
- the Call-ID valuepublic static SipMessage createPrackRequest(Dialog dialog, SipMessage resp_1xx, java.lang.String content_type, byte[] body)
dialog
- the current dialogresp_1xx
- the reliable 1xx response the has to be confirmed by the PRACKcontent_type
- the type of the content to be included within the PRACK (or null in case of no message body)body
- the message body to be included within the PRACK, or null. In an offer/answer model, this body represents the answer to the offer contained in the 1xx response messagepublic static SipMessage createMessageRequest(NameAddress recipient, NameAddress from, java.lang.String call_id, java.lang.String subject, java.lang.String content_type, byte[] body)
recipient
- the recipient addressfrom
- name address in the From header fieldcall_id
- the Call-ID valuesubject
- the subject of the message (for the Subject header field), or nullcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createReferRequest(NameAddress recipient, NameAddress from, NameAddress contact, java.lang.String call_id, NameAddress refer_to)
recipient
- the recipient addressfrom
- name address in the From header fieldcontact
- contact address, that is the name address in the Contact header field, or nullcall_id
- the Call-ID valuerefer_to
- the name address in the Refer-To header fieldpublic static SipMessage createReferRequest(Dialog dialog, NameAddress refer_to, NameAddress referred_by)
dialog
- the current dialogrefer_to
- the name address in the Refer-To header fieldreferred_by
- the name address in the Refer-By header field, or nullpublic static SipMessage createSubscribeRequest(GenericURI recipient, NameAddress to, NameAddress from, NameAddress contact, java.lang.String call_id, java.lang.String event, java.lang.String id, java.lang.String content_type, byte[] body)
recipient
- the recipient addressto
- name address in the To header fieldfrom
- name address in the From header fieldcontact
- contact address, that is the name address in the Contact header field, or nullcall_id
- the Call-ID valueevent
- event packageid
- the event idcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createSubscribeRequest(Dialog dialog, java.lang.String event, java.lang.String id, java.lang.String content_type, byte[] body)
dialog
- the current dialogevent
- event packageid
- the event idcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createNotifyRequest(Dialog dialog, java.lang.String event, java.lang.String id, java.lang.String content_type, byte[] body)
dialog
- the current dialogevent
- event packageid
- the event idcontent_type
- content type, or null in case of no message bodybody
- message content (body), or nullpublic static SipMessage createNotifyRequest(Dialog dialog, java.lang.String event, java.lang.String id, java.lang.String sipfragment)
dialog
- the current dialogevent
- event packageid
- the event idsipfragment
- a fragment of a SIP message to be included as message body