pjmedia_splitcomb how add channels to bridge?

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

 



hello again

i'm add splitter, right and left channel do conference bridge but it not
working like i want. here is my conference bridge:

Conference ports:
Port #00[ 8KHz/20ms/2]   UCB1400:  (hw:0,0)  transmitting to: #1 
Port #01[ 8KHz/40ms/2]             splitter  transmitting to: #0
Port #02[ 8KHz/40ms/1]        right channel  transmitting to: 
Port #03[ 8KHz/40ms/1]         left channel  transmitting to: 
Port #04[ 8KHz/20ms/1] sip:4444 at 192.168.32.123  transmitting to: 

- when is connect right channel with call i hear sound but in both channels.
   microphone work.

Port #00[ 8KHz/20ms/2]   UCB1400:  (hw:0,0)  transmitting to: #1 
Port #01[ 8KHz/40ms/2]             splitter  transmitting to: #0
Port #02[ 8KHz/40ms/1]        right channel  transmitting to: #4
Port #03[ 8KHz/40ms/1]         left channel  transmitting to: 
Port #04[ 8KHz/20ms/1] sip:4444 at 192.168.32.123  transmitting to: #2


- when is connect left channel with call i hear nothing and microphone
  doesn't work too

Port #00[ 8KHz/20ms/2]   UCB1400:  (hw:0,0)  transmitting to: #1 
Port #01[ 8KHz/40ms/2]             splitter  transmitting to: #0
Port #02[ 8KHz/40ms/1]        right channel  transmitting to: 
Port #03[ 8KHz/40ms/1]         left channel  transmitting to: #4
Port #04[ 8KHz/20ms/1] sip:4444 at 192.168.32.123  transmitting to: #3


here is my code for adding spliter,right and left channel to conference 
bridge.

variable "d->sc" is declared like "pjmedia_port *sc".

my media config:

media_cfg.quality = 2;
media_cfg.thread_cnt = 1;
media_cfg.clock_rate = 8000;
media_cfg.snd_clock_rate = 8000;
media_cfg.ec_tail_len = 0; 
media_cfg.channel_count = 2;
media_cfg.no_vad = PJ_TRUE;

.....
  //here is call pjsua_init
    pjsua_init();

    pjsua_conf_port_info  masterPortInfo;

    //get info about master conference port
    status = pjsua_conf_get_port_info( 0, &masterPortInfo );
    if (status != PJ_SUCCESS) {
        error_exit("Error while reading master port info", status);
    }

    // Create stereo-mono splitter/combiner 
    status = pjmedia_splitcomb_create(d->pool,
                                      masterPortInfo.clock_rate,
                                      2,
                                      2 * masterPortInfo.samples_per_frame,
                                      masterPortInfo.bits_per_sample,
                                      0,
                                      &d->sc );
    if (status != PJ_SUCCESS) {
        error_exit("Error while creating splitcomb", status);
    }

    pjmedia_port *mediaPortLeftChannel,*mediaPortRightChannel;

    //create media port for left channel
    status =  pjmedia_splitcomb_create_rev_channel( d->pool,
                                                    d->sc,
                                                    0,
                                                    0,
                                                    &mediaPortLeftChannel);
    if (status != PJ_SUCCESS) {
        error_exit("Error while creating pjmedia_port for left channel", 
                         status);
    }

    //create media port for right channel
    status =  pjmedia_splitcomb_create_rev_channel( d->pool,
                                                    d->sc,
                                                    1,
                                                    0,
                                                    &mediaPortRightChannel);
    if (status != PJ_SUCCESS) {
        error_exit("Error while creating pjmedia_port for right channel",
                         status);
    }

   pjsua_conf_port_id splitterConfPort,
                               leftChannelConfPort,
                               rightChannelConfPort;
   

    //add to conference bridge splitter port
    const pj_str_t splitterName = {"splitter", 8};

    status = pjmedia_conf_add_port(pjsua_var.mconf,
                                   d->pool, 
                                   d->sc, 
                                   &splitterName, 
                                   (unsigned*) &splitterConfPort );

    if (status != PJ_SUCCESS) {
        error_exit("Error while adding spliter port to conf bridge", status);
    }
    

    
    //add to conference bridge right channel port
    const pj_str_t rightChannelName = {"right channel",13};

    status = pjmedia_conf_add_port(pjsua_var.mconf,
                                   d->pool,
                                   mediaPortRightChannel, 
                                   &rightChannelName,
                                   (unsigned*) &rightChannelConfPort );
    if (status != PJ_SUCCESS) {
        error_exit("Error while adding right channel port to conf bridge",
                        status);
    }

    //add to conference bridge left channel port
    const pj_str_t leftChannelName = {"left channel",12};

    status = pjmedia_conf_add_port(pjsua_var.mconf,
                                   d->pool,
                                   mediaPortLeftChannel, 
                                   &leftChannelName,
                                   (unsigned*) &leftChannelConfPort );
    if (status != PJ_SUCCESS) {
        error_exit("Error while adding left channel port to conf bridge",
         status);
    }

  //here is call pjsua_start()
  pjsua_start();
.....


do i something wrong?

thanks





[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