Logging calls to sugarcrm

Hi all
I have made a small pogram that look up the caller in sugarcrm and logs the call to the calls table in sugarcrm.
This so that all incomming calls are logged to the correct contact/account.
When the call comes in I do not know who will pick it up and I do not know the duration of the call.
I need to update the the call record after the call has ended.

How can I do this ?

regards
Terchris

grab what you want from the asteriskcdrdb database

Hi. Thanks for answering.

Then the next question is how do I start a agi script when the call is hung up.
I can then look up in the asteriskcdrdb database and figure out who answered the call and the duration.

terchris