|
Home > Archive > Voice Over IP in UK > May 2007 > Asterisk conf for Sipgate.co.uk
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Asterisk conf for Sipgate.co.uk
|
|
|
| Hi,
I tryed to receive phone calls from Sipgate.co.uk
I am currently connected to Sipgate.co.uk
Now, into my [incoming] calls
None of the Sipgate phone received seemed to match this !! :-(
--------------------
[globals]
INCOMING=1009326 ; with phone number : +44 1234 1009326
[incoming]
Exten => ${INCOMING1},1,answer()
Exten => ${INCOMING1},2,Set(TRIES=0)
Exten => ${INCOMING1},3,ringing(3)
............
............
--------------
Now, I found on their website :
Asterisk PBX
IP: sip:sipgate-uk@<My-IP_Address>:5060
- Any ideas what's wrong ?
I am not sure to understand how to integrate this ?!?
With Voipfone, if I replace INCOMING=<UserID> => work fine
Thanks for your help
| |
| Gordon Henderson 2007-05-15, 7:11 pm |
| In article <f2d804$m3m$1$8300dec7@news.demon.co.uk>,
Steve <user@mail.com> wrote:
>Hi,
>
>I tryed to receive phone calls from Sipgate.co.uk
>
>I am currently connected to Sipgate.co.uk
>Now, into my [incoming] calls
>None of the Sipgate phone received seemed to match this !! :-(
>
>--------------------
>[globals]
>
>INCOMING=1009326 ; with phone number : +44 1234 1009326
>
>[incoming]
>Exten => ${INCOMING1},1,answer()
>Exten => ${INCOMING1},2,Set(TRIES=0)
>Exten => ${INCOMING1},3,ringing(3)
>...........
>...........
>
>--------------
>
>Now, I found on their website :
> Asterisk PBX
> IP: sip:sipgate-uk@<My-IP_Address>:5060
>
>- Any ideas what's wrong ?
>
>I am not sure to understand how to integrate this ?!?
There is a page on their site which has details, however, try this:
In sip.conf:
; SIP Trunk to sipgate [sipgate.co.uk]
register => 1009326:xxxxxxx@sipgate.co.uk/1009326
; SIP Trunk to sipgate [sipgate.co.uk]
[sipgate-out]
context=from-sipgate
type=friend
nat=no
host=sipgate.co.uk
insecure=port,invite
username=1009326
fromuser=1009326
secret=xxxx
fromdomain=sipgate.co.uk
qualify=yes
disallow=all
allow=alaw
allow=g726
allow=gsm
in extensions.conf:
; Trunk from sipgate [sipgate.co.uk]
[from-sipgate]
exten => 1009326,1,Noop(Incoming SIP call from ${CALLERID(all)} @ sipgate calling ${EXTEN})
exten => 1009326,n,SetCallerID(Via SipGate <${CALLERID(num)}> )
exten => 1009326,n,Dial(SIP/101)
that last dial line will need to be change to whatever you're using to ring your phone
And somewhere else in extensions.conf, in a contect you can dial-out on:
exten => _70.,1,Noop(Making SIP Call to ${EXTEN:2}@sipgate)
exten => _70.,n,SetCallerID(1009326)
exten => _70.,n,Dial(SIP/sipgate-out/${EXTEN:2})
exten => _70.,n,Hangup()
That's a prefix of 70, then a number. Change it to suit.
Gordon
| |
|
| Gordon Henderson wrote:
> In article <f2d804$m3m$1$8300dec7@news.demon.co.uk>,
> Steve <user@mail.com> wrote:
>
> There is a page on their site which has details, however, try this:
>
> In sip.conf:
>
> ; SIP Trunk to sipgate [sipgate.co.uk]
> register => 1009326:xxxxxxx@sipgate.co.uk/1009326
>
> ; SIP Trunk to sipgate [sipgate.co.uk]
> [sipgate-out]
> context=from-sipgate
> type=friend
> nat=no
> host=sipgate.co.uk
> insecure=port,invite
> username=1009326
> fromuser=1009326
> secret=xxxx
> fromdomain=sipgate.co.uk
> qualify=yes
> disallow=all
> allow=alaw
> allow=g726
> allow=gsm
>
>
> in extensions.conf:
>
> ; Trunk from sipgate [sipgate.co.uk]
> [from-sipgate]
> exten => 1009326,1,Noop(Incoming SIP call from ${CALLERID(all)} @ sipgate calling ${EXTEN})
> exten => 1009326,n,SetCallerID(Via SipGate <${CALLERID(num)}> )
> exten => 1009326,n,Dial(SIP/101)
>
> that last dial line will need to be change to whatever you're using to ring your phone
>
> And somewhere else in extensions.conf, in a contect you can dial-out on:
>
> exten => _70.,1,Noop(Making SIP Call to ${EXTEN:2}@sipgate)
> exten => _70.,n,SetCallerID(1009326)
> exten => _70.,n,Dial(SIP/sipgate-out/${EXTEN:2})
> exten => _70.,n,Hangup()
>
> That's a prefix of 70, then a number. Change it to suit.
>
> Gordon
Hi Gordon,
Thanks these info.. however, I stil have something wrong with it.
Here is the exact config I have :
I seemed to be connected to the server...
ButNoting is incoming
If I add the line Exten => 0,1,goto(incoming,1009326,1)
and press the 0 => that's OK !!!
SO the script seems to be OK, except that it doesn't work if the phone
call is genereated by Sipgate.
--------------------------
Sip.conf
[general]
port = 5060
bindaddr = 0.0.0.0
allow=all
context=default
srvlookup=no ; could help if Phone using DNS
externip=xx.xx.xx.xx
localnet=192.168.3.0/255.255.255.0
register => 1009326:xxxx@sipgate.co.uk/1009326
[sipgate]
type=friend
secret=xxxxx
username=1009326
fromuser=1009326
fromdomain=sipgate.co.uk
host=sipgate.co.uk
insecure=port,invite
qualify=yes
nat=no
context=incoming
disallow=all
allow=alaw
allow=g726
allow=gsm
EXTENSION.CONF
[general]
;
static=yes
writeprotect=no
Static=yes ; DialPlan can't be modified by Asterisk
clearglobalvars=no
priorityjumping=no
autofallthrough=yes
[globals]
GROUP=SIP/120&SIP/121
INCOMING1=1009326
[incoming]
exten => ${INCOMING1},1,Noop(Incoming SIP call from ${CALLERID(all)} @
sipgate calling ${EXTEN})
exten => ${INCOMING1},2,SetCallerID(From SipGate <${CALLERID(num)}> )
Exten => ${INCOMING1},2,Set(TRIES=0)
Exten => ${INCOMING1},3,ringing(3)
Exten => ${INCOMING1},4,background(priv-introsaved)
Exten => ${INCOMING1},5,background(queue-thankyou)
Exten => ${INCOMING1},n,Dial(SIP/121,10,r)
Exten => ${INCOMING1},n,playback(vm-nobodyavail)
Exten => ${INCOMING1},n,Dial(${GROUP},10,mr)
Exten => ${INCOMING1},n,playback(tt-allbusy)
Exten => ${INCOMING1},n,wait(2)
Exten => ${INCOMING1},n,goto(${INCOMING1},7)
;Exten => $& #123;INCOMING1},n,voicemail(u300@default
)
Exten => ${INCOMING1},n,congestion
| |
| Gordon Henderson 2007-05-16, 7:11 am |
| In article <f2e8ii$f3u$1$8300dec7@news.demon.co.uk>,
Steve <user@mail.com> wrote:
>Hi Gordon,
>
>Thanks these info.. however, I stil have something wrong with it.
>Here is the exact config I have :
>I seemed to be connected to the server...
>ButNoting is incoming
>
>If I add the line Exten => 0,1,goto(incoming,1009326,1)
>and press the 0 => that's OK !!!
>SO the script seems to be OK, except that it doesn't work if the phone
>call is genereated by Sipgate.
>
>--------------------------
>
>Sip.conf
>
>[general]
>
>port = 5060
>bindaddr = 0.0.0.0
>allow=all
>context=default
>srvlookup=no ; could help if Phone using DNS
>externip=xx.xx.xx.xx
>localnet=192.168.3.0/255.255.255.0
>
>register => 1009326:xxxx@sipgate.co.uk/1009326
>
>[sipgate]
>type=friend
>secret=xxxxx
>username=1009326
>fromuser=1009326
>fromdomain=sipgate.co.uk
>host=sipgate.co.uk
>insecure=port,invite
>qualify=yes
>nat=no
>context=incoming
>disallow=all
>allow=alaw
>allow=g726
>allow=gsm
As you have externip= and localnet= settings above, you probably
want nat=yes here. The box I cut & pasted that off isn't behind a NAT
firewall/router.
Remember to connect to asterisk and set verbose 9999 which will help
you debug.
asterisk -r
set verbose 9999
then call your sipgate number from another phone.
And you can use sip show peers to make sure you're actually peering
with Sipgate - if nothing else it'll make sure your register statement
is working OK.
>EXTENSION.CONF
>
>[general]
>;
>static=yes
>writeprotect=no
>Static=yes ; DialPlan can't be modified by Asterisk
>clearglobalvars=no
>priorityjumping=no
>autofallthrough=yes
>[globals]
>
>GROUP=SIP/120&SIP/121
>INCOMING1=1009326
>
>[incoming]
>
>exten => ${INCOMING1},1,Noop(Incoming SIP call from ${CALLERID(all)} @
>sipgate calling ${EXTEN})
>exten => ${INCOMING1},2,SetCallerID(From SipGate <${CALLERID(num)}> )
>Exten => ${INCOMING1},2,Set(TRIES=0)
>Exten => ${INCOMING1},3,ringing(3)
>Exten => ${INCOMING1},4,background(priv-introsaved)
>Exten => ${INCOMING1},5,background(queue-thankyou)
>Exten => ${INCOMING1},n,Dial(SIP/121,10,r)
>Exten => ${INCOMING1},n,playback(vm-nobodyavail)
>Exten => ${INCOMING1},n,Dial(${GROUP},10,mr)
>Exten => ${INCOMING1},n,playback(tt-allbusy)
>Exten => ${INCOMING1},n,wait(2)
>Exten => ${INCOMING1},n,goto(${INCOMING1},7)
>;Exten => $& #123;INCOMING1},n,voicemail(u300@default
)
>Exten => ${INCOMING1},n,congestion
Er - interesting call-flow there 
You should Answer() the call at some point too, preferably before you
try to send audio back up the line (which ringing(3) will do) although
it should auto-answer the channel, I've found that it's always best to
do it explicitly.
If you start to use goto's, then you
really ought to start to use labels and the 'n' priority. Eg.
exten => 123,1,Answer()
exten => 123,n(loop),Playback(haha)
exten => 123,n,Wait(2)
exten => 123,n,Goto(loop)
It saves counting lines and re-numbering when you add/remove instructions.
Gordon
| |
|
| Gordon Henderson wrote:
> In article <f2e8ii$f3u$1$8300dec7@news.demon.co.uk>,
> Steve <user@mail.com> wrote:
>
>
> As you have externip= and localnet= settings above, you probably
> want nat=yes here. The box I cut & pasted that off isn't behind a NAT
> firewall/router.
>
> Remember to connect to asterisk and set verbose 9999 which will help
> you debug.
>
> asterisk -r
> set verbose 9999
>
> then call your sipgate number from another phone.
>
> And you can use sip show peers to make sure you're actually peering
> with Sipgate - if nothing else it'll make sure your register statement
> is working OK.
>
>
> Er - interesting call-flow there 
>
> You should Answer() the call at some point too, preferably before you
> try to send audio back up the line (which ringing(3) will do) although
> it should auto-answer the channel, I've found that it's always best to
> do it explicitly.
>
> If you start to use goto's, then you
> really ought to start to use labels and the 'n' priority. Eg.
>
> exten => 123,1,Answer()
> exten => 123,n(loop),Playback(haha)
> exten => 123,n,Wait(2)
> exten => 123,n,Goto(loop)
>
> It saves counting lines and re-numbering when you add/remove instructions.
>
> Gordon
Hi Gordon,
That's works now..
The probelm was modem router...
I placed the server on DMZ area, and everything is OK..
This is my main problem. I try yto be able to be connected from outsite
the house, and I can't connect...
Can you connect to your server from outside ?
If so, what Modem router do you have ??
THanks and regards,
Steve
| |
|
| Steve wrote:
> That's works now..
> The probelm was modem router...
> I placed the server on DMZ area, and everything is OK..
Do you have multiple public addresses? Or is it DMZ as in, forward all
unrelated inbound traffic to whatever's in the "DMZ"?
> This is my main problem. I try yto be able to be connected from outsite
> the house, and I can't connect...
>
> Can you connect to your server from outside ?
What do you mean by "connect"? Are you trying to make calls to your Sipgate
number? Register handsets over the internet to your Asterisk server? SSH to
your Asterisk server from over the internet?
> If so, what Modem router do you have ??
Hopefully it should Just Work if you've got it in the DMZ. If it's Asterisk
you're trying to debug, go to the Asterisk console with 'asterisk -rc', and
do a 'sip debug ip <IP address of remote handset>' and attempt to register
the handset. If it's linux in general you're trying debug connectivity
with, run 'iptraf' on the relevant interface and you'll be able to see
everything going in and out.
--
<http://ale.cx/> (AIM:troffasky) (UnSoEsNpEaTm@ale.cx)
17:37:40 up 18 days, 19:37, 2 users, load average: 0.38, 0.34, 0.30
09 f9 11 02 9d 74 e3 5b d8 41 56 c5 63 56 88 c0
| |
| Gordon Henderson 2007-05-17, 7:11 pm |
| In article <f2fiei$huk$1$830fa7a5@news.demon.co.uk>,
Steve <user@mail.com> wrote:
>Hi Gordon,
>
>That's works now..
>The probelm was modem router...
>I placed the server on DMZ area, and everything is OK..
>
>This is my main problem. I try yto be able to be connected from outsite
>the house, and I can't connect...
>
>Can you connect to your server from outside ?
>If so, what Modem router do you have ??
At home/office I have a Draytek 2600 and a Linux based router. I have a
small subnet routed to me from Zen, so I have a "real" DMZ which is where
my office asterisk box is, so remote connections are only a problem for
the remote NAT firewall.
However I have setup boxes for my clients (I sell asterisk based PBX
systems) which are on the inside of their router, and then I port-forward
5060 and 10000 through 20000 to the IP address of the server on the inside
then use the nat=yes and externip= and localnet= statements in sip.conf.
(Also port forward 4569 to the internal asterisk box as that's IAX which
I use to peer boxes together)
When connecting from the outside you may need a STUN sever which will
let the external device (phone/soft phone) work out how to navigate it's
NAT firewall.
Gordon
|
|
|
|
|