Hi, After some research it looks like mod_sofia sends outgoing INVITE also from on_init hook and endpoint's hooks always happen before other modules hooks (core's behavior). I see one way to take control over channel before it sends INVITE is to change states in mod_sofia. Could someone point me to more elegant solution, that doesn't require changing mod_sofia? I read on wiki that it's possible to add custom states, can it help somehow? BR, Alex. From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Alex Massover Sent: Thursday, February 21, 2013 12:15 PM To: freeswitch-dev@lists.freeswitch.org Subject: [Freeswitch-dev] on_init hook and outgoing channels Hello, We have services that manage calls via ESL and want to write a custom authorization and billing module. The idea is to catch any call received by FreeSwitch before service gets control on ESL for incoming call and on_init hook works for us. But for outgoing channels (created by 'route' or 'originate' commands over ESL) on_init hook doesn't work. Well the channel hits the hook but already after outgoing INVITE being sent, although channel state goes from CS_NEW->CS_INIT->CS_ROUTING correctly. And I want to authorize the channel before it goes out. Is that a normal behavior or I completely miss something? Is there other way to block an outgoing channel after it's created but before it goes out from a custom module? -- Best Regards, Alex Massover