Asterisk How to connect to Nikotel

From the Asterisk Mailing list:


register=username:password@calamar0.nikotel.com/#your_extension#

[nikotel]
type=friend
host=calamar0.nikotel.com
username=##username##
secret=*******
fromuser=##username##
fromdomain=nikotel.com
qualify=yes
context=nikotel-inbound
insecure=very ; required if you want to accept incoming Nikotel calls from host
promiscredir=yes ; required to handle the Nikotel 302 redirect message

Use the above example, the one below didn't work for me, and neither did the FAQ at nikotel.


Approach 2 (alternative)

sip.conf

; registration is only required if you want to be called through Nikotel
register=##username##:*password*@calamar0.nikotel.com

[nikotel-incoming]
; only for incomings call via nikotel
context=from-nikotel
type=user (???)
host=calamar0.nikotel.com
insecure=very
promiscredir=yes ; required to handle the Nikotel 302 redirect message

[nikotel-out]
; for outgoing calls only
type=peer ; use with "Dial(SIP/${EXTEN}@nikotel-out)"
auth=md5
username=##username##
fromuser=##username## ; IMPORTANT! Nikotel requires this!
host=calamar0.nikotel.com
disallow=all
allow=gsm ; Nikotel supports g.729 (?), g.711 (ulaw/alaw) and GSM, but not iLBC

extensions.conf

[nikotel-dialout]
include => parkedcalls
include => default

; Dialing a PSTN numuber (creates costs!)
exten => _00X.,1,SetAccount(billing-username)
exten => _00X.,2,Dial(SIP/${EXTEN:2}@nikotel-out,90)
exten => _00X.,3,Hangup
exten => _00X.,103,Congestion
;
; Dialing a Nikotel VoIP number (no costs)
Problem
Nikotel answers with a "temporary moved" msg, but Asterisk (on purpose) doesn't
; automatically follow this redirection method. Instead Asterisk looks in its own
; dialplan to learn how to proceed
exten => _99XXXXXXXXXX,1,Dial(SIP/${EXTEN}@nikotel-out-phil,90)
exten => _99XXXXXXXXXX,2,Hangup
exten => _99XXXXXXXXXX,102,Congestion
;
; special extension for Joe (99xxxxxxxxxx@nikotel)
exten => 991234,1,Dial(SIP/joesmith@nikotel-out)
exten => 991234,2,Congestion


Approach 3

Nov. 05 with Asterisk v1.2.0

[nikotel-incoming]
; Nikotel peer to handle an incoming call; not for 302 redirect
context=from-sip
type=peer
host=calamar0.nikotel.com
promiscredir=yes

[63.214.186.6]
; Nikotel IP for host calamar0 as used in 302 "Moved Temporarily" SIP message
context=from-sip
type=peer
host=63.214.186.6
promiscredir=yes
secret=NikotelPassword
username=NikotelUsername
fromuser=NikotelUsername
fromdomain=nikotel.com

[nikotel-out-myuser]
for Nikotel user 112233 - for outgoing calls like
Dial(SIP/991234567890@nikotel-out-myuser,20,rtT)
context=from-sip
type=peer ; we don't have NikoTalk, so we cannot be called
secret=NikotelPassword
username=NikotelUsername
fromuser=NikotelUsername ; IMPORTANT! Nikotel requires this!
fromdomain=nikotel.com
host=calamar0.nikotel.com
disallow=all
allow=gsm
;allow=ilbc

If you DON'T want to use promiscredir=yes, THEN you'll need to modify your extensions.conf and enter all extensions that Nikotel will redirect you to. This must then not only include the number-to-username match, but also the (optional) username-to-mailboxnumber match. Note that without promiscredir you have better control over the Nikotel credentials for the outgoing call, i.e. you can chose either @nikotel-out-userA or @nikotel-out-userB etc. Note that Nikotel does not accept unauthenticated SIP calls, however it does have peering agreements with GMX, sipsnip, FWD and a few others.

[from-sip]
...
; == treating re-directed (=initially outgoing) Nikotel VoIP calls
; See the "302 Moved temporarily" msg from Nikotel
exten => nikouser1,1,Dial(SIP/${EXTEN}@nikotel-out-myuser)
exten => nikouser1,2,HangUp
exten => nikouser2,1,Dial(SIP/${EXTEN}@nikotel-out-otheruser)
exten => nikouser2,2,HangUp
; == Nikotel mailbox forwarding ==
Mailbox for user Xyz
SIP/4225xxxxxxxxxx@63.214.186.6
exten => _4225XXXXXXXXXX,1,Dial(SIP/${EXTEN}@nikotel-out-myuser)
exten => _4225XXXXXXXXXX,2,HangUp

And finally here's a sample CLI output of such a double 302 redirect where we dial the Nikotel number, get redirected to the username, and then finally to the user's mailbox at Nikotel (pattern 4225XXXXXXXXXX):

