You are right, That was the problem. Thank you so much. Regards, Frederic Benny Prijono a ?crit : > On Fri, Aug 29, 2008 at 11:54 AM, Fr??d??ric CLEMENT > <fclement at viatelecom.com <mailto:fclement at viatelecom.com>> wrote: > > 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. > > > I think you'd want to arrange the parameter order in > pjsua_conf_connect() the other way around! And don't forget to destroy > the recorder once recording is done, so that the WAV header is written > to the file. > > Cheers > Benny > > > > 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(); > > } > > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org <mailto: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/20080829/da12dfdb/attachment.html -------------- 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/da12dfdb/attachment.vcf