[pjsip] Lost packet count querying

Tomáš Valenta vali at kamarad.cz
Thu Nov 1 11:51:41 EDT 2007


I wonder again, how the library is scalable, great!
Hope this will also help someone else when it appears in the archive.
    Vali


----- Original Message ----- 
From: "Benny Prijono" <bennylp at pjsip.org>
To: "pjsip embedded/DSP SIP discussion" <pjsip at lists.pjsip.org>
Sent: Tuesday, October 30, 2007 4:49 PM
Subject: Re: [pjsip] Lost packet count querying


Tomáš Valenta wrote:
> Hi Benny,
> thanks, this is much better.
> I use the library compiled as a DLL (in Visual Studio), so I cannot access
> global variables. Therefore I had to create a function that returns 
> pointer
> to pjsau_var. Consider adding such function marked PJ_DECL into
> pjsua_internal so that access to PJSUA internals is enabled even from DLL.

Done. Added in pjsua_internal.h:

  PJ_DECL(struct pjsua_data*) pjsua_get_var(void);

> And one more improvement I suggest to you: Building DLL would be much
> simpler if it was macro-driven, i.e. if for example macro PJ_DLL was
> defined, PJ_DECL(T) would be then defined as __declspec(dllexport) and so 
> a
> DLL will be produced.

The "right way" perhaps is to add these in pj/compat/os_win32.h
(tips: since PJLIB doesn't have these now, I think you can add this
in your config_site.h):

   #define PJ_EXPORT_DECL_SPECIFIER __declspec(dllexport)
   #define PJ_EXPORT_DEF_SPECIFIER __declspec(dllexport)
   #define PJ_IMPORT_DECL_SPECIFIER __declspec(dllimport)

Then when building the library, declare PJ_DLL and PJ_EXPORTING
macros. And when building the application that imports the DLL,
declare PJ_DLL macro.

  -benny

> Cheers!
>     Vali
>
>
> ----- Original Message ----- 
> From: "Benny Prijono" <bennylp at pjsip.org>
> To: "pjsip embedded/DSP SIP discussion" <pjsip at lists.pjsip.org>
> Sent: Saturday, October 27, 2007 8:03 AM
> Subject: Re: [pjsip] Lost packet count querying
>
>
> Tomáš Valenta wrote:
>> Hello,
>> I participate in developing a TTS/ASR (text-to-speech /
>> automatic-speech-recognition) application and we need to support SIP in
>> the
>> application, so we decided to use PJSIP library. It is very simple to use
>
> Cool! :)
>
>> the library (pjsua-lib layer) and it provides sufficient functionality.
>> But
>> there is one thing I miss in pjsua-lib: data loss detection, which can be
>> very important especially for ASR part. The only way to do this I found,
>> was
>> to parse string returned by pjsua_call_dump() and get lost packet count
>> number.
>
> Ugh, that's ugly. A slightly better way perhaps is to access
> pjsua-lib's internal data by including pjsua_internal.h, where you
> can get the media session instance for a particular call. Then call
> pjmedia_session_get_stream_stat() to get the stream's statistic.
>
>> Is there a smarter way to get the information without modifying library
>> source code? No matter if it is lost packets count or lost frames count,
>> but
>> information that this frame does not contain real data would be very
>> valuable.
>
> An audio frame can have PJMEDIA_FRAME_TYPE_NONE type to indicate
> that there's no real data in it. I'm not sure if this is sufficient
> for your use case, since this type alone doesn't tell if the frame
> was lost, or if it's because there's no audio transmitted from the
> other side. The stream.c does have this information, but it's not
> propagated elsewhere (have a look at get_frame() function in stream.c).
>
>   -benny
>
>
>> Thanks.
>>     Vali
>>
>>
>> _______________________________________________
>> 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
>
>


-- 
Benny Prijono
http://www.pjsip.org

_______________________________________________
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








More information about the pjsip mailing list