GNU ZRTP for pjproject - proposal to implement on_create_media_transport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Benny,

the attached patch is a proposal how to implement the
on_create_media_transport callback. I modified two file:
pjsua-lib/pjsua.h   - adding the enum and the callback to callback
                      structure

pjsua-lib/pjsua_media.c - adding the callback in method
                          pjsua_media_channel_init(), just before the
                          pjmedia_transport_media_create

Please see the comment just before calling the callback method regarding
when to call (because of SRTP transport).

Any advise how to enhance the implmentation?

Regards,
Werner

Am 07.12.2010 10:52, schrieb Benny Prijono:
> 
> We can't do that, as currently we don't have such "position" information.
> 
> My idea is to add a new pjsua callback like this:
> 
> 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 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);
> 
> 
>  -Benny
> 
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
> 
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-callback-to-application-on-media-transport.patch
Type: text/x-patch
Size: 4898 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20101217/9addca06/attachment.patch>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux