[pjsip] Calls being mixed :S
Nanang Izzuddin
nanang at pjsip.org
Tue Nov 11 07:34:51 EST 2008
Hi,
It seems to be about connecting conference bridge ports. Perhaps
providing a 'debug' function like conf_list() in the pjsua_app.c can
help locating the problem.
Regards,
nanang
On Tue, Nov 11, 2008 at 6:14 PM, João César <jpcesar at gmail.com> wrote:
> Hello mighty ones,
>
> We are using memory ports to feed audio samples to our calls. He have
> now started to test multiple calls and for our surprise calls are
> being mixed together by the conference.
>
> As an example, I've just made 2 calls and debugged the result.
>
> Call 0 is on conference slot 2 and media port 1.
> Call 1 is on conference slot 4 and media port 3.
>
> This is how we are making a call:
>
> --------------------------------------
>
> // create a media port to generate samples.
> status = create_memory_port( pool, sampleRate, frameSize,
> numberFrames, channelCount,
> &callData[sessionId].memory_port_phone_out);
> WriteToLog("Created Memory Port",sessionId);
>
> // add port to conference
> status = pjsua_conf_add_port(pool,
> callData[sessionId].memory_port_phone_out,
> &callData[sessionId].port_id);
> if (status != PJ_SUCCESS) error_exit("Error adding memory port", status);
> WriteToLog("Added Memory Port to conference
> port",callData[sessionId].port_id);
>
> // make call
> WriteToLog("Making Call",sessionId);
> status = pjsua_call_make_call(acc_id,uri, 0,
> &callData[sessionId].port_id, NULL,NULL);
> if (status != PJ_SUCCESS) error_exit("Error making call", status);
>
>
> // assign the callid to the current call in callData
> callData[sessionId].call_id = callId;
> callData[sessionId].isUsed = TRUE;
> WriteToLog("Call Established",sessionId);
>
> // increment callId for next call
> callId++;
>
> --------------------------------------
>
> This is how we put an audio frame into a specific call:
>
> memory_put_frame(callData[sessionId].memory_port_phone_out, &pjframe );
>
> --------------------------------------
>
> This is how we handle the on_call_media_state:
>
>
> pjsua_call_info ci;
> pjsua_conf_port_id *portId;
>
> pjsua_call_get_info(call_id,&ci);
> portId = pjsua_call_get_user_data(call_id);
>
> #ifdef DEBUG
> printf("on call media state");
> #endif
>
> if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE)
> {
> WriteToLog("Call media state ACTIVE",call_id);
> WriteToLog("---> slot",ci.conf_slot);
> WriteToLog("---> port",*portId);
> pjsua_conf_connect(ci.conf_slot, 0);
> pjsua_conf_connect(*portId, ci.conf_slot);
> }
> else
> {
> WriteToLog("Call media state NOT ACTIVE",call_id);
> }
> -----
>
> Are we doing something here that is leading to mixing on different calls ?
>
> Thanks a lot for any feedback
>
>
> --
> Joao Cesar
> msn: jpcesar at gmail.com
> gtalk: jpcesar at gmail.com
> icq: 13790802
>
> _______________________________________________
> 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