filling the DATA_B3_REQ

  • Follow


Helo.

The new problem has just appear.
After established logical connection I try send the data from file (G.711 bits 
received during incomig call).

I made this function (in VS 2007):

SendDataB3Req(DWORD dwApplId,BYTE bPLCI, WORD wNCCI, WORD DataLength, WORD 
DataNumber, char DataBuffor[1024+1])

{

CAPI_MSG CAPIMsg;

DWORD capi_error;

CString MSG;

CAPIMsg.header.appl_id = (WORD)dwApplId;

CAPIMsg.header.command = _DATA_B3_R;

CAPIMsg.header.number = 0;

CAPIMsg.header.controller = 1;

CAPIMsg.header.plci = bPLCI;

CAPIMsg.header.ncci = wNCCI;

CAPIMsg.header.length = (WORD)(sizeof(CAPIMsg.header)+10);

CAPIMsg.info.data_b3_req.Data=(DWORD)&DataBuffor; //DWORD

CAPIMsg.info.data_b3_req.Data_Length =DataLength;//DataLength; //WORD

CAPIMsg.info.data_b3_req.Flags=0; //WORD

CAPIMsg.info.data_b3_req.Number=DataNumber; //WORD

capi_error = CAPI_PUT_MESSAGE( dwApplId, &CAPIMsg );

}

During logigal connection apllication takes:

char *FileName = "received.dat";

FILE *plik = NULL;

plik = fopen(FileName,"r");

memset(&DataBuffor,0,1025);

fread(DataBuffor,sizeof(char),1024,plik);

for (int i=0;i<40;i++)

{

SendDataB3Req(dwApplId,bPLCI,wNCCI,1024,i,DataBuffor);

WaitForConfirmation(dwApplId);

}

In telephon a hear only some cyclical noises. No voice.

It is correct in pointer to the data area?

Meaby is something wrong in size of data?



Martin

0
Reply Marcin 12/9/2008 2:05:06 PM

Marcin p. wrote:

> for (int i=0;i<40;i++)
> {
> SendDataB3Req(dwApplId,bPLCI,wNCCI,1024,i,DataBuffor);
> WaitForConfirmation(dwApplId);
> }
> 
> In telephon a hear only some cyclical noises. No voice.

You never read more than the first 1024 bytes. 1024 bytes
is about 1/8th second of audio, so cyclic noise would
be exactly what I expect to hear in that case.


Regards, Lothar
-- 
Lothar Kimmeringer                E-Mail: spamfang@kimmeringer.de
               PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                 questions!
0
Reply Lothar 12/9/2008 3:07:28 PM


Uzytkownik "Lothar Kimmeringer" <news200709@kimmeringer.de> napisal w wiadomosci 
news:1hropg5xjb6lj$.dlg@kimmeringer.de...
> Marcin p. wrote:
>
>> for (int i=0;i<40;i++)
>> {
>> SendDataB3Req(dwApplId,bPLCI,wNCCI,1024,i,DataBuffor);
>> WaitForConfirmation(dwApplId);
>> }
>>
>> In telephon a hear only some cyclical noises. No voice.
>
> You never read more than the first 1024 bytes. 1024 bytes
> is about 1/8th second of audio, so cyclic noise would
> be exactly what I expect to hear in that case.

Ok. I has changed this loop:

for (int i=0;i<40;i++)
{
fread(DataBuffor,sizeof(char),1024,plik);
SendDataB3Req(dwApplId,bPLCI,wNCCI,1024,i,DataBuffor);
WaitForConfirmation(dwApplId);
}

Still cyclic noise - 40 times...
During each loop application read 1024 times 8-bits words (summary - 1024 
bytes - 1/sek voice). After that, the DATA_B3_REQ is being filled.

I dont know what could be wrong...

Martin 

0
Reply Marcin 12/9/2008 3:25:08 PM

Marcin,

from
    > SendDataB3Req(dwApplId,bPLCI,wNCCI,1024,i,DataBuffor);
    >
    > WaitForConfirmation(dwApplId);
I *guess* your not using the Window mechanism at all.

As I today answered to your other posting, if you would provide a complete 
CAPI trace, we coudl mor help you and give hints and woudl less have to 
guess ;-)

