Raul Elizondo (wizardteam)
2004-Sep-15 02:45 UTC
[Asterisk-Users] IAX to IAX connect question
Hi, I got my * working fine with FWD at office with 2 extensions, i receive calls and i can make calls thru FWD. I got also my * at home, and i connected it using auth=rsa. From my home, i can make calls using my office iax, but if i try to redirect incomming calls from FWD to my * at home, it rejects the call. I created the pub/key pairs for rsa and its working ok and i just pasted the sections/contexts involved. Must of the samples around the internet works with double config in iax.conf for each server, a peer and a user, i've done that in a VPN and that works fine. But... imagine setting a new *, i would need to modify the first 2 besides that adding them in the new one. What about a 4th or a 5th? Every new * in the pbx means to modify all other *. So what i thougth was to set a main one with some of slaves or users, in this way, i will only need to add new "slaves" in the master, and this is what i tried. Office iax.conf ==============register => 999999:mypass@iax2.fwdnet.net [iaxfwd] type=user context=fromiaxfwd auth=rsa inkeys=freeworlddialup [rsaauth] type=peer host=dynamic auth=rsa outkeys=myast username=rsaauth context=extensions [user01] type=peer user=user01 host=dynamic secret=somepass username=user01 context=localuse outkeys=myast inkeys=myast Office extensions.conf =====================[officetime] exten => _999999,1,Answer exten => _999999,2,wait(1) exten => _999999,3,Dial(Zap/1,20,tr) exten => _999999,4,Voicemail,u101 exten => _999999,102,Voicemail,b101 exten => _999999,105,Hangup [noofficetime] exten => _999999,1,Answer exten => _999999,2,wait(1) exten => _999999,3,Dial(IAX2/user01/${EXTEN}) exten => _999999,4,Voicemail,u101 exten => _999999,102,Voicemail,b101 exten => _999999,105,Hangup [fromiaxfwd] include => officetime|09:00-17:30 include => noofficetime|17:30-23:59 include => noofficetime|00:00-08:59 [toiaxfwd] exten => _8.,1,SetCallerId,"MyName" exten => _8.,2,Dial(IAX2/999999:mypass@iax2.fwdnet.net/${EXTEN:1},60,r) exten => _8.,3,Congestion [localuse] include => extensions include => toiaxfwd Home iax.conf ============register => user01:somepass@mydynoffice [rsaauth] type=user context=fromoffice auth=rsa inkeys=myast allow=gsm Home extensions.conf =================== [fromoffice] exten => s,1,Dial(Zap/1,20) exten => s,2,Voicemail(u101) exten => s,3,Hangup exten => s,102,Voicemail(b101) exten => s,103,Hangup [tooffice] exten => _7.,1,SetCallerId,"MyName" exten => _7.,2,Dial(IAX2/user01:somepass@mydynoffice/${EXTEN},60,r) exten => _7.,3,Congestion Everything from my home to the office works fine, even the FWD calls. RSA auth is working without problem. The problem comes when i try out of office hours. My home * just refuses the calls. I've tried with switch instead of exten, but even in the samples it is kinda confusing. Any hint or help with this? (i believe it would be only one line that is not right "Dial(IAX2/user01/${EXTEN})") Regards, -=Raul=-
Benjamin on Asterisk Mailing Lists
2004-Sep-15 04:09 UTC
[Asterisk-Users] IAX to IAX connect question
On Wed, 15 Sep 2004 03:45:59 -0600, Raul Elizondo (wizardteam) <rauleli@wizardteam.com> wrote:> I got my * working fine with FWD at office with 2 extensions, i receive > calls and i can make calls thru FWD. I got also my * at home, and i > connected it using auth=rsa. From my home, i can make calls using my office > iax, but if i try to redirect incomming calls from FWD to my * at home, it > rejects the call. I created the pub/key pairs for rsa and its working ok > and i just pasted the sections/contexts involved. > > Must of the samples around the internet works with double config in iax.conf > for each server, a peer and a user, i've done that in a VPN and that works > fine. But... imagine setting a new *, i would need to modify the first 2 > besides that adding them in the new one. What about a 4th or a 5th? Every > new * in the pbx means to modify all other *. So what i thougth was to set > a main one with some of slaves or users, in this way, i will only need to > add new "slaves" in the master, and this is what i tried.There are a few things wrong and bad in your setup. For example _999999 doesn't make any sense. The underscore denotes a pattern for pattern matching, you you don't use any pattern, just a number. Further, you should not use Dial(.../user:passwd@peer, ...). NEVER EVER other than for testing. It is sad that FWD recommends this in their sample because by doing that, they teach newbies to do things the wrong way. The context for your user01 is "localuse" which in itself is a master context that includes a context "extensions". Yet, you don't provide that context, so it is hard to say how you end up in the out of office hours context. I also think you should make a distinction between dialing internal extensions from a remote office and dialing an external service for which you act as a gateway. In my book this should be separated, like so ... Office:/etc/asterisk/iax.conf ... [FWD-service] type=user ; we are letting a remote user use this server to call FWD username=rfwduser ; their username with us here host=dynamic ; their host may not have a fixed ip address context=fwd-service [FWD-gw] ; outbound connections to FWD from here type=peer username=12345 host=iax2.fwdnet.net Home:/etc/asterisk/iax.conf ... [FWD-gw] type=peer ; we are using the remote office server as a gateway to call out username=rfwduser ; our username with the remote office server host=ip-or-dns ; the ip address or dns name of the remote office server Office:/etc/asterisk/extensions.conf ... [globals] FWDUSERID=12345 FWDUSERNAME=Fred Flintstone Inc FWDGW=IAX2/12345@FWD-gw ; this is FWD's IAX server [fwd-service] ; we provide this context for remote users calling FWD through us exten => _X.,1,SetCallerID(${FWDUSERID}) exten => _X.,2,SetCIDName(${FWDUSERNAME}) exten => _X.,3,Dial(${FWDGW}/${EXTEN},60,r) exten => _X.,4,Hangup Home:/etc/asterisk/extensions.conf ... [globals] FWDGW=IAX2/rfwduser@FWD-gw ; this is our office server acting as a gateway [fwd-service] ; we use the remote server at the office to call FWD exten => _X.,1,Dial($FWDGW}/${EXTEN},60,r) exten => _X.,2,Hangup ; ; Don't forget to include this context for anybody who is supposed to use it This is just the bare minimum, you need to fill in passwords or RSA keys and the codecs (ulaw only for FWD's server) and whatever else you may wish to use (ie qualify=yes, accountcode=123 etc). You can then use the same FWD gateway service you provide through your own office server from any location, so there is no additional configuration required for additional offices or homes. You can then also use the same as a blueprint for providing a service to call other services for which you want your office server to act as a gateway. Finally you can use part of it as a blueprint for providing a service to call internal extensions. The key is to think of everything as a service. You are either a service provider or a service user, in some cases you are both a provider and a user (when you are acting as a gateway). Keeping different services apart from each other helps breaking down the complexity of the configuration, it keeps your dialplan and other configs easier to understand when they grow and consequently easier to maintain. It also makes trouble shooting much easier because you can focus at a single piece and ignore all the rest. Finally, you reduce side effects, that is to say, you won't run into a situation where something that worked yesterday doesn't work anymore because of a configuration change in what appeared to be a totally unrelated thing that shouldn't have made any impact. hope this helps rgds benjk -- Sunrise Telephone Systems, 9F Shibuya Daikyo Bldg., 1-13-5 Shibuya, Tokyo, Japan. NB: Spam filters in place. Messages unrelated to the * mailing lists may get trashed.
Benjamin on Asterisk Mailing Lists
2004-Sep-15 12:04 UTC
[Asterisk-Users] IAX to IAX connect question
On Thu, 16 Sep 2004 00:49:11 +0800, Dinesh Nair <dinesh@alphaque.com> wrote:> if the office asterisk had an iax entry of type friend, and the home > asterisk did a register with the office asterisk, then the office asterisk > would not need another entry for the home asterisk ? is this assumption > correct ?As I said, I strongly advise against the use of type=friend for anything other than troubleshooting. rgds benjk -- Sunrise Telephone Systems, 9F Shibuya Daikyo Bldg., 1-13-5 Shibuya, Tokyo, Japan. NB: Spam filters in place. Messages unrelated to the * mailing lists may get trashed.
Raul Elizondo (wizardteam)
2004-Sep-16 04:24 UTC
[Asterisk-Users] IAX to IAX connect question
I think i got the solution for what i was planing to set. Here is a ontheway sample (not what i got but its about the same) Office iax.conf --------------- register => 123456:somepass@iax2.fwdnet.net jitterbuffer=no tos=lowdelay [iaxfwd] type=user context=fromiaxfwd auth=rsa inkeys=freeworlddialup diallow=all allow=ulaw [myofficename] type=peer host=dynamic auth=rsa outkeys=myrsa username=myofficename context=somecontext [user01] type=friend user=user01 host=dynamic secret=somepass01 username=user01 context=accesslevel01 [user02] type=friend user=user02 host=dynamic secret=somepass01 username=user01 context=accesslevel01 Office extensions.conf ---------------------- [general] static=yes writeprotect=no [globals] MYUSER01=IAX2/myofficename:[myrsa]@user01 MYUSER02=IAX2/myofficename:[myrsa]@user02 MYOFFICENAMECID="Some name" MYFWDUP=IAX2/123456:somepass@iax2.fwdnet.net [extensions] ; set of extensions ; for testing like echotest and others ; or whatever else needed [fromiaxfwd] exten => 123456,1,Answer exten => 123456,2,Dial(${MYUSER01}&${MYUSER02},60,r) exten => 123456,3,Hangup [toiaxfwd] exten => _8.,1,SetCallerId,${MYOFFICENAMECID} exten => _8.,2,Dial(${MYFWDUP}/${EXTEN:1},60,r) exten => _8.,3,Congestion [accesslevel01] include => extensions ignorepat => 8 include => toiaxfwd User01 iax.conf --------------- register => user01:somepas01@myofficedyn.tld [myofficename] type=user context=fromoffice auth=rsa inkeys=myrsa User01 extensions.conf ---------------------- [globals] MYOFFICE=IAX2/user01:somepass01@myofficedyn.tld FWDCIDNAME="My name01" [extensions] ; my local extensions [fromoffice] exten => s,1,goto(extensions,101,1) ; where the zap/1 is located [toiaxfwd] exten => _8.,1,SetCallerId,${FWDCIDNAME} exten => _8.,1,Dial(${MYOFFICE}/${EXTEN},60,r) exten => _8.,2,Congestion [localaccess] ; set of local pstn access [dialaccess] ; where zap/* or local sip phones should point include => extensions ignorepat => 8 include => toiaxfwd ignorepat => 9 include => localaccess User02 iax.conf --------------- register => user02:somepas02@myofficedyn.tld [myofficename] type=user context=fromoffice auth=rsa inkeys=myrsa User02 extensions.conf ---------------------- [globals] MYOFFICE=IAX2/user02:somepass02@myofficedyn.tld FWDCIDNAME="My name02" [extensions] ; my local extensions [fromoffice] exten => s,1,goto(extensions,201,1) ; where the zap/1 or sip is located [toiaxfwd] exten => _8.,1,SetCallerId,${FWDCIDNAME} exten => _8.,1,Dial(${MYOFFICE}/${EXTEN},60,r) exten => _8.,2,Congestion [localaccess] ; set of local pstn access [dialaccess] ; where zap/* or local sip phones should point include => extensions ignorepat => 8 include => toiaxfwd ignorepat => 9 include => localaccess So, in this way, i can keep adding users in the office using only one context for each user with its own user/pass for validation. Now, here it comes another thing. When i call from user01 (or home) to FWD, as soon as it answer it hangsup. There was just a couple times i could do the FWD echotest or the 411, but not anymore but incoming calls from FWD and from office works fine. Does anyone see something wrong? Regards, Raul Elizondo FWD# 486533
Raul Elizondo (wizardteam)
2004-Sep-17 19:42 UTC
[Asterisk-Users] IAX to IAX connect question
and the answer for my own question is: using "notransfer=yes" on the iax.conf contexts ------------- Raul Elizondo FWD: 486533> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com]On Behalf Of Raul > Elizondo (wizardteam) > Sent: Thursday, September 16, 2004 5:24 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: RE: [Asterisk-Users] IAX to IAX connect question > > > I think i got the solution for what i was planing to set. Here is a > ontheway sample (not what i got but its about the same) > > Office iax.conf > --------------- > register => 123456:somepass@iax2.fwdnet.net > > jitterbuffer=no > tos=lowdelay > > [iaxfwd] > type=user > context=fromiaxfwd > auth=rsa > inkeys=freeworlddialup > diallow=all > allow=ulaw > > [myofficename] > type=peer > host=dynamic > auth=rsa > outkeys=myrsa > username=myofficename > context=somecontext > > [user01] > type=friend > user=user01 > host=dynamic > secret=somepass01 > username=user01 > context=accesslevel01 > > [user02] > type=friend > user=user02 > host=dynamic > secret=somepass01 > username=user01 > context=accesslevel01 > > Office extensions.conf > ---------------------- > [general] > static=yes > writeprotect=no > > [globals] > MYUSER01=IAX2/myofficename:[myrsa]@user01 > MYUSER02=IAX2/myofficename:[myrsa]@user02 > MYOFFICENAMECID="Some name" > MYFWDUP=IAX2/123456:somepass@iax2.fwdnet.net > > [extensions] > ; set of extensions > ; for testing like echotest and others > ; or whatever else needed > > [fromiaxfwd] > exten => 123456,1,Answer > exten => 123456,2,Dial(${MYUSER01}&${MYUSER02},60,r) > exten => 123456,3,Hangup > > [toiaxfwd] > exten => _8.,1,SetCallerId,${MYOFFICENAMECID} > exten => _8.,2,Dial(${MYFWDUP}/${EXTEN:1},60,r) > exten => _8.,3,Congestion > > [accesslevel01] > include => extensions > ignorepat => 8 > include => toiaxfwd > > User01 iax.conf > --------------- > register => user01:somepas01@myofficedyn.tld > > [myofficename] > type=user > context=fromoffice > auth=rsa > inkeys=myrsa > > User01 extensions.conf > ---------------------- > [globals] > MYOFFICE=IAX2/user01:somepass01@myofficedyn.tld > FWDCIDNAME="My name01" > > [extensions] > ; my local extensions > > [fromoffice] > exten => s,1,goto(extensions,101,1) ; where the zap/1 is located > > [toiaxfwd] > exten => _8.,1,SetCallerId,${FWDCIDNAME} > exten => _8.,1,Dial(${MYOFFICE}/${EXTEN},60,r) > exten => _8.,2,Congestion > > [localaccess] > ; set of local pstn access > > [dialaccess] > ; where zap/* or local sip phones should point > include => extensions > ignorepat => 8 > include => toiaxfwd > ignorepat => 9 > include => localaccess > > User02 iax.conf > --------------- > register => user02:somepas02@myofficedyn.tld > > [myofficename] > type=user > context=fromoffice > auth=rsa > inkeys=myrsa > > User02 extensions.conf > ---------------------- > [globals] > MYOFFICE=IAX2/user02:somepass02@myofficedyn.tld > FWDCIDNAME="My name02" > > [extensions] > ; my local extensions > > [fromoffice] > exten => s,1,goto(extensions,201,1) ; where the zap/1 or sip is located > > [toiaxfwd] > exten => _8.,1,SetCallerId,${FWDCIDNAME} > exten => _8.,1,Dial(${MYOFFICE}/${EXTEN},60,r) > exten => _8.,2,Congestion > > [localaccess] > ; set of local pstn access > > [dialaccess] > ; where zap/* or local sip phones should point > include => extensions > ignorepat => 8 > include => toiaxfwd > ignorepat => 9 > include => localaccess > > > So, in this way, i can keep adding users in the office using only one > context for each user with its own user/pass for validation. > > Now, here it comes another thing. When i call from user01 (or > home) to FWD, > as soon as it answer it hangsup. There was just a couple times i could do > the FWD echotest or the 411, but not anymore but incoming calls > from FWD and > from office works fine. Does anyone see something wrong? > > Regards, > > > Raul Elizondo > FWD# 486533 > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users