Creating custom conf port in pjsua

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

 



Hi Nanang,

Thanks for the pointer. I realised the problem was in the ioqueue, but I
assumed the max was dynamically assigned based on the call count.
Unlucky choice of max calls caused that assumption and I should've
checked for a define before troubling you, so sorry about that. I have
since solved this by reducing my max calls to 30 and everything works. 

However things aren't perfect. I did notice that when starting up my
app, I get an immediate crackle out of my media device. The crackle
lasts for a little under a second then stops. This doesn't happen every
time, but often enough for it to be annoying so I am trying to work out
what is sending this noise down to my device upon start up but I have no
idea.

Here is a code snippet of how I am doing this. I hope that it might be
useful to anyone else that needs to integrate an RTP stream into their
UA, and if anyone can see where the crackle problem would come from that
would also be great.

Thanks again Nanang.

Pierre

pj_status_t status;
pjmedia_transport * mediaTransport;
pjmedia_stream_info streamInfo;
pj_pool_t * memoryPool;
pjmedia_stream * stream;
pjmedia_port * streamPort;
pjsua_conf_port_id confPortId;
                
status = pjmedia_transport_udp_create( pjsua_get_pjmedia_endpt(),
TRANSPORT_NAME, LOCAL_PORT, 0, &mediaTransport );
if( status != PJ_SUCCESS )
{
    error("Failed to create media transport", status );
    return;
}

/* Reset stream info. */
pj_bzero( &streamInfo, sizeof( pjmedia_stream_info ) );
/* Initialize stream info */

/* Create memory pool */
memoryPool = pjmedia_endpt_create_pool( pjsua_get_pjmedia_endpt(),
"Memory Pool", 256, 1024 );
if( !memoryPool )
{
	error( "Failed to allocate media pool", -1 );
	return;
}

status = pjmedia_stream_create( pjsua_get_pjmedia_endpt(), memoryPool,
&streamInfo, mediaTransport, NULL, &stream );
if( status != PJ_SUCCESS )
{
    error("Failed to create stream", status );
    return;
}

status = pjmedia_stream_get_port( stream, &streamPort);
if( status != PJ_SUCCESS )
{
    error("Failed to get stream port", status );
    return;
}

status = pjsua_conf_add_port( memoryPool, streamPort, &confPortId );
if( status != PJ_SUCCESS )
{
    error("Failed to add stream port to PJSIP UA", status );
    return;
}

status = pjmedia_stream_start( stream );
if( status != PJ_SUCCESS )
{
    error("Failed to start stream", status );
    return;
}
-----Original Message-----
From: pjsip-bounces@xxxxxxxxxxxxxxx
[mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of Nanang Izzuddin
Sent: Wednesday, 13 August 2008 8:16 PM
To: pjsip list
Subject: Re: Creating custom conf port in pjsua

Hi Pierre,

The limitation seems to come from ioqueue, i.e PJ_IOQUEUE_MAX_HANDLES
which by default is set to 64, and all of them are being used by
'calls' (currently media transports are precreated in PJSUA and when
you specify max calls = 32 it preserve 64 handles, RTP & RTCP for each
call). You can increase PJ_IOQUEUE_MAX_HANDLES by defining it (to a
bigger value than 64) in the config_site.h.

Regards,
nanang



2008/8/13 Pierre Abou-Haila <pierre.abou-haila at c4i.com>:
> Hi Everyone,
>
> I have an audio device that transmits an RTP stream to my PC running
> PJSIP. I would like to convert that incoming RTP stream into a
> conference port so I can mix it with active calls using the conference
> bridge.
>
> I have been looking through documentation and searching the mailing
list
> for a solution and I came across
>
http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2008-April/002738
> .html.
>
> I have since tried to follow the steps provided by Nanang but
> unfortunately I can't get past the first step, i.e. creating a media
> transport. I have searched through the documentation for how to do
this
> and so far as I could tell I should do it like so
>
> pj_status_t status = pjmedia_transport_udp_create(
> pjsua_get_pjmedia_endpt(), "Custom Call", port, 0, &mediaTransport );
>
> This however doesn't work, and I get the error 70010, too many
objects.
> Stepping through the code I realised the media end point from
> pjsua_get_pjmedia_endpt(), already has the maximum number of
transports
> created for the 32 max calls I have configured PJSIP for.
>
> I have been trying to find out how to increase this, or possibly raise
> my max calls and hijack the last two transports to support my custom
> streams, but I have yet to find a solution.
>
> Any advice would be greatly appreciated, and I thank you for taking
the
> time to help.
>
> Regards,
>
> Pierre
>
> _______________________________________________
> 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
>

_______________________________________________
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