RE: [Asterisk-Users] IAX to IAX connect question

2004-09-17 Thread Raul Elizondo (wizardteam)
and the answer for my own question is:

using notransfer=yes on the iax.conf contexts

-
Raul Elizondo
FWD: 486533


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] 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:[EMAIL PROTECTED]

 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:[EMAIL PROTECTED]
 MYUSER02=IAX2/myofficename:[EMAIL PROTECTED]
 MYOFFICENAMECID=Some name
 MYFWDUP=IAX2/123456:[EMAIL PROTECTED]

 [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:[EMAIL PROTECTED]

 [myofficename]
 type=user
 context=fromoffice
 auth=rsa
 inkeys=myrsa

 User01 extensions.conf
 --
 [globals]
 MYOFFICE=IAX2/user01:[EMAIL PROTECTED]
 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:[EMAIL PROTECTED]

 [myofficename]
 type=user
 context=fromoffice
 auth=rsa
 inkeys=myrsa

 User02 extensions.conf
 --
 [globals]
 MYOFFICE=IAX2/user02:[EMAIL PROTECTED]
 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
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] IAX to IAX connect question

2004-09-16 Thread Raul Elizondo (wizardteam)
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:[EMAIL PROTECTED]

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:[EMAIL PROTECTED]
MYUSER02=IAX2/myofficename:[EMAIL PROTECTED]
MYOFFICENAMECID=Some name
MYFWDUP=IAX2/123456:[EMAIL PROTECTED]

[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:[EMAIL PROTECTED]

[myofficename]
type=user
context=fromoffice
auth=rsa
inkeys=myrsa

User01 extensions.conf
--
[globals]
MYOFFICE=IAX2/user01:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]

[myofficename]
type=user
context=fromoffice
auth=rsa
inkeys=myrsa

User02 extensions.conf
--
[globals]
MYOFFICE=IAX2/user02:[EMAIL PROTECTED]
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
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] IAX to IAX connect question

2004-09-15 Thread Benjamin on Asterisk Mailing Lists
On Wed, 15 Sep 2004 03:45:59 -0600, Raul Elizondo (wizardteam)
[EMAIL PROTECTED] 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 _99 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:[EMAIL PROTECTED], ...). 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/[EMAIL PROTECTED] ; 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/[EMAIL PROTECTED] ; 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.
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE 

RE: [Asterisk-Users] IAX to IAX connect question

2004-09-15 Thread Raul Elizondo (wizardteam)
Hi Benjamin,

Thanks for answering, now i got some other questions.

Acording to http://www.voip-info.org/wiki-Asterisk+iax+rsa+auth, and my
understanding of peer and user, [FWD-service] in the sample you provide me
should be type=peer as it will be the master/server, and [FWD-gw] should be
type=user as it is a client for FWD service.

Now, lets think that office is FWD, and home is a common client of FWD, so
the question is simple.  If i set:

Home:iax.conf
register = user:[EMAIL PROTECTED]

[office]
type=user
host=dynoffice.tld
context=fromoffice
auth=rsa
inkeys=myastkey

Home:extensions.conf
[extensions]
exten = 101,1,Dial(Zap/1,20)
exten = 101,2,Voicemail(u${EXTEN})
exten = 101,3,Hangup
exten = 101,102,Voicemail(b${EXTEN}}
exten = 101,103,Hangup

[fromoffice]
exten = s,1,goto(extensions,101,1)

The question is:  What would i need to set in office in order to receive
calls from FWD or another service?


-=Raul=-

 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/[EMAIL PROTECTED] ; 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/[EMAIL PROTECTED] ; 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


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] IAX to IAX connect question

2004-09-15 Thread Benjamin on Asterisk Mailing Lists
On Wed, 15 Sep 2004 06:36:48 -0600, Raul Elizondo (wizardteam)
[EMAIL PROTECTED] wrote:
 Acording to http://www.voip-info.org/wiki-Asterisk+iax+rsa+auth, and my
 understanding of peer and user, [FWD-service] in the sample you provide me
 should be type=peer as it will be the master/server, and [FWD-gw] should be
 type=user as it is a client for FWD service.

It always depends from which side you are looking, local or remote.

An entry of type peer is for the local Asterisk where this entry is
defined to make connections to a remote Asterisk. An entry of type
user is for the local Asterisk to accept incoming connections from a
remote Asterisk.

