[asterisk-dev] asterisk how to use zaptel

张留祺 zlqhope at hotmail.com
Mon Dec 22 19:30:17 CST 2008


Hi,all!
   Now,I want use zaptel to my own program,just like asterisk use zaptel! When a write a simple test,I found a problem!It's that: I use the TDM410p card and loop the span2 and span4,then I write the channel 32 and read the data from channel 94,the code like this: 
write.c
for(;;)
{
//         fd is the value of func open return it point channel 32;buffer is memset(buffer,'a',1023);buffer[1023]='\0';
           write(fd,buffer,1024);
}
 
read.c
for(;;)
{
//         fd is the value of func open return it point channel 94;readbuffer is filled with 0;
           read(fd,readbuffer,1024);
}
then , the function read return 1024,and i use printf("%s",readbuffer); I found when i send 1023 'a',i recieve 1023 'a',but in twice,the first package with lots of 0xff and some 'a',the second package filled parts of 'a'.
 How can i once recieve the 1023 'a'? Can any one help me ?
_________________________________________________________________
 不只是收发邮件— 查看 Windows Live™ 的更多精彩功能。
http://www.microsoft.com/windows/windowslive/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20081223/dcc428b6/attachment.htm 


More information about the asterisk-dev mailing list