Redirect incoming call to oneself at another location

Hi, using asterisk 1.6.2.8. We have asterisk registered with say a sipgate account 101303 for instance. We are trying to configure asterisk upon receing an incoming call to 101303 to be able redirect back to another location which is registered also with 101303. However this second location would only be registered after the initial incoming call came into asterisk, we’d use a script to alert it over a network conection it needs to register.

We are experimenting with different approaches. One approach is in the dial plan upon receivng the incoming call we alert the remote user, then Dial(SIP/101303@sipgate.com) so it should call itself , then if the remote user is registered it should get the invite. However we are finding that when an invite goes out to 101303 from our asterisk box we get a 404 more often than not. We have also tried unregisterign our astrisk box with the 101303 account before dialin it again but then we get 403 forbidden.

Anyone know what is the best way to go about this?

Thanks

[101303]
exten => s,1,System(php alertRemoteuser.php)
exten => s,2,Ringing()
exten => s,3,WaitExten(20)
exten => s,4,Dial(SIP/xxxxxxxxxx@101303)
exten => s,6,HangUp()

We are using a dialplan like this

Sounds like your trying to use the free sipgate account at two locations. I wouldn’t expect this to work. As you noted when you don’t have the other box registered your not able to find it. If you unregister the first box to try and register the other one, then your forbidden on making a call.

I guess the question I have is why are you trying to accomplish it this way? Leave the sipgate account registered at the first location. Setup an IAX connection between the two locations. Then just using your dialplan at the first location route calls over to an extension at the second location.

in your dialplan code you have:

You should probably use Wait(20), rather than WaitExten(20).

Hi, thanks. We are a bit new to Asterisk and did not understand what you mean by setting up
an IAX connection, in what way is this differnet from a SIP connection?

Are you suggesting just set up a temporary extension for the second location and route to that?

Regards