本文介绍了当pjmedia_conf_connect_port在pjsip中执行SIGABRT时,录制呼叫时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用pjsip 2.7.1时,它工作得很好.通话录音非常完美.但是现在我已经安装了pjsip 2.9.它在pjmedia_conf_connect_port上崩溃.由于pjsua_var.mconf而导致SIGABRT.我不知道何时在pjsip中分配它.请解释并帮助解决此问题.

Earlier when I was using pjsip 2.7.1 It was working fine. The call recording was perfect. but now I have installed pjsip 2.9. It is crashing on pjmedia_conf_connect_port. SIGABRT because of pjsua_var.mconf. I don't have any idea when it allocated in pjsip. Please explain and help to solve this issue.

预先感谢

在录制中使用媒体会议之前,我曾尝试创建一个媒体会议.但最终没有声音.

I tried to create a media conference before it was using in the recording. but it ended up with no audio.

+(void)startRecordingForCalleeId:(NSString *)calleeId andCallId:(int)callid
{


    NSLog(@"start recording...........");
    Recording *sipRecording = [[SPCoreDataManager sharedManager]createBlankSipRecordingForCalleeId:calleeId];
    NSString *filePath = [[SPFileManager sharedManager] pathForFile:sipRecording.fileName];


    SPAppDelegate *appDelegate = (SPAppDelegate *)[[UIApplication sharedApplication] delegate];
    appDelegate.objectID = sipRecording.objectID;
    pj_str_t fileName = pj_str([filePath UTF8String]);
    status = pjsua_recorder_create(&fileName, 0, NULL, -1, 0, &recorder_id);
    NSLog(@"status issss-->%d",status);



    [[NSUserDefaults standardUserDefaults] setInteger:recorder_id forKey:@"recording_id"];
    [[NSUserDefaults standardUserDefaults] synchronize];

    NSLog(@"recordder id id--->%d",recorder_id);
    NSLog(@"recording is for start recording is--->%d",app_config.rec_id);

    //status = pjsua_recorder_create(&fileName, 0, NULL, -1, 0, &app_config.rec_id);

    if (status != PJ_SUCCESS)
    {
        pjsua_perror(__FILE__, "error dll_startAudioCapture from pjsua_recorder_create", status);
    }
    else
    {
        //app_config.rec_port = pjsua_recorder_get_conf_port(app_config.rec_id);
        app_config.rec_port = pjsua_recorder_get_conf_port(recorder_id);

        PJ_LOG(5, (__FILE__, "dll_startAudioCapture recId=%d confPort=%d", app_config.rec_id, app_config.rec_port));

        pjmedia_conf_connect_port(pjsua_var.mconf, callid,app_config.rec_port, 0);//working for the 1st call
        pjsua_call_get_info(callid, &call_info); //callid


        pjsua_state state = pjsua_get_state();
        if (state == PJSUA_STATE_NULL){
            return;
        }
        pjmedia_conf_connect_port(pjsua_var.mconf, call_info.conf_slot,app_config.rec_port, 0); //working for the 1st call
        pjsua_conf_connect(call_info.conf_slot, app_config.rec_port);
        pjsua_conf_connect(0, app_config.rec_port);


        if (status != PJ_SUCCESS)
        {
            pjsua_perror(__FILE__, "error dll_startAudioCapture edia_conf_connect_port snd->recport", status);
        }

        if (status != PJ_SUCCESS)
        {
            //pjsua_perror(THIS_FILE, @"error dll_startAudioCapture pjmedia_conf_connect_port caller->recport", status);
        }
        //boost callTaker's and caller audio levels as configured
        if ((status = pjmedia_conf_adjust_rx_level(pjsua_var.mconf, pjsua_var.recorder[app_config.rec_id].slot,0)) == PJ_SUCCESS)
        {
            //                PJ_LOG(5, (THIS_FILE, "dll_startAudioCapture pjmedia_conf_adjust_rx_level by %d", g_audCapClientBoost));
        }
        else
        {
            pjsua_perror(__FILE__, "Error dll_startAudioCapture pjmedia_conf_adjust_rx_level", status);
        }
        if ((status = pjmedia_conf_adjust_tx_level(pjsua_var.mconf,pjsua_var.recorder[app_config.rec_id].slot,0)) == PJ_SUCCESS)
        {
            //                PJ_LOG(5, (THIS_FILE, "dll_startAudioCapture pjmedia_conf_adjust_tx_level by %d", g_audCapServerBoost));
        }
        else
        {
            pjsua_perror(__FILE__, "Error dll_startAudioCapture pjmedia_conf_adjust_tx_level", status);
        }
        hasRecordingStarted = 1;
    }

}

请帮助

推荐答案

if (ci.media_status == PJSUA_CALL_MEDIA_ACTIVE) {
                userCall.hasConnected = true
                pjsua_conf_connect(ci.conf_slot, 0)
                pjsua_conf_connect(0, ci.conf_slot)
                if recorderPortId != PJSUA_INVALID_ID.rawValue {
                    pjsua_conf_connect(ci.conf_slot, recorderPortId)
                }
            }

在连接声音端口之后,我们应该连接conf端口.即使在创建记录器后连接端口,也请在此处连接.您会录制清晰的声音.

We should be connecting the conf port after it connects the sound port. Even if you connect port after creating a recorder connect it here. You will have a clear voice recorded.

这篇关于当pjmedia_conf_connect_port在pjsip中执行SIGABRT时,录制呼叫时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-03 17:23