Dear All, I have the following setup; SER/External Asterisk <--> Firwall <--> Internal Asterisk <-VPN-> Users At the moment; Anybody can register with our SER proxy and call each other using VoIP. Anybody can call one of our internal users via our SER/Asterisk gateway. The INVITE is sent to our external Asterisk Server, this act as a UA and uses IAX2 to send the call to our internal Asterisk server. Our internal users use a VPN to connect to our corporate HQ. They register with our Internal Asterisk server and can make internal and PSTN calls. What I would like to do is to redirect external SIP calls to our external Asterisk server. e.g if I call sip:shad@voipdomain.org I would like the call to be routed from our Internal Asterisk server to our External Asterisk server via IAX2 and for the external asterisk server to act as a UA and make the call. I have tried the following syntax on our internal server; exten => _sip.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) However this does not seem to work? How do I change my dial plan so that SIP calls are routed from my internal Asterisk box to my external Asterisk box over IAX2? Warm Regards and Thanks Shad Mortazavi --------------- Nexus Management Inc
Shad Mortazavi wrote:> What I would like to do is to redirect external SIP calls to our > external Asterisk server. e.g if I call sip:shad@voipdomain.org I would > like the call to be routed from our Internal Asterisk server to our > External Asterisk server via IAX2 and for the external asterisk server > to act as a UA and make the call. > > I have tried the following syntax on our internal server; > > exten => _sip.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) > > However this does not seem to work?Have you tried this? exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN})
I believe that they covered this exact procedures at www.voip-info.org. Look for the topic on connecting two Asterisk servers. They outline three different ways that you can do so.>From: "Eric \"ManxPower\" Wieling" <eric@fnords.org> >Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion ><asterisk-users@lists.digium.com> >To: Asterisk Users Mailing List - Non-Commercial Discussion ><asterisk-users@lists.digium.com> >Subject: Re: [Asterisk-Users] Routing SIP calls via URI >Date: Wed, 29 Mar 2006 13:18:07 -0600 > >Shad Mortazavi wrote: > >>What I would like to do is to redirect external SIP calls to our >>external Asterisk server. e.g if I call sip:shad@voipdomain.org I would >>like the call to be routed from our Internal Asterisk server to our >>External Asterisk server via IAX2 and for the external asterisk server >>to act as a UA and make the call. >> >>I have tried the following syntax on our internal server; >> >>exten => _sip.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) >> >>However this does not seem to work? > >Have you tried this? > >exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) >_______________________________________________ >--Bandwidth and Colocation provided by Easynews.com -- > >Asterisk-Users mailing list >To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Dear Group; I can confirm that I have read through the three examples in www.voip-info.org. These examples are excellent and address a couple of the questions. I have IAX2 working between several asterisk servers on our VPN and between the DMZ and our LAN. Also exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) This answers part of the question; However what I want to do is to send any outbound sip calls via our external SIP server. i.e; VPN LAN IAX2 DMZ Internet Internal UA <-------> Internal (*) <------> External (*)<------> ExternalUA We have an extensive internal dial plan, X dial the UK, Y dial USA, 1XXX for Voicemail, 2xxx for Meetme, etc. Do I need to setup a prefix to dial the internet? And then route all calls to the External(*) based on this prefix? Thanks Shad Mortazavi ------------------------------ Nexus Group Technical Manager n|m Nexus Management Inc
Dear Group; I am closer to where I want to be. I could still do with some help. For my Internal(*)I setup the following; extensions.conf --------------- [SIPOUT] exten => _6.,1,Dial(SIP/${EXTEN:1}@192.y.x.1x0) If I dial sip:6shad@blablabla.com I see the call go to the External(*) In my external server I have; Sip.conf --------- [sip_proxy-out] type=peer ; we only want to call out, not be called secret=**** username=nexus*** ; Authentication user for outbound proxies fromuser=nexus*** ; Many SIP providers require this! fromdomain=****.***.com host=******** usereqphone=yes and in the extensions.conf I have; exten =>_6.,1,Dial(SIP/${EXTEN:1}@sip_proxy-out) This all works! The problem is it only works if I dial a user that exists on the SER Server. eg sip:6shad@****.***.com . It breaks if I call 555555555@voiptalk.org. When I look at the INVITE packets the URI is being transformed when it goes from the Internal(*) to the external (*) over IAX2. Rather than being 555555555@voiptalk.org. it is translated to russia@voiptalk.org ! This explains why calls to users on the SER server work. I would appreciate an explanation of this phenomena and how to preserver my URI going form the internal(*) to the external(*). Warm Regards and Thanks Shad Mortazavi --------------- Nexus Group Technical Manager n|m Nexus Management Inc -----Original Message----- From: Shad Mortazavi Sent: Thursday, March 30, 2006 10:30 AM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] Routing SIP calls via URI Dear Group; I can confirm that I have read through the three examples in www.voip-info.org. These examples are excellent and address a couple of the questions. I have IAX2 working between several asterisk servers on our VPN and between the DMZ and our LAN. Also exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) This answers part of the question; However what I want to do is to send any outbound sip calls via our external SIP server. i.e; VPN LAN IAX2 DMZ Internet Internal UA <-------> Internal (*) <------> External (*)<------> ExternalUA We have an extensive internal dial plan, X dial the UK, Y dial USA, 1XXX for Voicemail, 2xxx for Meetme, etc. Do I need to setup a prefix to dial the internet? And then route all calls to the External(*) based on this prefix? Thanks Shad Mortazavi ------------------------------ Nexus Group Technical Manager n|m Nexus Management Inc
Dear Group, I was able to fix this problem; The solution was to use a prefix to dial out. The next challenge was to send the SIP Domain over IAX2!. I found that if I included @SIPDOMAIN it would break the IAX2 communications. exten => _6.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}@SIPDOMAIN), breakes because @SIPDOMAIN is treated as the target context. You also can not include @Context after the @SIPDOMAIN. I created a new variable DS which was a concatenation of EXTEN and SIPDOMAIN separated by % and not @ and I was now able to pass this over IAX2; DS = EXTEN%SIPDOMAIN. exten => _6.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${DS}). At the other end I used the CUT command and substring facilities in Asterisk to split DS by the % eliminator; I re-formed a new variable which was DS = EXTEN@SIPDOMAIN. I can now pass calls from my internal Asterisk server to my external Asterisk server using IAX2 and then call any external VoIP number. Warm Regards Shad Mortazavi ------------------------------ Nexus Group Technical Manager n|m Nexus Management Inc -----Original Message----- From: Shad Mortazavi Sent: Thursday, March 30, 2006 10:30 AM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] Routing SIP calls via URI Dear Group; I can confirm that I have read through the three examples in www.voip-info.org. These examples are excellent and address a couple of the questions. I have IAX2 working between several asterisk servers on our VPN and between the DMZ and our LAN. Also exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) This answers part of the question; However what I want to do is to send any outbound sip calls via our external SIP server. i.e; VPN LAN IAX2 DMZ Internet Internal UA <-------> Internal (*) <------> External (*)<------> ExternalUA We have an extensive internal dial plan, X dial the UK, Y dial USA, 1XXX for Voicemail, 2xxx for Meetme, etc. Do I need to setup a prefix to dial the internet? And then route all calls to the External(*) based on this prefix? Thanks Shad Mortazavi ------------------------------ Nexus Group Technical Manager n|m Nexus Management Inc
But is there a way of doing this without a prefix? because people should dial without prefixes: "name@domain.pt" , not like: "6name@domain.pt" How can we make this without a prefix? something like: if( !uri=~"@mydomain.pt" ){ forward the all to the Internet } :) Thanks Joao Pereira Shad Mortazavi wrote:>Dear Group, > >I was able to fix this problem; > >The solution was to use a prefix to dial out. > >The next challenge was to send the SIP Domain over IAX2!. I found that >if I included @SIPDOMAIN it would break the IAX2 communications. > >exten => _6.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}@SIPDOMAIN), >breakes because @SIPDOMAIN is treated as the target context. You also >can not include @Context after the @SIPDOMAIN. > >I created a new variable DS which was a concatenation of EXTEN and >SIPDOMAIN separated by % and not @ and I was now able to pass this over >IAX2; > >DS = EXTEN%SIPDOMAIN. > >exten => _6.,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${DS}). > >At the other end I used the CUT command and substring facilities in >Asterisk to split DS by the % eliminator; I re-formed a new variable >which was > >DS = EXTEN@SIPDOMAIN. > >I can now pass calls from my internal Asterisk server to my external >Asterisk server using IAX2 and then call any external VoIP number. > >Warm Regards > >Shad Mortazavi >------------------------------ >Nexus Group Technical Manager >n|m Nexus Management Inc > >-----Original Message----- >From: Shad Mortazavi >Sent: Thursday, March 30, 2006 10:30 AM >To: asterisk-users@lists.digium.com >Subject: Re: [Asterisk-Users] Routing SIP calls via URI > >Dear Group; > >I can confirm that I have read through the three examples in >www.voip-info.org. > >These examples are excellent and address a couple of the questions. I >have IAX2 working between several asterisk servers on our VPN and >between the DMZ and our LAN. > >Also > >exten => shad,1,Dial(IAX2/bxxxxxx:yyyyyy@192.X.y.x/${EXTEN}) > >This answers part of the question; > >However what I want to do is to send any outbound sip calls via our >external SIP server. > >i.e; > VPN LAN IAX2 DMZ Internet >Internal UA <-------> Internal (*) <------> External (*)<------> >ExternalUA > >We have an extensive internal dial plan, X dial the UK, Y dial USA, 1XXX >for Voicemail, 2xxx for Meetme, etc. > >Do I need to setup a prefix to dial the internet? And then route all >calls to the External(*) based on this prefix? > >Thanks > >Shad Mortazavi >------------------------------ >Nexus Group Technical Manager >n|m Nexus Management Inc > > >_______________________________________________ >--Bandwidth and Colocation provided by Easynews.com -- > >Asterisk-Users mailing list >To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >