SDK & CAPI: Using Analog 4P card
The Diva Analog 4P is detected as a single controller with 4 bearer channels corresponding to the 4 ports, respectively.
Software developers can develop applications based on Diva Media Boards using either CAPI interface or the Diva SDK.Â
Some applications may need to address a specific port, and not the controller itself, when issuing a CONNECT_REQ.
Developing using the CAPI interface, the selection of the port (i.e. the channel) requires the definition of the Channel ID Information Element, as indicated in the piece of code below:Â
byte iepattpri[]={04,00,3,0xa9,0x83,0x85};
byte ie[20];
byte size;
Â
// 'chan' = channel number 1..n
Â
cx = (byte)chan & 0x7F;
ie[0] = size = sizeof(iepattpri);
CopyMemory(&ie[1],iepattpri,size);
ie[6] = 0x80 | cx; |
Â
When using the Diva SDK, the only addition to the code is the channel selection function below:
DivaCallPropertyValue *value = (DivaCallPropertyValue*) ie;
res = DivaSetCallProperties( divacall, DivaCPT_B_ChannelInfo, value, size+1); |
NOTE
the Information Element used for an Analog card is the same as that for a BRI ISDN adapter.