Extensions.conf routing based on sender


we’re using Asterisk as SIP Gateway for our Lync deployment.

<—> <—>

We want to add another SIP Provider now and have some questions about Routing.

We have to route calls from Lync to one of the SIP Providers.

Ex. if 111111-1111-11 is calling from Lync, Asterisk should route it to SIP Provider 1

if 2222222-2222-22 is calling, it should route it to SIP Provider 2

Currently, we have the following set in the extensions.conf:


;Routes with 1 followed by three digits to local extensions
;send other calls to Sipcall for Asterisk

As i see, everything starting with + is sent to the Sipcallp provider.

Is there a way to route based on sender number instead of recipient number?

Google “asterisk ex-girlfriend logic” or use the CALLERID function.