How to detect CO line in PBX

Sep 14, 2010 at 4:24 AM
Edited Sep 14, 2010 at 4:38 AM

Hi every one, I try to know number of Line ( PSTN) available on my BPX, or state of it ( My BPX calls it is CO1 CO2....).

I try to read PBX'documents, they guide that using

LONG lineDevSpecific(

  HLINE hLine,       

  DWORD dwAddressID

  HCALL hCall,       

  LPVOID lpParams,   

  DWORD dwSize       


With lpParam is LPVOID type, and value is "COL_INFO". But I really don't know what function in ATAPI can do that.

I try

tring s = "COL_INFO/001";
                    Char[] charray = s.ToCharArray();
                    byte[] dataspecify = new byte[charray.Length];
                    for (int i = 0; i < charray.Length; i++)
                        dataspecify[i] = (byte)charray[i];
                    Byte[] spec = ta[0].DeviceSpecific(dataspec);

But It thow me exception

lineDevSpecific failed [0x8000002B] Invalid line handle
At the lastest line

Any one please help me for advice or any experience !

Thank for reading and helping !