VoIP and Key/PBX systems

Has anyone had any luck configuring analog gateways (Audiocodes, Adit, Carrier Access, Cisco) using asterisk? We tried this a few years ago and always had problems such as call disconnecting or the line staying offhook after hanging up the phone.

Basically we programmed those devices to provide POTS lines to a phone sytem with no luck. We are able to use those devices without any problems to single line phones.