An entry of type peer on the local Asterisk has to be matched with an
entry of type user on the remote Asterisk. Likewise, an entry of type
user on the local Asterisk has to be matched with an entry of type
peer on the remote Asterisk.

Admittedly, this can be confusing. In my experience, it is the naming
of local and remote peers which causes most people difficulties
configuring IAX peering. Once you got the naming right, everything
else becomes straightforward.

Here is what I use ...

Let's assume we are setting up IAX peering with a company called Flintstone Inc.

On the local system, I define flintstones for inbound and
flintstones-gw for outbound connections:

; -
; Peer entries for P2P IAX connections
; -
;
[flintstones] ; incoming connections from Flintstone Inc.
type=user ; they are user flintstones here at Sunrise
auth=md5
secret=blah
host=iax.flintstones.com
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
context=incoming
;
[flintstones-gw] ; outbound connections to Flintstone Inc.
type=peer
username=sunrise ; we are user sunrise at remote peer flintstones-gw
auth=md5
secret=blah
host=iax.flintstones.com
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
callerid=Sunrise1 408 350-2438

On the remote system I'd define sunrise and sunrise-gw, where sunrise
would match up with flintstones-gw and sunrise-gw would match up with
flintstones:

; -
; Peer entries for P2P IAX connections
; -
;
[sunrise] ; incoming connections from Sunrise Telephone Systems Ltd.
type=user ; they are user sunrise here at Flintstones
auth=md5
secret=blah
host=sunrise-tel-server
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
context=incoming
;
[sunrise-gw] ; outbound connections to Sunrise Telephone Systems Ltd.
type=peer
username=flintstones ; we are user flintstones at remote peer sunrise-gw
auth=md5
secret=blah
host=sunrise-tel-server
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
callerid=Flintstones1 555 123-4567

You will find that this is all you need to get calls in both
directions going. You will also find that these two pairs illustrate
how peering works. Study these samples and you can roll your own.

I don't want to discourage you from using names such as office and
home, but you first need to understand that you need two entries on
each side and that they need to be matching pairs. Once you have
immersed that, you can start thinking about your own naming scheme.

The catch is that a name you assign on Asterisk server Home may make
perfect sense locally but confuses you when you use it on Asterisk
server Office for connecting to Home. Likewise, a name you assign
on Asterisk server Office may make sense locally but confuse you on
Asterisk server Home.

Typically, names like Home-in and Home-out, Office-in and Office-out
fall into this category. The reason is that Home-in on Home would be
Home-in on Office for outgoing calls and Office-in on Office would be
Office-in on Home, which doesn't make a lot of sense. This is because
what is in on one side should be out on the other.

Anyway, I don't claim to have invented the ultimate naming scheme, but
I found the scheme I use to be the least confusing of all the
different things I have tried.

One of the things I would advise against is using type=friend. It
looks like a great space saver when you start doing this, but it is
prone to lead you to confusion and it invisibly joins things that
should be kept separate.

The only time when type=friends should be used is when troubleshooting
an entry, but once you've got it working you should narrow it down to
either peer or user again.

 The question is:  What would i need to set in office in order to receive
 calls from FWD or another service?

Set up two entries on each machine, one for incoming and one for
outgoing connections, similar to the way I have shown above.

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 

Re: [Asterisk-Users] IAX to IAX connect question

2004-09-15 Thread Dinesh Nair
On 15/09/2004 22:41 Benjamin on Asterisk Mailing Lists said the following:
On Wed, 15 Sep 2004 06:36:48 -0600, Raul Elizondo (wizardteam)
[EMAIL PROTECTED] wrote:
Acording to http://www.voip-info.org/wiki-Asterisk+iax+rsa+auth, and my
understanding of peer and user, [FWD-service] in the sample you provide me
should be type=peer as it will be the master/server, and [FWD-gw] should be
type=user as it is a client for FWD service.
An entry of type peer is for the local Asterisk where this entry is
defined to make connections to a remote Asterisk. An entry of type
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 ?

--
Regards,   /\_/\   All dogs go to heaven.
[EMAIL PROTECTED](0 0)http://www.alphaque.com/
+==oOO--(_)--OOo==+
| for a in past present future; do|
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo The opinions here in no way reflect the opinions of my $a $b.  |
| done; done  |
+=+
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] IAX to IAX connect question

2004-09-15 Thread Benjamin on Asterisk Mailing Lists
On Thu, 16 Sep 2004 00:49:11 +0800, Dinesh Nair [EMAIL PROTECTED] 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.
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users