Working configuration for Jitsi/Jigasi with Asterisk/SIP

I know have a working configuration for Jitsi, Jigasi and Asterisk for DialIn with PINs. I had to scrape many different threads here and know that everything I thought it would be a good idea to collect everything in one post. Please feel free to comment, I’ll try to keep the top post updated.

I have everything running on a single Debian 10 server. Phone connectivity is provided by formerly sipgate and now easybell.

Create an endpoint for Jigasi in Asterisk:

[transport-jigasi]
type = transport
protocol = udp
bind = 127.0.0.1:5060

[jigasi_auth]
type = auth
auth_type = userpass
password = SUPERSECRET
username = jigasi

[jigasi]
type = aor
max_contacts = 1
remove_existing = yes

[jigasi]
type = endpoint
transport = transport-jigasi
context = jigasi-in
direct_media = no
disallow = all
allow = g722
allow = speex
allow = gsm
auth = jigasi_auth
aors = jigasi

Handle call and IVR in /etc/asterisk/extensions.conf

[easybell-in]
; exten => _X.,1,Dial(PJSIP/jigasi,,b(handler^addheader^2))
exten => _X.,1,Playback(hello)
exten => _X.,n,Playback(conf-getconfno)
exten => _X.,n(getmeeting),Read(PIN,beep,12)
exten => _X.,n,Verbose(Result is: ${PIN})
exten => _X.,n,AGI(conferenceMapper.sh,${PIN})
exten => _X.,n,Verbose(Result is: ${ROOM})
exten => _X.,n,GotoIf($[ "${ROOM}" == "false" ]?invalidnum:joinmeeting)
exten => _X.,n(invalidnum),Playback(conf-invalid)
exten => _X.,n,Goto(getmeeting)
exten => _X.,n(joinmeeting),Playback(conf-placeintoconf)
exten => _X.,n,Dial(PJSIP/jigasi,,b(sub-headers^caller_handler^1(${ROOM},${PIN})))

[sub-headers]
exten => caller_handler,1,NoOp(Set Header Jitsi-Conference-Room: ${ARG1} -Pass: ${ARG2})
same => n,GotoIf($[${LEN(${ARG1})} == 0]? 5)
same => n,Set(PJSIP_HEADER(add,Jitsi-Conference-Room)=${ARG1})
same => n,Set(PJSIP_HEADER(add,X-Room-Name)=${ARG1})
same => 5,GotoIf($[${LEN(${ARG2})} != 0]? 10)
same => n,Return()
same => 10,Set(PJSIP_HEADER(add,Jitsi-Conference-Room-Pass)=${ARG2})
same => n,Return()

For /usr/share/asterisk/agi-bin/conferenceMapper.sh

#!/bin/bash

