Execute custom code on beginning of call (inbound route for internal calls)


(Ed Andy) #1

Dear all,

i have a very simple freepbx setup and wan’t to execute a specific application if a specific number get called.

Setup:
1 Intercom (8001)
2 Mobile phones (8002 and 8003)
There no external trunks or anything else. This setup should only allow to call from the intercom to my phone if there all at home in the same network.

Question:
I wan’t to execute a specific application if i see a call from 8001 to 8002 (not 8003).

What i learned so far:

  • On “extension”-level i only can setup this if the call ends (either answered, busy, or not answered after given time). However i wan’t to execute the application right after the BEGINNING of the call, regardles if the destination will answer to the call.

  • According to my research i would be able to do that with inbound routes. However inbound routes doesn’t apply to call which are “internal -> internal”.

Have you any ideas how i can solve that?


(Lorne Gaetz) #2

You do this with a dialplan hook: Hooking for fun and income