Home --> Documentations --> PJSIP Reference
Core proxy operations.
More...
◆ pjsip_endpt_create_request_fwd()
Create new request message to be forwarded upstream to new destination URI in uri. The new request is a full/deep clone of the request received in rdata, unless if other copy mechanism is specified in the options. The branch parameter, if not NULL, will be used as the branch-param in the Via header. If it is NULL, then a unique branch parameter will be used.
Note: this function DOES NOT perform Route information preprocessing as described in RFC 3261 Section 16.4. Application must take care of removing/updating the Route headers according of the rules as described in that section.
- Parameters
-
endpt | The endpoint instance. |
rdata | The incoming request message. |
uri | The URI where the request will be forwarded to. |
branch | Optional branch parameter. Application may specify its own branch, for example if it wishes to perform loop detection. If the branch parameter is not specified, this function will generate its own by calling pjsip_calculate_branch_id() function. |
options | Optional option flags when duplicating the message. |
tdata | The result. |
- Returns
- PJ_SUCCESS on success.
◆ pjsip_endpt_create_response_fwd()
Create new response message to be forwarded downstream by the proxy from the response message found in rdata. Note that this function practically will clone the response as is, i.e. without checking the validity of the response or removing top most Via header. This function will perform full/deep clone of the response, unless other copy mechanism is used in the options.
- Parameters
-
endpt | The endpoint instance. |
rdata | The incoming response message. |
options | Optional option flags when duplicate the message. |
tdata | The result |
- Returns
- PJ_SUCCESS on success.
◆ pjsip_calculate_branch_id()
Create a globally unique branch parameter based on the information in the incoming request message, for the purpose of creating a new request for forwarding. This is the default implementation used by pjsip_endpt_create_request_fwd() function if the branch parameter is not specified.
The default implementation here will just create an MD5 hash of the top-most Via.
Note that the returned string was allocated from rdata's pool.
- Parameters
-
rdata | The incoming request message. |
- Returns
- Unique branch-ID string.
References PJ_END_DECL.
PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.
|