Route incoming calls based on both Zap Channel & CID

iverona
Posts: 129
Member Since:
2006-10-23

Hi!

I've a TB PBX with an IP line, which gives me an incoming number (DID) and a TDM400 with one FXO connectedt o my PSTN line. What I want to do is to route incoming calls based on which line they come from. For example:

If number A calls to the IP line, I want te call to ring in some extension, BUT
if number A calls to the PSTN line, I want the call to ring in OTHER extension.

I thought this would be simple, but I'm not beeing able to achieve it. My TDM400 seems not to be receiving DID number, and I can only route based on the CID, so I can not have the same A number routed to two different locations.

I hope you get the idea... thank you very much.



iverona
Posts: 129
Member Since:
2006-10-23
Re: Route incoming calls based on both Zap Channel & CID

Ok. I've just read that DID does not work with analog lines. So, how can I do what I said before?

Thanks again.



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Route incoming calls based on both Zap Channel & CID

not real clear here

but yes you can break up the zap channels and have them go to whereever you wish

the file zaptel_auto.conf will need to be edited as well as zapata.conf

replace from-pstn to from-zaptel and reload asterisk

now create an inbound route for each channel point them where you wish..



iverona
Posts: 129
Member Since:
2006-10-23
Re: Route incoming calls based on both Zap Channel & CID

May be I didn't explain my self. I've two incoming DIDs (one from my VOip provider, and the other one, coming through the Zap1 channel of a TDM400.

What I what is: If call from A is received through the VoIP DID, make it ring in extension B. And, if call from A is received throug the Zap channel, make it ring in extension C.

Better now?

I'll try to find a little about contexts. Thanks bubbapcguy.



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Route incoming calls based on both Zap Channel & CID

Maybe I am reading this wrong, but it reads like you this is what you want..

Like this
I have a box with four FXO ports
I have four Phones lines
555-1212 To channel 1
555-1213 To channel 2
555-1214 To channel 3
555-1215 To channel 4

I have a VOIP provider with two DID's so I create to inbounds for the DID
555-1216
555-1217

I can set a different Inbound route for each "zaptel channel" as well as each DID
So all calls to channel 1 go to Whatever exten / IRV I want them to.
Same with all other channels / DID

Is this not it???



iverona
Posts: 129
Member Since:
2006-10-23
Re: Route incoming calls based on both Zap Channel & CID

Yes, that's it... more or less!

I think that I do not write very well in English, may be I was not explaining correctly ;)

What is confusing me is the FreePbx interface, where I've DID and CID in one "group" and Zaptel channel in other group, with an "OR" between the two groups. So, for example, could I do the following?

Call from Zap Channel 1, CID = 12345 -> Route to extension A
Call from Zap Channel 1, CID = 67890 -> Route to extension B
Call from VoIP DID, CID = 12345 -> Route to extension C
Call from VoIP DID, CID = 67890 -> Route to extension D

probably I'm not going to use this "dial plan" but I'm asking if this is possible, because I may need it somewhen.

Thank you very much for your help bubbapcguy.



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Route incoming calls based on both Zap Channel & CID

If the CID is passed to you and you have made the changes to the zapata / zaptel_auto files , you will need to redo those if you update zaptel or run genzaptelconf.

It will work.



bubbapcguy
Posts: 3774
Member Since:
2006-06-02
Re: Route incoming calls based on both Zap Channel & CID

Without CID set.....

-- Executing Macro("Zap/3-1", "from-zaptel-3|s|1") in new stack
-- Executing NoOp("Zap/3-1", "Entering macro-from-zaptel-3 with DID = s") in new stack
-- Executing Set("Zap/3-1", "FROM_DID=s") in new stack
-- Executing Goto("Zap/3-1", "app-blackhole|musiconhold|1") in new stack
-- Goto (app-blackhole,musiconhold,1)
== Channel 'Zap/3-1' jumping out of macro 'from-zaptel-3'
-- Executing NoOp("Zap/3-1", "Blackhole Dest: Put caller on hold forever") in new stack
-- Executing Answer("Zap/3-1", "") in new stack
-- Executing MusicOnHold("Zap/3-1", "") in new stack
-- Started music on hold, class 'default', on Zap/3-1
-- Stopped music on hold on Zap/3-1
== Spawn extension (app-blackhole, musiconhold, 3) exited non-zero on 'Zap/3-1'
-- Hungup 'Zap/3-1'

Same trunk with a CID (numer is 206279 is a FWD number) setup

-- Executing NoOp("Zap/3-1", "Is a Zaptel Channel") in new stack
-- Executing Set("Zap/3-1", "CHAN=3-1") in new stack
-- Executing Set("Zap/3-1", "CHAN=3") in new stack
-- Executing Macro("Zap/3-1", "from-zaptel-3|s|1") in new stack
-- Executing Set("Zap/3-1", "FROM_DID=s/206279") in new stack
-- Executing Goto("Zap/3-1", "ext-local|*1100|1") in new stack
-- Goto (ext-local,*1100,1)
== Channel 'Zap/3-1' jumping out of macro 'from-zaptel-3'
-- Executing Macro("Zap/3-1", "vm|1100|DIRECTDIAL") in new stack

same zaptel channel only the first call was without me setting up a CID to watch for..



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.