thanks for reply to my post!
to be more precise:
when a call ends i want to write a row in a database.
before it was done by the native asterisk MYSQL extension (add-on), but it seems to me that it leaves a lot of open connections and it did not works very fine.
so i write some perl scripts.
now i understand (reading asterisk log) that when the person who hangs up the call is the calleR, you will need to call DEADAGI.
if it is the calleD you will need to call AGI (the channel is still active).
now how can i distingue between these two situations?
thanks a lot.