[HELP]: Strategy for redirecting inbound calls to 2nd * serv

Hi All

I’m after some advice for setting up redirection of inbound calls. I’ve got two Asterisk servers, and a number of DID’s through an upstream provider. I’m determining the called number from the SIP headers, and sending to the appropriate extensions using (essentially) the Dial() command.

What I’d like to do now is receive calls and on the first asterisk server, and redirect some of the DID’s to the second server, based on the callerID.

So what I have at the moment is (in extensions.conf) something like:

exten => _1415923107[78],1,NoOp(Main office line)
same => n,Dial(SIP/100,30)
same => n,Voicemail(reception@mainoffice,su)
same => n, Hangup.

What I would like to do is send the extension ending in 8 to the second server, ideally without the first server being in the media path. I could just use dial, i.e.:

exten => _14159231078,1,NoOp(Second office line)
same => n,Dial(SIP/server2/${EXTEN},30)
same => n,Voicemail(reception@mainoffice,su)
same => n, Hangup.

Which would send the call to the same extension number on the second server, but I tried using Transfer() instead:

exten => _14159231078,1,NoOp(Main office line)
same => n,Transfer(SIP/server2/${EXTEN})

But that doesn’t seem to be the sort of thing Transfer() is used for. Can anyone advise what’s the best strategy for simple call redirection/distribution like this?

Thanks in advance,

Mark

What you call local extensions are local devices.

Transfer requires a SIP URI that will be interpreted in the context of the upstream server. An ITSP is unlikely to honour it, or will charge it as a new outgoing call. The new URI must be routable through your firewall and NAT. There are probably still problems with the error handling on Transfer.

Note Transfer is implemented differently depending on whether or not the call has been answered. Normally it is best not to answer.

To avoid the media going through the first server, with DIal, you need to have directmedia enabled. An ITSP is unlikely to support that and it may be difficult to handle it across any NAT that you have.