summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-06-22 08:53:11 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-06-22 08:53:11 +0000
commit8f496dfb6c1bde6a98ae37526cdc798cdc15201e (patch)
tree7bf63731849cc0fc3fb3251fe10f0b926aa44348 /pjsip/include/pjsua-lib
parentb1eca09ffbec5ba011743bfee90cdeabf545b16b (diff)
Fix #1526:
- Fix incoming call without SDP by delaying media init in on_incoming_call() until call setting is set i.e: via call answer. Note that there is no need to delay the media init in the case of call replace request, the call setting is already set in the incoming call callback, i.e: via on_call_replace_request2() callback or just the current setting of the replaced call. - Fix processing call replace request when the media init is performed asynchronously. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4175 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h17
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h4
2 files changed, 17 insertions, 4 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index a964815f..553f3dad 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -4084,7 +4084,8 @@ PJ_DECL(pj_status_t) pjsua_call_get_rem_nat_type(pjsua_call_id call_id,
/**
* Send response to incoming INVITE request. Depending on the status
* code specified as parameter, this function may send provisional
- * response, establish the call, or terminate the call.
+ * response, establish the call, or terminate the call. See also
+ * #pjsua_call_answer2().
*
* @param call_id Incoming call identification.
* @param code Status code, (100-699).
@@ -4102,9 +4103,17 @@ PJ_DECL(pj_status_t) pjsua_call_answer(pjsua_call_id call_id,
/**
- * Send response to incoming INVITE request. Depending on the status
- * code specified as parameter, this function may send provisional
- * response, establish the call, or terminate the call.
+ * Send response to incoming INVITE request with call setting param.
+ * Depending on the status code specified as parameter, this function may
+ * send provisional response, establish the call, or terminate the call.
+ * Notes about call setting:
+ * - if call setting is changed in the subsequent call to this function,
+ * only the first call setting supplied will applied. So normally
+ * application will not supply call setting before getting confirmation
+ * from the user.
+ * - if no call setting is supplied when SDP has to be sent, i.e: answer
+ * with status code 183 or 2xx, the default call setting will be used,
+ * check #pjsua_call_setting for its default values.
*
* @param call_id Incoming call identification.
* @param opt Optional call setting.
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index 326f916d..80ebec01 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -108,6 +108,7 @@ typedef struct call_answer
pjsua_msg_data *msg_data; /**< Answer's headers list. */
pj_str_t *reason; /**< Answer's reason phrase. */
unsigned code; /**< Answer's status code. */
+ pjsua_call_setting *opt; /**< Answer's call setting. */
} call_answer;
@@ -120,6 +121,8 @@ struct pjsua_call
{
unsigned index; /**< Index in pjsua array. */
pjsua_call_setting opt; /**< Call setting. */
+ pj_bool_t opt_inited;/**< Initial call setting has been set,
+ to avoid different opt in answer. */
pjsip_inv_session *inv; /**< The invite session. */
void *user_data; /**< User/application data. */
pjsip_status_code last_code; /**< Last status code seen. */
@@ -170,6 +173,7 @@ struct pjsua_call
} out_call;
struct {
call_answer answers;/**< A list of call answers. */
+ pjsip_dialog *replaced_dlg; /**< Replaced dialog. */
} inc_call;
} call_var;
} async_call; /**< Temporary storage for async