summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib/pjsua.h
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-06-16 05:10:45 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-06-16 05:10:45 +0000
commitd1fc1193fc57517f5adc32bc2e0b9077fd367304 (patch)
treed7e0d008d09a3468974bca26b23f97baf15c83e4 /pjsip/include/pjsua-lib/pjsua.h
parent6e5dd25621edefef5a17a000bd75b0d825d6c32f (diff)
Closed #1173: PJSUA callback to allow creation of custom media transports by application
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3585 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib/pjsua.h')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 404b140c..b52990eb 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -421,6 +421,22 @@ typedef struct pjsua_reg_info
/**
+ * This enumeration specifies the options for custom media transport creation.
+ */
+typedef enum pjsua_create_media_transport_flag
+{
+ /**
+ * This flag indicates that the media transport must also close its
+ * "member" or "child" transport when pjmedia_transport_close() is
+ * called. If this flag is not specified, then the media transport
+ * must not call pjmedia_transport_close() of its member transport.
+ */
+ PJSUA_MED_TP_CLOSE_MEMBER = 1
+
+} pjsua_create_media_transport_flag;
+
+
+/**
* This structure describes application callback to receive various event
* notification from PJSUA-API. All of these callbacks are OPTIONAL,
* although definitely application would want to implement some of
@@ -918,6 +934,32 @@ typedef struct pjsua_callback
void (*on_ice_transport_error)(int index, pj_ice_strans_op op,
pj_status_t status, void *param);
+ /**
+ * This callback can be used by application to implement custom media
+ * transport adapter for the call, or to replace the media transport
+ * with something completely new altogether.
+ *
+ * This callback is called when a new call is created. The library has
+ * created a media transport for the call, and it is provided as the
+ * \a base_tp argument of this callback. Upon returning, the callback
+ * must return an instance of media transport to be used by the call.
+ *
+ * @param call_id Call ID
+ * @param media_idx The media index in the SDP for which this media
+ * transport will be used.
+ * @param base_tp The media transport which otherwise will be
+ * used by the call has this callback not been
+ * implemented.
+ * @param flags Bitmask from pjsua_create_media_transport_flag.
+ *
+ * @return The callback must return an instance of media
+ * transport to be used by the call.
+ */
+ pjmedia_transport* (*on_create_media_transport)(pjsua_call_id call_id,
+ unsigned media_idx,
+ pjmedia_transport *base_tp,
+ unsigned flags);
+
} pjsua_callback;