Conference Bridge implementation

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

 



Hi John,
           From primary inspection of the errors you are getting it looks
like the machine where you are trying to run the code probably doesn't have
an audio device. The default PJMEDIA conference bridge implementation
depends on the sound device thread for the clock timing. But if your code
doesn't need interaction with sound device then I would suggest you to use
your own master port for clock timing and use PJMEDIA_CONF_NO_DEVICE option
while creating the bridge. Take a look at the code in
http://trac.pjsip.org/repos/wiki/FAQ#Performance for your reference.

   [status = pjmedia_conf_create(pool, ..., PJMEDIA_CONF_NO_DEVICE, &cd->conf);
   cd->cport = pjmedia_conf_get_master_port(cd->conf);
   status = pjmedia_null_port_create(pool, ..., &cd->null);
   status = pjmedia_master_port_create(pool, cd->null, cd->cport, 0, &cd->m);
   status = pjmedia_master_port_start(cd->m);]


                  Also to increase the max simultaneous calls limit once
you call pjsua_config_default(cfg) you can set cfg->max_calls to whatever
value you need( value < PJSUA_MAX_CALLS).Hope this helps.

Regards,
Sandeep



On Wed, Oct 17, 2012 at 10:37 AM, john smith <pyroflares at gmail.com> wrote:

