Sipgate - asterisk configuration problems

Has anyone got a sipgate account working with asterisk? I’ve got other SIP and IAX2 accounts working fine, but never had any success with getting asterisk to work with sipgate. Sipgate themselves haven’t been much help either.

And the error message i get from sipgate when i try and call out through them is worse than useless. It says “An error has occurred, please try again!” or the equivalent (i think) in German, if i use different CID settings (although i’ve lost track of which does what now).

I can call their test number and it works fine, but making calls to the PSTN doesn’t work. I’ve got credit on my account and my enquiries to sipgate haven’t got any responses that indicate it’s anything other than my local configuration that’s the problem.

Have a look at my posting.
There you can see my running config (sip.conf, extensions.conf). You only have to change the sip.conf as i mentioned in my last post.

Thanks for that. I’ve had a look at it and, as far as i can see, the fundamentals of mine are the same - unless i’ve misunderstood some things about sip.conf, anyway, and i have got other sip accounts working, so i don’t think that’s it. But it still doesn’t work.

One difference between yours and mine, though, is that yours is, whereas my account is on - and there’s no guarantee that they’re both set up the same way.

Has anyone got outgoing calls from asterisk to working succesfully?

I have an account on and have it working successfully. My setup is fundmentally the same as GahnM, but in sip.conf I’ve found you don’t need the [2762720] section at all, just comment this entire section out and it doesn’t seem to make any difference.

The only other issues I had were with setting up my Firewall to allow the appropriate ports in, once that was sorted everything worked OK. Althought I do get some weird messages on the * console “200 OK is not a Registry message”.

Thanks for the responses!

It looks like my setup should work and there’s probably something wrong at Sipgate (I’ve been suspecting this for a while now). But convincing them of that isn’t likely to be easy! :confused:

It might be worthwhile you posting your sip.conf and extensions.conf. Sometimes another pair of eyes can spot something you’ve missed. I’ve been struggling for 4 weeks to get * working to my satisfaction and finally cracked it this weekend.

Like most new concepts, the * config files take quite some effort to understand and configure successfully. I feel I’ve finally broken the back of all my issues and am now in a position to help out other people.

Ok, here’s the relevant bits of my sip.conf:


register =>


fromuser=9999999 ; fromuser overrides CallerId setting in extensions.conf

And this is the relevant parts of my extensions.conf:


exten => _5.,1,Dial(SIP/${EXTEN:1},60,tT)
exten => _5.,2,Hangup

This is just the current version that doesn’t work. Mainly as a result of the last communication i got form sipgate about this (that i might need to put my caller id in somewhere or something…), i’ve tried lots of different configurations here, including using SetCallerId, SetCDRUserField, SetCIDName, SetCIDNum, SetAccount - none of which make much difference.

The only thing i have found makes a difference to what happens is changing the CallerId to either my account number or phone number (can’t remember which now) - then i get the “An error has occurred…” announcement in German, instead of in English!

I should point out again that calling Sipgate’s test number works. Incoming calls from Sipgate also work, as do outgoing calls through other SIP services in Europe (Gossiptel and Voipgate).

Here is my configuration that works with SipGate, there are some slight differences. I think the most significant are the absence of an “authuser” entry in your sip.conf and you have “type=friend” whereas mine is “type=peer”.

externip = xx.xx.xx.xx ;I have fixed external IP so defined here.
localnet= ;Note no localnet for loopback

register =>

nat=yes ;my * is behind a NAT router

exten => _23X.,1,Dial(SIP/${EXTEN:2}@to_sipgate,60,rtT)
exten => _23X.,2,Hangup

exten => 9999999,1,Answer
exten => 9999999,2,Dial(SIP/ChrisMacneill,60,tT) ;This isn’t my real entry here, this will suffice for test purposes. I have a Macro that does some checking for busy and diverts to VoiceMail.

Yeah, “authuser” has been included in some of the dozens of permutations i’ve tried. It didn’t make any difference! It’s currently commented out in my sip.conf, so i didn’t bother including it in my last post here

And as far as the difference between “friend” and “peer” goes, that shouldn’t make any difference. As i understand it, a friend is a peer as well as well as being a user - in other words it’s a server that we both receive incoming calls from and make outgoing calls to. Anyway, it works fine for the other SIP services i use.

