Changes between Version 1 and Version 2 of SIP_Redirection


Ignore:
Timestamp:
Jan 22, 2008 10:43:56 AM (12 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SIP_Redirection

    v1 v2  
    2424So you dial Perry's URI, and also configure the (same) call with my URI as alternate target. If Perry picks up the phone, good, you can offload your rants to him. If he doesn't pick up the phone, the call will go to its alternate target, which is me (as long as Perry doesn't also redirect the call to his voice mail). Of course this is bad news for me, but you, the customer, is happy, and that's the main thing. 
    2525 
     26 
     27== Configuring Multiple Targets == 
     28 
     29Both call redirection and multiple call targets are done with the same function below: 
     30 
     31{{{ 
     32  PJ_DECL(pj_status_t) pjsua_call_manage_target(pjsua_call_id call_id, 
     33                                                const pj_str_t *target, 
     34                                                pjsip_status_code tgt_code, 
     35                                                const pj_str_t *referer, 
     36                                                float qvalue, 
     37                                                const pjsua_msg_data *msg_data); 
     38}}} 
     39 
     40The parameters of the function are as follows: 
     41 
     42 * ''call_id'': the call ID of an outgoing call which status is not disconnected yet. 
     43 * ''target'': target URI. 
     44 * ''tgt_code'': operation to be applied to the target: 
     45     - value 100-199: the target will be added, but it will not be called until it's code is set to 2xx. 
     46     - value 200-299: the target will be added and called as soon as possible. 
     47     - value 300-699: the target will be removed from the list, if it's present. 
     48 * ''referer'': Optionally specify the URI of the referer, that is the URI of the original target which returned redirection response containing this target. This referer URI is used to calculate the priority of this new target. If referer is not used, the target priority will be calculated from the qvalue parameter instead. 
     49 * ''qvalue'': Priority value, from 0 to 1. Target with lower priority number will be called first. If application specify zero, then this target will be selected first for the next call, and if 1, this target will be called last. 
     50 * ''msg_data'': Optional list of headers etc to be added to outgoing call to this target. 
     51 
     52 
     53Please see the function documentation for details. 
     54 
     55For call redirection, there is new callback in {{{pjsua_callback}}} to notify application about redirection response from callee: 
     56 
     57{{{ 
     58    void (*on_call_redirected)(pjsua_call_id call_id,  
     59                               unsigned target_cnt, 
     60                               const pj_str_t target[], 
     61                               pjsip_event *e); 
     62}}} 
     63 
     64For SIP redirection, application would have to implement {{{on_call_redirected()}}} callback above, and call {{{pjsua_call_manage_target()}}} for each target that it wants the call to follow. 
     65 
     66For configuring alternate target to outgoing call without waiting for 3xx response, application can simply add the target with {{{pjsua_call_manage_target()}}} immediately after making the call