> HI,
>
> Thanks for the consultation varun appreciate it.
>
> But,my primary problem is concerned with adding port to conference bridge
> using pjmedia_conf_add api where i am getting segmentation fault......
>
> so,yesterday i tried a different way round for conference bridge and it
> worked using the following
>
> *
>
> pjsua_conf_connect(ci.conf_slot,pjsua_call_get_conf_port(call_ids[i]));
>         pjsua_conf_connect(
> pjsua_call_get_conf_port(call_ids[i]),ci.conf_slot);
> *
>
> i was able to confrence call and detach them....
> However when more than 4 users call the 5th user gets a busy tone 486 busy
> here.
> I wonder why,does anyone has any idea about this and how could we increase
> the number of users conferencing
>
> Also if conference can be achieved by the following method mentioned
> above.Then,what is the use of creating a conference bridge and adding ports
> to it to conference calls.
>
>
> Thanks in advance.
>
> John Smith.
>
> On Tue, Oct 16, 2012 at 10:43 PM, varun v <varun.v2021 at gmail.com> wrote:
>
>> hi john,
>>
>> Resampling is used in order to convert sampling rates from one value to
>> another.
>> from your code, i feel ur requirement is for 44.1Khz sampling rate which
>> the sound port is already performing.
>> hence include the resampling port create function only if necessary.
>>
>> On Tue, Oct 16, 2012 at 4:05 PM, john smith <pyroflares at gmail.com> wrote:
>>
>>> Hi......
>>>
>>>
>>>
>>> Does any one has the idea on the following requirement.Your guidance is
>>> highly appreciated...
>>>
>>>
>>> On Mon, Oct 15, 2012 at 2:21 PM, john smith <pyroflares at gmail.com>wrote:
>>>
>>>> Hi Folks,
>>>>
>>>> I am trying to create a conference enviorment for the following
>>>> requirement
>>>>
>>>> 1.)accepting calls from n no of b-party in such a manner that the voice
>>>> from b-party is heard to all the users in the conference and vice versa.
>>>> 2.)making calls from a-party to n-users  in such a manner that the
>>>> voice from a-party is heard to all the users in the conference and vice
>>>> versa.
>>>>
>>>> i have gone through confsample.c to get an idea.However i am successful
>>>> in registering my account to my sip server but when i try to do
>>>> pjsip_conf_add_port
>>>> in my code i get the following error....
>>>>
>>>>
>>>>  14:23:29.785  pjsua_media.c  Media index 0 selected for call 0
>>>>  14:23:29.785   pjsua_core.c  TX 481 bytes Response msg
>>>> 100/INVITE/cseq=1 (tdta0x212a5f0) to UDP 172.22.0.15:5060:
>>>> SIP/2.0 100 Trying
>>>> Via: SIP/2.0/UDP 172.22.0.15:5060
>>>> ;received=172.22.0.15;branch=z9hG4bKd9ea.2595dbb.1
>>>> Via: SIP/2.0/UDP 172.22.25.245:5086
>>>> ;rport=5086;branch=z9hG4bK462402ec-1215-e211-87fa-00137237e9b1
>>>> Record-Route: <sip:172.22.0.15;lr;did=32f.ff82e9b>
>>>> Call-ID: 20f600ec-1215-e211-87fa-00137237e9b1 at localhost.localdomain
>>>> From: "john.smith" <sip:ekigatest@172.22.0.15
>>>> >;tag=2efc00ec-1215-e211-87fa-00137237e9b1
>>>> To: <sip:2315 at 172.22.0.15>
>>>> CSeq: 1 INVITE
>>>> Content-Length:  0
>>>>
>>>>
>>>> --end msg--
>>>>  14:23:29.785            APP  Incoming call from "john.smith" <
>>>> sip:ekigatest at 172.22.0.15>!!
>>>>  14:23:29.785  strm0x212fd48  VAD temporarily disabled
>>>>  14:23:29.786  strm0x212fd48  Encoder stream started
>>>>  14:23:29.786  strm0x212fd48  Decoder stream started
>>>>  14:23:29.786  pjsua_media.c  Media updates, stream #0: speex (sendrecv)
>>>>  14:23:29.786          pjlib  select() I/O Queue created (0x21426e8)
>>>>  14:23:29.786  pjsua_media.c  Opening sound device PCM at 16000/1/20ms
>>>>
>>>> &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
>>>>  14:23:29.834    ec0x214eef0  AEC created, clock_rate=16000, channel=1,
>>>> samples per frame=320, tail length=200 ms, latency=100 ms
>>>>  14:23:29.835   conference.c  Port 1 (sip:ekigatest at 172.22.0.15)
>>>> transmitting to port 0 (Yamaha DS-1 (YMF724F): YMFPCI (hw:0,0))
>>>>  14:23:29.835   conference.c  Port 0 (Yamaha DS-1 (YMF724F): YMFPCI
>>>> (hw:0,0)) transmitting to port 1 (sip:ekigatest at 172.22.0.15)
>>>>  14:23:29.872 os_core_unix.c  Info: possibly re-registering existing
>>>> thread
>>>>  14:23:30.491  strm0x212fd48  VAD re-enabled
>>>> Expression 'ret' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1026
>>>> Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir,
>>>> &self->pcm )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1183
>>>> Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi,
>>>> inParams, StreamDirection_In, NULL != callback )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1410
>>>> Expression 'PaAlsaStream_Initialize( stream, alsaHostApi,
>>>> inputParameters, outputParameters, sampleRate, framesPerBuffer, callback,
>>>> streamFlags, userData )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1991
>>>> Expression 'ret' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1026
>>>> Expression 'AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir,
>>>> &self->pcm )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1183
>>>> Expression 'PaAlsaStreamComponent_Initialize( &self->capture, alsaApi,
>>>> inParams, StreamDirection_In, NULL != callback )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1410
>>>> Expression 'PaAlsaStream_Initialize( stream, alsaHostApi,
>>>> inputParameters, outputParameters, sampleRate, framesPerBuffer, callback,
>>>> streamFlags, userData )' failed in
>>>> 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1991
>>>>  14:23:32.248            *APP  Unable to create conference bridge:
>>>> Device unavailable [code=469984]*
>>>> Segmentation fault
>>>>
>>>> Heres my code...which is called from main.....Please guide me on this
>>>> .................................
>>>>
>>>>
>>>>
>>>> static void on_call_media_state(pjsua_call_id call_id)
>>>> {
>>>>          pj_caching_pool cp;
>>>>     pjmedia_endpt *med_endpt;
>>>>     pj_pool_t *pool;
>>>>     pjmedia_conf *conf;
>>>>  pj_status_t status;
>>>>
>>>> int port_count;
>>>>     pjsua_call_info ci;
>>>>
>>>>     pjsua_call_get_info(call_id, &ci);
>>>>
>>>>
>>>>   pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);
>>>>
>>>>     /*
>>>>      * Initialize media endpoint.
>>>>      * This will implicitly initialize PJMEDIA too.
>>>>      */
>>>>     status = pjmedia_endpt_create(&cp.factory, NULL, 1, &med_endpt);
>>>>     //PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
>>>>
>>>>     /* Create memory pool to allocate memory */
>>>>     pool = pj_pool_create( &cp.factory,     /* pool factory         */
>>>>                            "wav",           /* pool name.           */
>>>>                            4000,            /* init size            */
>>>>                            4000,            /* increment size       */
>>>>                            NULL             /* callback on error    */
>>>>                            );
>>>>
>>>>
>>>>     if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
>>>>         // When media is active, connect call to sound device.
>>>>         pjsua_conf_connect(ci.conf_slot, 0);
>>>>         pjsua_conf_connect(0, ci.conf_slot);
>>>>     }
>>>>
>>>>
>>>>     status = pjmedia_conf_create( pool,     /* pool to use          */
>>>>                                   1,/* number of ports     */
>>>>                                   44100,
>>>>                                   1,
>>>>                                   882,
>>>>                                   16,
>>>>                                   0,        /* options              */
>>>>                                   &conf     /* result               */
>>>>                                   );
>>>>     if (status != PJ_SUCCESS)
>>>>         app_perror(THIS_FILE, "Unable to create conference bridge",
>>>> status);
>>>> //       printf("app_perror(THIS_FILE, Unable to create conference
>>>> bridge\n");
>>>>
>>>>
>>>>
>>>>  status =
>>>> pjmedia_conf_add_port(conf,pool,(pjmedia_port*)ci.conf_slot,NULL,NULL);
>>>>         if (status != PJ_SUCCESS) {
>>>>             app_perror(THIS_FILE, "Unable to add conference port",
>>>> status);
>>>>             printf("Unable to add conference port add port to
>>>> bridge\n");
>>>>             //return 1;
>>>>         }
>>>>
>>>> }
>>>>
>>>>
>>>> Thanks & Regards
>>>> John Smith
>>>>
>>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>
>
> _______________________________________________
> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20121017/cb26d8de/attachment-0001.html>


[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