As you say, the differences between our two sip.conf files are only slight. I’ve been wracking my brains over this, on and off, for months now (through 3 different computer systems, two different ADSL connections, on two completely opposite sides of the planet!) and i just don’t seem to be getting anywhere. I’m kinda used to that, in a way, as you get those sorts of problems with system and network admin from time to time, but this one’s getting a bit silly.

If i could get any sense out of sipgate about what their system means when it tells me “An error has occurred, please try again”, it would help.

I may have to try emailing them again and try and convince them to thoroughly check my account and see if they can tell me what their end thinks is happening…

Thanks for you help, anyway, mate!

Turns out cmacneill has the answer. Look at his register in sip.conf. The trick is that the sip-id has to be appended as the local extension.

I had the same problem with, incoming calls are fine, outgoing calls to the test number and email (50000) are fine, but for pay calls to the pstn failed.

I emailed them, and they said: “Your asterisk setup is wrong, it has an ‘s’ in place of your sip-id.”

If you read the comment about register in sip.conf you will see that the extension used for incoming calls is ‘s’, if not explicitly given with “/xxxxxxx”. What effect that has on outgoing calls I don’t know, but after putting my sip-id as the extension, then fixing the sipgate-incoming context to use 'exten => sip-id,1,…“
instead of 'exten => s,1,…”: it works!

This is really not intuitive.

Hope this helps.

Strewth! Too right it’s not intuitive!!! But it works!

That’s a feature that i haven’t seen documented anywhere. As far as i could tell, the extension number on the register statement was only used for routing incoming calls to the right extension locally. But it looks like it’s passed with the register request to the SIP server at the other end as well. I wonder why…

I wonder what the server on the other SIP account i use (gossiptel) makes of the extension number i’m sending it. It doesn’t seem to affect it at all.

Thanks very much for your help. That’s put an end to months of puzzlement!


another newbie question

I set up * all ok. got a couple of softphones working and voicemail etc.

Now i want to config my sipgate account.

I undersatnd all the the details in sip.conf, could someone give me a brief description of the relationship with extensions.conf for making calls.

Whats this line do? specifically the _23x bit and the exten:2.

[quote]exten => _23X.,1,Dial(SIP/${EXTEN:2}@to_sipgate,60,rtT)
exten => _23X.,2,Hangup[/quote]


_23X means match on all numbers starting with 23 and ${EXTEN:2} is a macro which strips the first two digits off before forwarding the rest of the number. Search through extensions.conf and you’ll find the EXTEN macro defined somewhere.

So if you dial 2312125551212, 12125551212 gets sent to SipGate.

This is done to allow different routing codes to different SIP Gateways. It’s easier to use a routing code for Gateways so that the standard trunk routing can be left intact in case you want to interface to a POTS line at some stage.

so a user would prefix their number with 23 to get an “outside line” in this case then?

How does this integrate with “least cost routing”?

How would you set this if you didnt want the user to enter a prefix?

or do you have to say

“if number dialled begins with 0 (ie an external number with dial code on) 0845, 0207 etc then goto sipgate”

I have an ISDN card in my * to provide a standard connection for local calls and incoming calls to my standard BT numbers.

I haven’t played around with least cost routing yet, I currently do it manually by dialling 23 for International calls or other SIP phones and just the number without the prefix if I want it to be routed over the local connection. I’ll probably get around to LCR eventually, but it’s not a priority for me at the moment.

If you want to integrate SipGate with the standard routing features, you’ll have to tweak the Dial commands in the International and Long Distance sections of extensions.conf. I’ll post sections of my extensions.conf later, I don’t have time right now.

I have three different SIP Gateways configured in my system, hence this is why I’m using a routing code to select the different gateways. When I have time I’ll setup LCR to select the appropriate Gateway automatically. I’m still evaluating which Gateway gives the best service.


thanks for all you help.

my * book from signate just arrived this morning so Im expecting this will answer a lot of my queries.

Id be interested to see you .confs.

Im a bit shaky on the more complex relationships between extensions.conf and sip.conf.

My FXO card will be here soon aswell, so expect even more questions :open_mouth:

[quote=“spoonz”]How does this integrate with “least cost routing”?

How would you set this if you didnt want the user to enter a prefix? [/quote]

I’ve got accounts with 3 ITSPs in Europe and 3 in Australia. This is how i deal with routing according to the number called - it’s not really complete, but it works for the numbers i call at the moment and i’ll modify it as i need to.

Extract from extensions.conf:

; ***** OUTSIDE LINES *****

; we’ll put the dialout capable extensions into a separate context, only
; available from internal phones

; ******
; ****** call routing according to destination ******
; ******

include => atp-local ; numbers local to atp’s POPs
include => aus-regional ; all numbers that don’t match above

; UK
exten => _+44.,1,Dial(SIP/0${EXTEN:3}@sipgate-020)
; Luxembourg
exten => _+352.,1,Dial(IAX2/xxxxxxx:@voipgate/${EXTEN:1})
; Spain
exten => _+34.,1,Dial(IAX2/xxxxxxx:@voipgate/${EXTEN:1})
; Ireland
exten => _+353.,1,Dial(IAX2/xxxxxxx:@voipgate/${EXTEN:1})
; France
exten => _+33.,1,Dial(IAX2/xxxxxxx:@voipgate/${EXTEN:1})

; *** call routing via specific service provider ***

exten => _151.,1,Dial(IAX2/xxxx:@ATP/${EXTEN:3})
exten => _151.,2,Hangup

exten => _152.,1,Dial(IAX2/xxxxxxxxx@freshtel/${EXTEN:3})
exten => _152.,2,Hangup

exten => _153.,1,Dial(IAX2/xxxxxxx:@voipgate/${EXTEN:3})
exten => _153.,2,Hangup

exten => _154.,1,Answer
exten => _154.,2,Ringing
exten => _154.,3,Dial(SIP/${EXTEN:3}@gossiptel,)
exten => _154.,4,Hangup

exten => _155.,1,Dial(SIP/${EXTEN:3}@sipgate-020)
exten => _155.,2,Hangup

; SIPGATE 01621
exten => _156.,1,Dial(SIP/${EXTEN:3}@sipgate-01621)
exten => _156.,2,Hangup

exten => _157.,1,Dial(SIP/${EXTEN:3}@oztel)
exten => _157.,2,Hangup

; numbers that are local calls from ATP
; sydney
exten => _02[89].,1,Dial(IAX2/xxxx:@ATP/${EXTEN})
exten => _+612[89].,1,Dial(IAX2/xxxx:@ATP/0${EXTEN:3})
; melbourne
exten => _03[89].,1,Dial(IAX2/xxxx:@ATP/${EXTEN})
exten => _+613[89].,1,Dial(IAX2/xxxx:@ATP/0${EXTEN:3})
; brisbane
exten => _073.,1,Dial(IAX2/xxxx:@ATP/${EXTEN})
exten => _+617.,1,Dial(IAX2/xxxx:@ATP/0${EXTEN:3})
; adelaide
exten => _089[234].,1,Dial(IAX2/xxxx:@ATP/${EXTEN})
exten => _+6189[234].,1,Dial(IAX2/xxxx:@ATP/0${EXTEN:3})
; perth
exten => _08[78].,1,Dial(IAX2/xxxx:@ATP/${EXTEN})
exten => _+618[78].,1,Dial(IAX2/xxxx:@ATP/0${EXTEN:3})

; what to do with numbers that don’t come into the ATP local number ranges
; - call via freshtel
exten => _0.,1,Dial(IAX2/xxxxxxxx@freshtel/${EXTEN})
exten => _+61.,1,Dial(IAX2/xxxxxxxx@freshtel/0${EXTEN:3})


Calls to Australian capital cities are cheaper via ATP, but calls to regional phone numbers are cheaper via Freshtel

I use the (GSM) mobile phone style “+44…” notation for international numbers. I don’t use them for Aus numbers, but i included them in case i work out a way to synchronise the phonebook in my softphone with the phonebook in my mobile! :wink:

The “include” statements bring in the contexts that they refer to at the point in the flow where the statement is - so the australian contexts are checked for matches before the rest.

Voipgate uses the bare country code prefix format - e.g. 442071234567, but Sipgate uses the British style dialling format - e.g., 02071234567. If i was dialling an international call via Sipgate, i suppose i’d have to enter something like +44034612345678 - which doesn’t make much sense! Alternatively, i could enter 1560034612345678 - which is one more digit, but makes more sense!

I don’t (yet) do automatic routing via Oztell - as i’ve only recently opened the account with them. They may replace some (or all) of the rest - or they may not - depending on how their service shapes up.