Pass DID from one asterisk to another

KUMARULLAL

Guru
Joined
Feb 20, 2008
Messages
243
Reaction score
28
I have a PRI with 500 DID attached to my asterisk box A
Asterisk Box A: Running asterks@home 2.7. NO FREEPBX
Asterisk Ver 1.2

I have PBXIAF on Asterisk Box B
Asterisk A and B are connected using IAX2 trunk.

I want to assign 15 DID on Asterisk Box A such that it will pass directly on to Asterisk Box B.

In other words, I want the DID's set on Box A to be passed on to Box B, so that on Box B I can assign inboubd routes using the DID's of Box A.
How can I achieve this.
Thanks in advance.
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
You will probably want a second IAX trunk for this. On Box B, set the context of that trunk to "from-trunk".

Then you will need to hand code a context on Box A that looks something like this.

Code:
[custom-did-passthru]
exten => _X.,1,goto(outbound-allroutes,BOXB${EXTEN},1)
Now set up a Custom Destination in FreePBX that points to custom-did-passthru,_X.,1

Then create an outbound route on BoxA that points to the trunk to BoxB and has a dial pattern of:

BOXB|1706632334X

Freepbx will complain about the BOXB in the dial patterns but it will take it. The 1706632334X needs to match the patterns that you want to forward. Make sure you change this or it will only forward calls to my number :)

On box A, create an inbound route for each DID and point it to the custom destination you created in FreePBX.

I have not tested this, but it should work. Your mileage may vary.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Hi

There is another method you can use.

In box B (the one you want to direct 15 DID to), create an IAX trunk called anon, make the user context = guest, and put the user details as:-

type=user
context=from-trunk

Then in Box A, create a custom extension, and in the dialstring put IAX2/IP-of-other-Box/123456789 where 123456789 is the DID, repeat for all 15 DID.

Then in inbound routes, direct your DID to the corresponding extensions.

You could replace the IAX2/IP-of-other-Box/123456789 with SIP/123456789@IP-of-other-Box, and set allow annoymous sip calls = yes

Joe
 

Linetux

Guru
Joined
Oct 5, 2008
Messages
541
Reaction score
1
While these other solutions will work, they seem a little clumsy.... too many options to set.

I'm doing this exact same setup (except all of my boxes are PIAF - why the heck are you using Asterisk@Home for a PRI?). This is how I do it...

Box A (with PRI) has a custom destination as outlined above, just a little different.

custom-did-to-ServerB,${EXTEN},1

Now that I have that created, I can reference it with an inbound route on BoxA. Since I have a lot of DID's, I have to 'send' them to different places.

For example, I have one :

_12345678[1-6]X

with a destination of the custom dest I already made.

This takes DID's 123-456-7810 -> 123-456-7869 and pushes them to this other box.

Then I have to go edit extensions_custom.conf and tell it how to route the calls thru the custom destination I made:

[custom-did-to-ServerB]
exten => _X.,1,Dial(IAX2/192.168.1.2/${EXTEN},30,r)

(I already have an IAX trunk between the two)

Then the DID's get pushed to ServerB, where I can create inbound routes as if I'd gotten the call directly from the telco.
 

KUMARULLAL

Guru
Joined
Feb 20, 2008
Messages
243
Reaction score
28
No application 'rxfax' for extension error

There is one more issue that needs a solution.
In Box B, I want to create the inbound route to receive faxes and send it to the assigned email address for that DID.
I am using Nvfax.
This is what I have done. I created a custom context in extensions_custom.conf call "custom_fax"
[custom_fax]
include => ext-fax

Then I created a custom destination called Faxes with the following entry
custom_fax,in_fax,1

In my inbound route for that DID, for Fax extension I selected "System"
Email I added the appropriate email address
In Fax Detection type, I selected NVfax
And finally in Set destination, I selected the custom destination "Faxes"

Now when I send a fax on to this DID it tries to accept the fax, but stop because it cannot find Rxfax application.
This is the log,
Code:
pbx.c: No application 'rxfax' for extension (macro-faxreceive, s, 3)
I wanted to install rxfax app, but could not find a way to do so.
When I run from asterisk cli module show like "fax"
All I get is
Code:
 module show like "fax"
Module                         Description                              Use Count
app_nv_faxdetect.so            Newman's fax detection application       0
1 modules loaded
Please let me know what needs to be done.
 

KUMARULLAL

Guru
Joined
Feb 20, 2008
Messages
243
Reaction score
28
FInally Solved!!!

I finally solved the problem. I had to reinstall Nvfax from the script [FONT=&quot]http://pbxinaflash.net/source/fax/fax.pbx
It had rxfax and txfax included in it.
That solved the problem.
Thanks again.
[/FONT]
 

Members online

No members online now.

Forum statistics

Threads
25,838
Messages
167,931
Members
19,264
Latest member
lm2lm2
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top