Changes between Version 9 and Version 10 of SIP_Redirection
- Timestamp:
- Nov 27, 2008 1:02:28 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SIP_Redirection
v9 v10 5 5 The redirection in this article is about processing SIP redirect (3xx) response in outgoing calls, and not about sending redirection/3xx response. Sending 3xx response in PJSUA-LIB is easy; just use {{{pjsua_call_hangup()}}} and give the new targets in Contact header in {{{msg_data}}} parameter. 6 6 7 [[BR]] 8 7 9 '''Table of Contents''' 8 10 [[PageOutline(2-3,,inline)]] 9 11 12 [[BR]] 10 13 11 14 == Objectives == … … 17 20 - the subsequent INVITE requests sent after the 3xx response must have the same To, From, and Call-ID as used by the original INVITE. While RFC 3261 only put this at RECOMMENDED strength (see section 8.1.3.4), in practice there are many servers out there that relies on this property. 18 21 19 20 == Alternative Way to Handle Redirect Response == 21 22 As alternative to the mechanism described in this article, application can also handle redirection call with the following approach: 23 - extract the URI in the Contact header(s) in the SIP redirect/3xx response 24 - for each URI, create a new invite session/call and send INVITE to this target, trying the targets sequentially and sorting the preference based on the q-value of the Contact. 25 26 However this this approach, each call will have a different Call-ID, From, and To headers, hence the applicability probably is more limited. 27 22 [[BR]] 28 23 29 24 == Implementation Details == … … 129 124 - when {{{--accept-redirect}}} is set to 2 (ask), user can enter 'Ra', 'Rr', or 'Rd' to accept, reject, or stop/disconnect the redirection. 130 125 126 [[BR]] 131 127 132 128 == Changes to Application == … … 135 131 136 132 It's good to remind here that while these callbacks traditionally only emits {{{PJSIP_EVENT_TSX_STATE}}} event, technically it can emit other types of events. Now especially with the pending redirection feature, a {{{PJSIP_EVENT_USER}}} event may be passed to these callbacks. Hence application should check for the event type before accessing the event structure. 133 134 [[BR]] 137 135 138 136 … … 150 148 151 149 While this is caused by application not following the requirement to call {{{pjsip_inv_process_redirect()}}}, nevertheless the library should be robust enough to handle this, so this will be fixed. 150 151 [[BR]] 152 153 == Alternative Way to Handle Redirect Response == 154 155 As alternative to the mechanism described in this article, application can also handle redirection call with the following approach: 156 - extract the URI in the Contact header(s) in the SIP redirect/3xx response 157 - for each URI, create a new invite session/call and send INVITE to this target, trying the targets sequentially and sorting the preference based on the q-value of the Contact. 158 159 However this this approach, each call will have a different Call-ID, From, and To headers, hence the applicability probably is more limited. 160 161