JMP offers VoIP calling via XMPP, but it's also possibly to use the VoIP using SIP.

The underlying VoIP calling functionality in JMP is provided by Bandwidth, but their old Asterisk instructions didn't quite work for me. Here's how I set it up in my Asterisk server.

Get your SIP credentials

After signing up for JMP and setting it up in your favourite XMPP client, send the following message to the gateway contact:

reset sip account

In response, you will receive a message containing:

  • a numerical username
  • a password (e.g. three lowercase words separated by spaces)

Add SIP account to your Asterisk config

First of all, I added the following to my /etc/asterisk/pjsip.conf:

type = transport
protocol = udp
bind =
external_media_address =
external_signaling_address =
local_net =

type = registration
contact_user = 5554561000
transport = transport-udp
outbound_auth = jmp
client_uri =
server_uri =

type = auth
password = three secret words
username = 5554561000

type = aor
contact =

type = identify
endpoint = jmp
match =

type = endpoint
context = from-jmp
dtmf_mode = rfc4733
disallow = all
allow = ulaw
allow = g729
auth = jmp
outbound_auth = jmp
aors = jmp
rtp_symmetric = yes
rewrite_contact = yes
send_rpid = yes
timers = no

and for reference, here's the blurb for my Snom 300 SIP phone:

type = aor
max_contacts = 1

type = auth
username = 2000
password = password123

type = endpoint
context = full
dtmf_mode = rfc4733
disallow = all
allow = g722
allow = ulaw
mailboxes = 10@internal
auth = 2000
outbound_auth = 2000
aors = 2000

I checked that the registration was successful by running asterisk -r and then typing:

pjsip set logger on

before reloading the configuration using:


Create Asterisk extensions to send and receive calls

Once I got registration to work, I hooked this up with my other extensions so that I could send and receive calls using my JMP number.

In /etc/asterisk/extensions.conf, I added the following:

include => home
exten => s,1,Goto(2000,1)

where home is the context which includes my local SIP devices and 2000 is the extension I want to ring.

Then I added the following to enable calls to any destination within the North American Numbering Plan:

exten => _1NXXNXXXXXX,1,Set(CALLERID(all)=Francois Marier <username>)
exten => _1NXXNXXXXXX,n,Dial(PJSIP/${EXTEN}@jmp)
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Set(CALLERID(all)=Francois Marier <username>)
exten => _NXXNXXXXXX,n,Dial(PJSIP/1${EXTEN}@jmp)
exten => _NXXNXXXXXX,n,Hangup()

Here username is my bwsip numerical username. When calls are placed, this gets automatically swapped in by my real JMP phone number, but Bandwidth appears to require its users to use their username in there caller ID string.

For reference, here's the rest of my dialplan in /etc/asterisk/extensions.conf:


exten => _X.,1,Hangup(3)

exten => _X.,1,Hangup(3)

exten => _X.,1,Hangup(3)

include => home

include => internal
include => pstn-jmp
exten => 707,1,VoiceMailMain(10@internal)

exten => 2000,1,Dial(PJSIP/2000,20)
exten => 2000,n,Goto(in2000-${DIALSTATUS},1)
exten => 2000,n,Hangup
exten => in2000-BUSY,1,VoiceMail(10@internal,su)
exten => in2000-BUSY,n,Hangup
exten => in2000-CONGESTION,1,VoiceMail(10@internal,su)
exten => in2000-CONGESTION,n,Hangup
exten => in2000-CHANUNAVAIL,1,VoiceMail(10@internal,su)
exten => in2000-CHANUNAVAIL,n,Hangup
exten => in2000-NOANSWER,1,VoiceMail(10@internal,su)
exten => in2000-NOANSWER,n,Hangup
exten => _in2000-.,1,Hangup(16)


Finally, I opened a few ports in my firewall by putting the following in /etc/network/iptables.up.rules:

# SIP and RTP on UDP (
-A INPUT -s -p udp --dport 5008 -j ACCEPT
-A INPUT -s -p udp --dport 5008 -j ACCEPT
-A INPUT -s -p udp --sport 5004:5005 --dport 10001:20000 -j ACCEPT
-A INPUT -s -p udp --sport 5004:5005 --dport 10001:20000 -j ACCEPT