jitsi_room=$(curl --silent https://jitsi-api.jitsi.net/conferenceMapper?id=$1 | cut -d \, -f 3 | cut -d \: -f 2 | cut -d \" -f 2 | cut -d \@ -f 1 | cut -d \} -f 1)
echo "SET VARIABLE ROOM \"${jitsi_room}\" "

Specify DialIn numbers and config in /etc/jitsi/meet/meet.example.com-config.js

// To enable sending statistics to callstats.io you must provide the
// Application ID and Secret.
// callStatsID: '',
// callStatsSecret: '',

// DiaIn Numbers and Codes
dialInNumbersUrl: 'https://meet.example.com/dialin.json',
dialInConfCodeUrl: 'https://jitsi-api.jitsi.net/conferenceMapper',

Add alias for dialin.json to your Apache2 webserver:

Alias "/dialin.json" "/etc/jitsi/meet/dialin.json"
<Location /dialin.json>
  Require all granted
</Location>

And place dialin.json in /etc/jitsi/meet/dialin.json

{"message":"DialIn numbers:","numbers":{"DE": ["+49-xxx-xxxx-xxxx"]},"numbersEnabled":true}

Configure Jigasi in /etc/jitsi/jigasi/sip-communicator.properties and don’t forget to encode the passwords to base64 with echo -n SUPERSECRET | base64:

net.java.sip.communicator.impl.protocol.SingleCallInProgressPolicy.enabled=false
net.java.sip.communicator.impl.neomedia.codec.audio.opus.encoder.COMPLEXITY=10
net.java.sip.communicator.packetlogging.PACKET_LOGGING_ENABLED=true
net.java.sip.communicator.impl.protocol.sip.SKIP_REINVITE_ON_FOCUS_CHANGE_PROP=true

net.java.sip.communicator.impl.protocol.sip.acc1=acc1
net.java.sip.communicator.impl.protocol.sip.acc1.PREFERRED_TRANSPORT=UDP
net.java.sip.communicator.impl.protocol.sip.acc1.ACCOUNT_UID=SIP\:jigasi@127.0.0.1
net.java.sip.communicator.impl.protocol.sip.acc1.PASSWORD=U1VQRVJTRUNSRVQ=
net.java.sip.communicator.impl.protocol.sip.acc1.PROTOCOL_NAME=SIP
net.java.sip.communicator.impl.protocol.sip.acc1.SERVER_ADDRESS=127.0.0.1
net.java.sip.communicator.impl.protocol.sip.acc1.USER_ID=jigasi
net.java.sip.communicator.impl.protocol.sip.acc1.KEEP_ALIVE_INTERVAL=25
net.java.sip.communicator.impl.protocol.sip.acc1.KEEP_ALIVE_METHOD=OPTIONS
net.java.sip.communicator.impl.protocol.sip.acc1.VOICEMAIL_ENABLED=false
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.AMR-WB/16000=750
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.G722/8000=700
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.GSM/8000=1
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.H263-1998/90000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.H264/90000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.PCMA/8000=600
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.PCMU/8000=650
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.SILK/12000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.SILK/16000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.SILK/24000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.SILK/8000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.VP8/90000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.iLBC/8000=10
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.opus/48000=1000
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.red/90000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.speex/16000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.speex/32000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.speex/8000=0
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.telephone-event/8000=1
net.java.sip.communicator.impl.protocol.sip.acc1.Encodings.ulpfec/90000=0
net.java.sip.communicator.impl.protocol.sip.acc1.OVERRIDE_ENCODINGS=true
net.java.sip.communicator.impl.protocol.sip.acc1.DEFAULT_ENCRYPTION=false

net.java.sip.communicator.impl.protocol.sip.acc1.DOMAIN_BASE=meet.example.com

org.jitsi.jigasi.xmpp.acc.IS_SERVER_OVERRIDDEN=true
org.jitsi.jigasi.xmpp.acc.SERVER_ADDRESS=127.0.0.1
org.jitsi.jigasi.xmpp.acc.VIDEO_CALLING_DISABLED=true
org.jitsi.jigasi.xmpp.acc.JINGLE_NODES_ENABLED=false
org.jitsi.jigasi.xmpp.acc.IM_DISABLED=true
org.jitsi.jigasi.xmpp.acc.SERVER_STORED_INFO_DISABLED=true
org.jitsi.jigasi.xmpp.acc.IS_FILE_TRANSFER_DISABLED=true

net.java.sip.communicator.service.gui.ALWAYS_TRUST_MODE_ENABLED=true

Host:

Linux meet.example.com 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1+deb10u1 (2020-04-27) x86_64 GNU/Linux

Versions:

jitsi-meet/stable,now 2.0.4548-1
jigasi/stable,now 1.1-107-g6928850-1
asterisk/stable,now 1:16.2.1~dfsg-1+deb10u1

Credits to:

2 Likes

Thanks for all this information. I feel like I can get this working on my Kerio Operator setup with just a little help. Kerio Operator is basically Asterisk with a custom GUI and as such, I have little experience editing Asterisk files directly. Would you be able to answer a couple of questions?

  1. In regards to the first part (where you’re creating the endpoint for Jigasi), what file is the placed in?
  2. For the extensions.conf file IVR stuff, should I be creating a new section or should I be putting this under my existing SIP provider section?

This will get me started to at least test it out.

thanks!
88