Pilmo

Using the Pilmo Gold service with Asterisk


In this example setup I'll describe two things:
- how to connect Asterisk to the Pilmo Gold service
- how to configure Asterisk and iptables to be able to use their locked Voicefinder ATA
I've personally combined the two to allow incoming calls from Pilmo, while using cheaper providers for my outgoing calls.

In the examples 192.168.1.3 is the Voicefinder and 192.168.1.2 is the Asterisk server.

sip.conf

[general]
context=default
port=38383
bindaddr=0.0.0.0
srvlookup=no
nat=no

;this registers with pilmo so we can receive calls
register => 31201234567:yourpilmopassord@sip.ritstele.com:38383

;allow incoming calls from pilmo
[212.26.192.155:38383]
type=user
insecure=yes
context=incoming
disallow=all
allow=g729
;allow incoming calls from pilmo2/bbned
[212.26.192.153:38383]
type=user
insecure=yes
context=incoming
disallow=all
allow=g729

;outgoing calls to pilmo
[pilmo]
type=peer
user=phone
usereqphone=yes
username=31201234567
secret=yourpilmopassword
insecure=yes
fromdomain=sip.ritstele.com
host=sip.ritstele.com
fromuser=31201234567
port=38383
disallow=all
allow=g729
dtmfmode=rfc2833

The above will let you use Asterisk with Pilmo. If you don't have a voip phone to use with Asterisk we'll have to do some magic to be able to use the Voicefinder.

Adding the section below to your sip.conf will allow the Voicefinder to register with Asterisk:

;let the voicefinder register with asterisk
[31201234567]
type=friend
secret=yourpilmopassword
defaultip=192.168.1.3
host=dynamic
dtmfmode=rfc2833
username=31201234567@sip.ritstele.com
disallow=all
allow=g729
nat=yes
canreinvite=no

The Voicefinder will try to connect to sip.ritstele.com. There are few ways to solve this. You could configure the Voicefinder to use a custom DNS server where you override the sip.ritstele.com hostname (make sure your Asterisk server can still find the real host).
In my setup I redirected the Voicefinder traffic using iptables:

  1. CATCH VOICEFINDER
/sbin/iptables -t nat -A PREROUTING -i eth1 -d 212.26.192.155 -j DNAT --to-destination 192.168.1.2
/sbin/iptables -t nat -A POSTROUTING -o eth1 -d 192.168.1.3 -j SNAT --to-source 212.26.192.155


Finally, the Voicefinder reformats the number you're dialing into international format. Keep this in mind when creating your dialplan. E.g. if you dial 1234567 the Voicefinder will tell Asterisk you're dialing 31201234567 (assuming you're Pilmo account is in areacode 020).

Using the Pilmo Gold service with Asterisk


In this example setup I'll describe two things:
- how to connect Asterisk to the Pilmo Gold service
- how to configure Asterisk and iptables to be able to use their locked Voicefinder ATA
I've personally combined the two to allow incoming calls from Pilmo, while using cheaper providers for my outgoing calls.

In the examples 192.168.1.3 is the Voicefinder and 192.168.1.2 is the Asterisk server.

sip.conf

[general]
context=default
port=38383
bindaddr=0.0.0.0
srvlookup=no
nat=no

;this registers with pilmo so we can receive calls
register => 31201234567:yourpilmopassord@sip.ritstele.com:38383

;allow incoming calls from pilmo
[212.26.192.155:38383]
type=user
insecure=yes
context=incoming
disallow=all
allow=g729
;allow incoming calls from pilmo2/bbned
[212.26.192.153:38383]
type=user
insecure=yes
context=incoming
disallow=all
allow=g729

;outgoing calls to pilmo
[pilmo]
type=peer
user=phone
usereqphone=yes
username=31201234567
secret=yourpilmopassword
insecure=yes
fromdomain=sip.ritstele.com
host=sip.ritstele.com
fromuser=31201234567
port=38383
disallow=all
allow=g729
dtmfmode=rfc2833

The above will let you use Asterisk with Pilmo. If you don't have a voip phone to use with Asterisk we'll have to do some magic to be able to use the Voicefinder.

Adding the section below to your sip.conf will allow the Voicefinder to register with Asterisk:

;let the voicefinder register with asterisk
[31201234567]
type=friend
secret=yourpilmopassword
defaultip=192.168.1.3
host=dynamic
dtmfmode=rfc2833
username=31201234567@sip.ritstele.com
disallow=all
allow=g729
nat=yes
canreinvite=no

The Voicefinder will try to connect to sip.ritstele.com. There are few ways to solve this. You could configure the Voicefinder to use a custom DNS server where you override the sip.ritstele.com hostname (make sure your Asterisk server can still find the real host).
In my setup I redirected the Voicefinder traffic using iptables:

  1. CATCH VOICEFINDER
/sbin/iptables -t nat -A PREROUTING -i eth1 -d 212.26.192.155 -j DNAT --to-destination 192.168.1.2
/sbin/iptables -t nat -A POSTROUTING -o eth1 -d 192.168.1.3 -j SNAT --to-source 212.26.192.155


Finally, the Voicefinder reformats the number you're dialing into international format. Keep this in mind when creating your dialplan. E.g. if you dial 1234567 the Voicefinder will tell Asterisk you're dialing 31201234567 (assuming you're Pilmo account is in areacode 020).

Created by: xnpu9977, Last modification: Wed 13 of Jul, 2005 (13:51 UTC)
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+