Call a Function (any)

i would like to Call a Function every-time a extension:

  • Originate a Call
  • Hangup phone
  • Receive a Call

any idea where i should locate the function call?

like:
exten => s,n,MyFunction(‘Close’)

Each of these events happen differently

You have 2 options:

  1. AMI, subscribe to events
  2. Create a proper module and splice the dialplan
    • Add hangup handler
    • Splice Macro Dial One
    • Splice Macro Dial Out

Thank for reply
Definitely i will avoid subscribe to events.

what about modifying hangup.agi. What do you think?