— Executing Dial("SIP/myuser-a26c", "SIP/991234567890@nikotel-out-myuser|90") in new stack
— Called 991234567890@nikotel-out-myuser
— Got SIP response 302 "Moved Temporarily" back from 63.214.186.6
— Now forwarding SIP/myuser-a26c to 'SIP/otheruser@63.214.186.6:5060' (thanks to SIP/nikotel-out-myuser-74b8)
— Got SIP response 302 "Moved Temporarily" back from 63.214.186.6
— Now forwarding SIP/myuser-a26c to 'SIP/42256102123456@63.214.186.6:5060' (thanks to SIP/63.214.186.6:5060-36d2)


The official Nikotel * config is located at, however that is faulty (Nov '05):
Direct FAQ link

Update 07/24/2004 :
Still these instructions don't work, since Nikotel uses a SIP 302 Redirect feature, if you call internal 99XXXXXXXXXX numbers. Nikotel will redirect you to your account (your username you had choosen at registration).

Asterisk now can play with SIP 302 redirect, thus works with Nikotel.
Add this to your sip.conf (in Nikotel peer section for outbound calls)

promiscredir=yes

Use CVS Head 07/18/2004 (the bug is fixed now).
Asterisk + Junghanns Chan_capi 0.3.4a : use just the latest CVS Head, at least 07/18/2004
Asterisk + ZAPHFC aka bristuff : use 0.1.0 RC2 with CVS Head sources from 07/22/2004
NOTE: RC1 with 07/14/2004 Asterisk CVS Head Sources DO NOT WORK with Nikotel redirect.

Asterisk Stable Version (e.g bristuff 0.0.2) :
There is one bug fix for sip redirect, major rtp code changes, added code to make Asterisk work with promiscious redirect (thanks Mark!) in latest CVS Head sources.
So probably even you spend hours merging patches into stable version, you won't be able to get it running (Keep me up to date, if you do! :) ).

I have only tested with latest Asterisk CVS HEAD!

Thanks Mark!, it was a long night at Saturday 07/17/2004 and I could not send as much money last year as originally expected.
As soon as I had seen Mark's code integration of promiscious redirect into chan_sip.c, app_dial.c, I was really entusiastic to get it finally working.
Personally it took me at least 2 weeks to get a clue what that redirect problem is about.
Please honour Digiums work, if you decide to make use of it.
Of course you can say "Hello" to me too, if you like to (I always love to practice my English conversation skills) :)

And always remember:
Digium + Asterisk rocks!

Greetings from Germany, an Asterisk + Java J2EE enthusiastic IT-Consultant.

Blackvel

UPDATE 07/24/2004
You may have to add to sip.conf a new peer section [calamar0.nikotel.com] or just Nikotel gateway ip [63.214.186.6].
I use both with same settings fromdomain, promiscredir=yes, etc. as in [nikotel.de] or more in your case [nikotel-out].

Another update
Also don't worry, my first test trying to redirect Asterisk callee from a SIP client (SJPhone) to a handy number with SIP 302 Moved temporarily
showed us the following result:
1. Asterisk is being redirected from 99-number to username@nikotel
2. Asterisk will get a new 302 SIP reply and will be forwarded to to sip:<local IP of SJPhone PC>
3. Asterisk is being redirected from sip:<local IP of SJPhone PC> to local extension sip:49<handy nr.>

Asterisk does NOT try to contact 49<handy nr.>@nikotel which would mean YOU would have to pay for being redirected to 0190 or any other PSTN number.
Instead Asterisk follows the behavior for searching the extension in it's local dial plan (LOCAL/) as before as we never would have set promiscredir=yes.

This is the case, because the SIP client directly tries to forward (redirect comes from different IP) and not Nikotel.
And since promiscredir is pinned to Nikotel (IP), only Nikotel can redirect you. But Nikotel does NOT redirect you to any PSTN number.

Blackvel

UPDATE 07/29/2004
You sould get bristuff 0.1.0RC2i, if you want a HFC card working together with Nikotel. It seems that the latest zaphfc RC2i has fixed now one major audio bug (thanks to Kapejod@Junghanns)

About promiscredir - UPDATE 05/25/2005
Something useful to know is that when promiscredir=yes, then Asterisk reads the the contact header information in the "302 Temporarily Moved" SIP PDU and then tries to create a SIP Channel and dial that URI. So if the contact header in the "302 Temporarily moved" reads sip:920121@A.B.C.D, Asterisk will try to Dial SIP/920121@A.B.C.D
If promiscredir=no, then the information in the contact header is treated as a local extension and dialed out as per the local dial plan.


See also



Go back to Asterisk tips and tricks

Created by: jht2, Last modification: Thu 14 of Jun, 2012 (19:40 UTC) by admin


Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+

Page Changes | Comments

 

Featured -

Search: