View Single Post

  #4 (permalink)  
Old 16-05-2007, 08:58
Gordon Henderson
Guest
 
Posts: n/a
Default Re: Asterisk conf for Sipgate.co.uk

In article <f2e8ii$f3u$1$8300dec7@news.demon.co.uk>,
Steve <user@mail.com> wrote:
[color=blue]
>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[/color]

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.
[color=blue]
>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 => ${INCOMING1},n,voicemail(u300@default)
>Exten => ${INCOMING1},n,congestion[/color]

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
Reply With Quote