If you are originating from PSTN port to IP, then you can set the CID to 1 (Trunk Id) and then set the trunkid to the number you want to set as the caller id. If you want to receive the caller id from the incoming PSTN call and send that over IP, then leave cid set to 0 (from interface) and make sure that relay cid is set to Yes (1), however, the A800 may not recognize the caller id that is sent by your local phone company.
If you are originating from the PBX ports to IP, then the first public hunt ldn set will be used as the caller id.