pjsua_recorder_create

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

 



On Fri, Aug 29, 2008 at 11:54 AM, Fr??d??ric CLEMENT <
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
> 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/d7450545/attachment.html 


[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