[asterisk-dev] hook outgoing call with asterisk

Stefan Schmidt sst at sil.at
Thu Dec 16 19:25:50 UTC 2010


Am 15.12.2010 21:28, schrieb Juan Ramírez:
> Hi,
> 
> I'm writing an asterisk module and I was wondering if I can hook an outgoing
> call made by a SIP or IAX peer without getting into the dialplan
> 
> The use case is below:
> 
> 1- User makes a call through a SIP phone 94444444
> 2- My module gets the call and makes a request to a database checking if the
> prefix '9' is allowed
> 3- If it's allowed then continue, else reject the call
> 
> I don't know (yet) how to get into the step two.
> 
> 
> Thanks!
> 
> 
> 
> Saludos!
>      Juan
Hello juan,

i dont know if its really possible to not use the dialplan. IMHO no,
cause every call which arrives at asterisk starts the pbx engine which
search for a matching extension.

but you can easy write your own application and then do everything you
want inside this app.

your extension will look like this then:
exten => _X!,1,YourApplication()

take a look at app_skel or app_skeleton (i am not sure) to see how to
write your own app.

best regards

Stefan Schmidt




More information about the asterisk-dev mailing list