pjsua_recorder_create

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

 



Hi all,

I am using the last version of the pjsip library.
I succeeded in accepting calls, playing files ......
The thing that doesn't work for me is the recording :

When I do a recording, I get an empty Wav file (44 bytes), just headers.
An advice would be very appreciated.

Regards,

Frederic


//-------------------------------------------------------------
void TSvi::HandleStartRecordMsg(TApplication *App)
//-------------------------------------------------------------
{
        int                     CallId, RecorderId;
        char                    FileName[256];
        TCall                   *Call;
        pj_str_t                wav_files[32];
        pjmedia_port            *media_port;


        CallId = atoi(App->GetItemList()->GetItemValue("CallId"));
        strcpy(FileName, App->GetItemList()->GetItemValue("FileName"));
        wav_files[0]=pj_str(FileName);

        pjsua_recorder_create   (wav_files, 0, NULL, 0, 0,  &RecorderId);
        pjsua_recorder_get_port(RecorderId, &media_port);
        pjsua_conf_connect( pjsua_recorder_get_conf_port(RecorderId), 
pjsua_call_get_conf_port(CallId) );

        _Logger->Log(LOG_INFO, "START_RECORD %s on channel %d 
recorderid=%d\n", FileName, CallId, RecorderId);

        Call = this->CallList->GetById(CallId);
        if (!Call)      {
                _Logger->Log(LOG_ERROR, "HandleStartRecordMsg : unable 
to get call [%d]\n", CallId);
                return;
        }
        Call->SetState(CALL_STA_RECORDING);
        Call->SetRecorderId(RecorderId);
        Call->SetMaxTime(atoi(App->GetItemList()->GetItemValue("MaxTime")));
        Call->SetRecordingStartTime(time(NULL));

        
Call->SetTerminationDigits(App->GetItemList()->GetItemValue("TerminationDigits"));
        Call->ClearDtmfs();

}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fclement.vcf
Type: text/x-vcard
Size: 389 bytes
Desc: not available
Url : http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080829/fd1f83f3/attachment.vcf 


[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