Forwarding by caller id

i have three softphones with three extensions,
if the the first one calls the second:
if the caller id is “aaaaa” recieve the call
if the caller id is “bbbbb” forward the call to the third soft phone
since i’m new user of freepbx, what should i do?

OK - this is kind of hard to do with Asterisk, mostly because what you’re asking is a little confusing.

When someone calls your PBX (local extension or outside call) the CID is the number they called from. So, if someone calls from extension 1, the caller ID is always going to be the same (“Phone 1”). Different from that is the DID (Direct In Dial) number, which is the number of the extension you are calling or the PSTN number of the phone system.

Summary: DID = the number of the person being called.
CID = the number that called the person being called.

Let me see if I understand what you are saying:

  • Someone calls your PBX from the outside using your phone number (123-123-1234). If the call is coming from your mother-in-law (Caller ID 123-321-3214), you want the call to be routed to Extension 2 (Your wife’s number). If the call comes from your mother (Caller ID 312-123-3214), the call should be routed to your extension.

With external numbers, you can specify that any number with a CID like 123-321-3214 (your MIL) should be routed to your wife’s extension. You do this by leaving the DID blank and specifying the CID in the CID field. Likewise, if your mother (312-123-3214) calls, you set the CID field to her number and point the route to your extension. You can select “CID Priority Route” on these if you want, but since they are “any DID”, the call should be routed correctly.

Now, from all local extensions, this is harder, since there is no CID-based routing available. Unless there’s a commercial package that can do it, you might need to write a custom-context.

[from-internal-custom]
exten=>1002,1,NoOp(“Example of process, not code”)
exten=>1002,2,if($CID=“3123213124”,5)
exten=>1002,3,Dial(extension 3)
exten=>1002,4,Return()
exten=>1002,5,Dial(extension 2)
exten=>1002,6,Return()

So, if someone in the local network dials 1002, they will get sent to extension 3 if their CID matches line ‘2’. If not, they will get sent to Extension 2 (line 5). Obviously, the code above will not work without corrections, but the structure is basically correct.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.