summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2015-10-02 02:08:17 +0000
committerNanang Izzuddin <nanang@teluu.com>2015-10-02 02:08:17 +0000
commit17276f318cc81d64c26aa766ae763b2773659dbf (patch)
treee74a7e1385128c4b35f0427c96a4844c848f654f /pjsip/include
parent6c8379528fa59c07748c7ff2a63cccdf358fe45e (diff)
Close #1892: Add pjsua/pjsua2 callback on_call_tx_offer()/Call::onCallTxOffer() to notify incoming re-INVITE without offer.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5185 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h25
-rw-r--r--pjsip/include/pjsua2/call.hpp32
-rw-r--r--pjsip/include/pjsua2/endpoint.hpp3
3 files changed, 60 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 7ffd7062..c47d4c3c 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -910,6 +910,31 @@ typedef struct pjsua_callback
pjsip_status_code *code,
pjsua_call_setting *opt);
+
+ /**
+ * Notify application when call has received INVITE with no SDP offer.
+ * Application can update the call setting (e.g: add audio/video), or
+ * enable/disable codecs, or update other media session settings from
+ * within the callback, however, as mandated by the standard (RFC3261
+ * section 14.2), it must ensure that the update overlaps with the
+ * existing media session (in codecs, transports, or other parameters)
+ * that require support from the peer, this is to avoid the need for
+ * the peer to reject the offer.
+ *
+ * When this callback is not defined, the default behavior is to send
+ * SDP offer using current active media session (with all enabled codecs
+ * on each media type).
+ *
+ * @param call_id The call index.
+ * @param reserved Reserved param, currently not used.
+ * @param opt The current call setting, application can update
+ * this setting for generating the offer.
+ */
+ void (*on_call_tx_offer)(pjsua_call_id call_id,
+ void *reserved,
+ pjsua_call_setting *opt);
+
+
/**
* Notify application when registration or unregistration has been
* initiated. Note that this only notifies the initial registration
diff --git a/pjsip/include/pjsua2/call.hpp b/pjsip/include/pjsua2/call.hpp
index 917965e5..bd0b1ee1 100644
--- a/pjsip/include/pjsua2/call.hpp
+++ b/pjsip/include/pjsua2/call.hpp
@@ -851,6 +851,19 @@ struct OnCallRxOfferParam
};
/**
+ * This structure contains parameters for Call::onCallTxOffer() callback.
+ */
+struct OnCallTxOfferParam
+{
+ /**
+ * The current call setting, application can update this setting for
+ * generating the offer. Note that application should maintain any
+ * active media to avoid the need for the peer to reject the offer.
+ */
+ CallSetting opt;
+};
+
+/**
* This structure contains parameters for Call::onCallRedirected() callback.
*/
struct OnCallRedirectedParam
@@ -1603,6 +1616,25 @@ public:
{ PJ_UNUSED_ARG(prm); }
/**
+ * Notify application when call has received INVITE with no SDP offer.
+ * Application can update the call setting (e.g: add audio/video), or
+ * enable/disable codecs, or update other media session settings from
+ * within the callback, however, as mandated by the standard (RFC3261
+ * section 14.2), it must ensure that the update overlaps with the
+ * existing media session (in codecs, transports, or other parameters)
+ * that require support from the peer, this is to avoid the need for
+ * the peer to reject the offer.
+ *
+ * When this callback is not implemented, the default behavior is to send
+ * SDP offer using current active media session (with all enabled codecs
+ * on each media type).
+ *
+ * @param prm Callback parameter.
+ */
+ virtual void onCallTxOffer(OnCallTxOfferParam &prm)
+ { PJ_UNUSED_ARG(prm); }
+
+ /**
* Notify application on incoming MESSAGE request.
*
* @param prm Callback parameter.
diff --git a/pjsip/include/pjsua2/endpoint.hpp b/pjsip/include/pjsua2/endpoint.hpp
index e4039874..3d650bd1 100644
--- a/pjsip/include/pjsua2/endpoint.hpp
+++ b/pjsip/include/pjsua2/endpoint.hpp
@@ -1358,6 +1358,9 @@ private:
void *reserved,
pjsip_status_code *code,
pjsua_call_setting *opt);
+ static void on_call_tx_offer(pjsua_call_id call_id,
+ void *reserved,
+ pjsua_call_setting *opt);
static pjsip_redirect_op on_call_redirected(pjsua_call_id call_id,
const pjsip_uri *target,
const pjsip_event *e);