RESOLVED - 2 x Sip Accounts (Only 1 working for PSTN calls)

Hi Experts,

[UPDATE -
Looking at the CLI output when both are active, I get 2 messages about every 30 seconds - “SRV mapped to host sipgate.co.uk, port 5060” - I don’t get messages about the other service providors]

Please can you help…

I have registered 2 SIPGATE accounts (1 for my Wife & General Home, 1 for myself (Private Line)), and set them up on *. Either works independantly if I comment the other out in the config below.

But, I am having a really strange problem (and starting to think that it is SIPGATE at fault!) - I can only dial in on the number for the last sipgate acct registered, the first one ALWAYS reports: “The service cannot be connected” on dialing.

The problem follows the order of registration, NOT a specific number…?

I am sure (well at least hope!) I’m not going mad… Please let me know if you can see any error in my config files

Regards

Dave

[SIP.CONF] - (Only bits related to SIPGATE)

[general]
disallow=all
allow=ulaw
allow=alaw
allow=ilbc
allow=gsm
fromdomain=[mydomain]
relaxdtmf=yes
rtpiholdtimeout=300
rtptimeout=60
useragent=Asterisk
nat=yes
dtmfmode=rfc2833
localnet=192.168.0.0/255.255.0.0
externip=[My external IP]

; Used for incomming & Outgoing
register => ACCT1:PASS@sipgate.co.uk/ACCT1
register => ACCT2:PASS@sipgate.co.uk/ACCT2

; Others…
; register => @sip.voipbuster.com
; register => @fwd.pulver.com
; register => @sip.sipdiscount.com
; register => @lvdx.com

[sipgate2]
type=peer
username=ACCT2
secret=PASS
host=sipgate.co.uk
fromuser=ACCT2
fromdomain=sipgate.co.uk
nat=yes
authuser=PASS
dtmfmode=info
context=SIPGATE2-in
insecure=very
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
; allow=gsm

[sipgate1]
type=peer
username=ACCT1
secret=PASS
host=sipgate.co.uk
fromuser=ACCT1
fromdomain=sipgate.co.uk
nat=yes
authuser=PASS
dtmfmode=info
context=SIPGATE1-in
insecure=very
canreinvite=no
disallow=all
allow=ulaw
allow=alaw
; allow=gsm

[extenstions.conf] - Again only relevent stuff

[globals]
SIPGATE1 => SIP/SIPGATE1
SIPGATE2 => SIP/SIPGATE2
VOIPBUSTER => SIP/VOIPBUSTER
FWD => SIP/FWD
SIPDISCOUNT => SIP/SIPDISCOUNT
LVDX = SIP/LVDX

[SIPGATE1]
exten => _X.,1,SetCallerID([MYCALLERID])
exten => _X.,2,Dial(SIP/${EXTEN:1}@sipgate,20,tr)
exten => _X.,3,Congestion
exten => _X.,4,Busy
exten => _X.,5,Hangup

[SIPGATE1-in]
exten => h,1,Hangup
exten => ACCT1,1,Dial(SIP/805,20,tr)

[SIPGATE2]
exten => _X.,1,SetCallerID([MYCALLERID])
exten => _X.,2,Dial(SIP/${EXTEN:1}@sipgate,20,tr)
exten => _X.,3,Congestion
exten => _X.,4,Busy
exten => _X.,5,Hangup

[SIPGATE2-in]
exten => h,1,Hangup
exten => ACCT2,1,Dial(SIP/804&SIP/805&SIP/850,20,tr)

[VOIPBUSTER]
exten => _X.,1,SetCallerID([MYCALLERID])
exten => _X.,2,Dial(SIP/${EXTEN:1}@voipbuster,20,tr)
exten => _X.,3,Congestion
exten => _X.,4,Busy
exten => _X.,5,Hangup

AS I asked for anybody to look for error’s, and I haven’t had any reply, could I ask if an * expert could confirm that this looks right!

Thanks in advance

Dave

I assume by “dial in” you mean make a call from the PSTN to your sipgate account - and through that to your Asterisk server.

[quote]
[sipgate2]
type=peer
[…][/quote]
I’m surprised you get any incoming calls! “Peer” should be “friend”. “Peer” is for outgoing calls only, “friend” is for incoming and outgoing.

I haven’t really looked any further through your configs.

I’ve got two accounts with sipgate.co.uk and i don’t have any problems with incoming calls on both numbers.

Sorry,

That should say friend, (although it is working as peer???) This was lifted from one of the configs after another modification for testing.

And yes, dial-in from PSTN.

Could I possibly see your dual sipgate config files?

Cheers

Dave

In sip.conf:

[general]
context=default                 ; Default context for incoming calls
port=5060                       ; UDP Port to bind to (SIP standard port is 5060
)
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=no
tos=lowdelay               ; lowdelay,throughput,reliability,mincost,none
disallow=all
allow=g729                      ; Allow codecs in order of preference
allow=gsm                       ; Note: codec order is respected only in
allow=ilbc
allow=ulaw                      ;       [general]
useragent=~Asterisk PBX         ; Allows you to change the user agent string
canreinvite=no
nat=no                          ; NAT settings 

[ here are register statements that are the same as your example ]

localnet=192.168.0.0/255.255.255.0      ; All RFC 1918 addresses are local
localnet=127.0.0.0/255.255.255.0                                ; networks

[sipgate-1]
type=friend
host=sipgate.co.uk
username=9999999
fromuser=9999999
secret=xxxxxxx
fromdomain=sipgate.co.uk
qualify=3000
authuser=9999999
nat=no 
disallow=all
allow=g729
context=default
dtmfmode=info

[sipgate-2]
type=friend
host=sipgate.co.uk
username=9999999
fromuser=9999999
authuser=9999999
secret=xxxxxxx
host=sipgate.co.uk
qualify=no
nat=no
disallow=all
allow=gsm
allow=ilbc
insecure=very
fromdomain=sipgate.co.uk
dtmfmode=info

Yeah, they’re not precisely identical…

in extensions.conf:

[default]
exten => 9999999,1,Goto(2,1)

exten => 2,1,Dial(SIP/budgetone,15,r)

etc…

Thanks for this, you put me on the right track, although your config had the same problem (for me at least :open_mouth: ):

I (effectivley) had to add:

exten => ACCT1,1,Goto(2,1)
exten => ACCT2,1,Goto(2,1)
exten => 2,1,Dial(SIP/budgetone,15,r)

to make it work!

Thanks for the advice