Just a question: You do have the  CAPI 2.0 4th Edition documents, dont you?

Regards,
Jochen Klein
www.servonic.com



0
Reply News 12/9/2008 5:52:41 PM

> I *guess* your not using the Window mechanism at all.

What does "Widndow mechanism" mean?

> As I today answered to your other posting, if you would provide a complete 
> CAPI trace, we coudl mor help you and give hints and woudl less have to guess 
> ;-)

Ok. Sorry :-). I'll be better the nest time.

> Just a question: You do have the  CAPI 2.0 4th Edition documents, dont you?

Yes. CAPI 4th Edition June 2001 from www.capi.org 

0
Reply Marcin 12/9/2008 6:23:46 PM

Marcin,


>> I *guess* your not using the Window mechanism at all.
>
> What does "Widndow mechanism" mean?
The Message Buffuer / Message Queue windowing meachanism. As I can see from 
that litle excerpt from your code I *guess* you just "disabled" the queueing 
mechanism by sening our an message and waiting for the confirmation before 
sending the next; well at least I guess you do so, lokking at a trace it 
woudl be obvious within seconds.

>> As I today answered to your other posting, if you would provide a 
>> complete CAPI trace, we coudl mor help you and give hints and woudl less 
>> have to guess ;-)
> Ok. Sorry :-). I'll be better the nest time.
Well, why not THIS time, why bnot just prividing it now?!???

I think not only for me it isnt great fun spending time, trying to help if 
the one who asks does give only few informations.


>> Just a question: You do have the  CAPI 2.0 4th Edition documents, dont 
>> you?
> Yes. CAPI 4th Edition June 2001 from www.capi.org
Fine!  Thats the current one!

For my current guess whats going wrong, pls. read Part 2 e.g. Chapter 
8.18.1.1
"The number of simultaneously available data blocks has a decisive effect
on the data throughput in the system and should be between 2 and 7. At least 
two data
blocks must be specified."

Regards,
Jochen Klein
www.servonic.de





0
Reply News 12/10/2008 8:35:48 AM

Marcin,

also have a look at CAPI 2.0 Part 1, Anex A, A.2 Data Transfer.
The buffer windowing / queue mechanism is schwon there in a short flow 
sample.

Regards,
Jochen Klein
www.servonic.com



"News" <J.Klein@servonic.de> wrote in message 
news:6q9db5Fb5i2rU1@mid.individual.net...
> Marcin,
>
>
>>> I *guess* your not using the Window mechanism at all.
>>
>> What does "Widndow mechanism" mean?
> The Message Buffuer / Message Queue windowing meachanism. As I can see 
> from that litle excerpt from your code I *guess* you just "disabled" the 
> queueing mechanism by sening our an message and waiting for the 
> confirmation before sending the next; well at least I guess you do so, 
> lokking at a trace it woudl be obvious within seconds.
>
>>> As I today answered to your other posting, if you would provide a 
>>> complete CAPI trace, we coudl mor help you and give hints and woudl less 
>>> have to guess ;-)
>> Ok. Sorry :-). I'll be better the nest time.
> Well, why not THIS time, why bnot just prividing it now?!???
>
> I think not only for me it isnt great fun spending time, trying to help if 
> the one who asks does give only few informations.
>
>
>>> Just a question: You do have the  CAPI 2.0 4th Edition documents, dont 
>>> you?
>> Yes. CAPI 4th Edition June 2001 from www.capi.org
> Fine!  Thats the current one!
>
> For my current guess whats going wrong, pls. read Part 2 e.g. Chapter 
> 8.18.1.1
> "The number of simultaneously available data blocks has a decisive effect
> on the data throughput in the system and should be between 2 and 7. At 
> least two data
> blocks must be specified."
>
> Regards,
> Jochen Klein
> www.servonic.de
>
>
>
>
> 


0
Reply News 12/10/2008 11:00:42 AM

I found the problem.
In The "freadt function is bug. I used function dedicated to Visual Studio C++ 
for read & write data.

Thanks for help.
Marcin 

0
Reply Marcin 12/10/2008 11:08:30 AM

7 Replies
100 Views

(page loaded in 0.115 seconds)

Similiar Articles:




7/6/2012 11:29:40 PM


Reply: