Discussion:
filling the DATA_B3_REQ
(too old to reply)
Marcin p.
2008-12-09 14:05:06 UTC
Permalink
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
Lothar Kimmeringer
2008-12-09 15:07:28 UTC
Permalink
Post by Marcin p.
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: ***@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
Marcin p.
2008-12-09 15:25:08 UTC
Permalink
Post by Lothar Kimmeringer
Post by Marcin p.
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
News
2008-12-09 17:52:41 UTC
Permalink
Marcin,

from
Post by Marcin p.
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
Marcin p.
2008-12-09 18:23:46 UTC
Permalink
Post by News
I *guess* your not using the Window mechanism at all.
What does "Widndow mechanism" mean?
Post by News
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.
Post by News
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
News
2008-12-10 08:35:48 UTC
Permalink
Marcin,
Post by Marcin p.
Post by News
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.
Post by Marcin p.
Post by News
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.
Post by Marcin p.
Post by News
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
News
2008-12-10 11:00:42 UTC
Permalink
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
Post by News
Marcin,
Post by Marcin p.
Post by News
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.
Post by Marcin p.
Post by News
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.
Post by Marcin p.
Post by News
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
Marcin p.
2008-12-10 11:08:30 UTC
Permalink
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

Continue reading on narkive:
Loading...