pjmedia_session declaration

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

 



Hi,
instead of using pjmedia_session you should use pjmedia_session_info.

Here is an example to list the codec(s) used by a call:

...
int i;
pjmedia_session_info sess_info;
pjmedia_session* session;

session = pjsua_call_get_media_session (call_id);
if (session) {
    pjmedia_session_get_info (session, &sess_info);
    for (i=0; i<sess_info.stream_cnt; i++) {
        fprintf (stderr, "\n\nCodec used: %.*s\n\n",
                 (int)sess_info.stream_info[i].fmt.encoding_name.slen,
                 sess_info.stream_info[i].fmt.encoding_name.ptr);
    }
}
...


Regards,
Dan Arrhenius

p.s.
I'm using a webmail client so the formatting of the code may look ugly.


> Hi,
>
> I'm using the PJSUA API for a simple SIP-Client. I want to know the codec
> currently used (which might change during the call with an SDP update).
>
> I try to use the on_stream_created callback from the pjsua_callbacks
> structure. The signature of this function is
>
>   void (*on_stream_created)(pjsua_call_id call_id, pjmedia_session *sess,
> unsigned stream_idx, pjmedia_port **p_port);
>
> My problem is the type of the second parameter: pjmedia_session is defined
> in pjmedia/src/pjmedia/session.c - yes ".c".
>
> How is my compiler supposed to find that definition, when it is not
> available in any header file? Since I want to access the stream_info array
> inside of sess, the compiler needs to know the memory layout of
> pjmedia_session when compiling my on_stream_created callback function.
>
> I suspect that I'm missing something fundamental, trivial and obvious, but
> I just can't find it ... am I not able to see the wood for the trees?
>
> What's the deal with that structure?
>
> Thanks,
> Sebastian.
>
> PS: making a local copy of the pjmedia_session definition to my file fixes
> the compiling and everything works fine. But that's not the way
> on_stream_created is supposed to be used, is it?
>
> _______________________________________________
> 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
>





[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