Quantcast
Channel: Computing For Geeks
Viewing all articles
Browse latest Browse all 78

Configuring Mapping between Openfire XMPP users and Asterisk SIP users

$
0
0
In this small guide, we'll try to Map sip users configured in Asterisk sip.conf file with XMPP users configured in Openfire XMPP server.If you're reading thus article,you'll need to have installed and configured Asterisk Server with Extensions.conf and sip.conf files working.I also assume that you've added xmpp users to your Openfire server. This tutorials can be of help if you're getting started.

How to install Asterisk PBX 13.x on CentOS 7 step by step guide

How to Integrate Openfire XMPP Chat Server with Asterisk PBX server

Once you've a list of users on both Openfire and Asterisk, you can start the mapping.
Prerequisites:
You must add sip and Asterisk IM plugins for Openfire.Do this on your Openfire server if you haven't.
cd /opt/openfire/plugins/
wget http://www.igniterealtime.org/projects/openfire/plugins/sip.jar
wget http://suse.mes.edu.cu/Utiles/Jabber/Openfire-3.8.x/Plugins/2013/asterisk-im.jar
Have extensions.conf,sip.conf files configured. See my files below. Extensions.conf file
[company]
exten=>_.,1,Dial(SIP/${EXTEN},10,r)
same=>n,VoiceMail(${EXTEN}@company-voicemail,u)
same=>n,VoiceMail(${EXTEN}@company-voicemail,b)
same=>n,Hangup()
Voicemail.conf
[company-voicemail]
101=>1234,mutai,geekxxx@gmail.com
102=>1234,denis,denisxxx4@gmail.com
103=>1234,gene,genexxx@gmail.com
;1234 : Password used to access voicemail Sip.conf
[101]
type=friend
secret=jose
username=jose
host=dynamic
context=company
disallow=all
allow=h264
allow=ulaw
qualify=yes
canreinvite=no
mailbox=101@company-voicemail
callerid=jose

[102]
type=friend
secret=denis
username=denis
host=dynamic
context=company
disallow=all
allow=ulaw
allow=h264
qualify=yes
canreinvite=no
mailbox=102@company-voicemail
callerid=denis
 [103]
type=friend
secret=gene
username=gene
host=dynamic
context=company
disallow=all
allow=ulaw
allow=h264
qualify=yes
canreinvite=no
mailbox=103@company-voicemail
callerid=denis
Openfire users 


 Now it's time to do the mapping. Head over to Server menu, then Phone, then Add new  XMPP username :  Openfire account username
SIP username : Username in Asterisk's sip.conf file
Authorization Username : Just same as SIP username
Display Phone Number :
Password : Sip user's password.
Server : Ip address of Asterisk Media server
Outbound Proxy : Sip proxy if any
Voice Mail Number: Number used to access voicemail.
Add all information above. If you want to add number to access voicemail, do it as shown below.
I will make *100 number dialed to access voicemail.
[voicemail]
exten => *100,1,NoOp(Access voicemail retrieval.)
same => n,VoiceMailMain(@company-voicemail)
Then include this context in the original context.It will look like this.
[company]
include =>voicemail
exten=>_.,1,Dial(SIP/${EXTEN},10,r)
same=>n,VoiceMail(${EXTEN}@company-voicemail,u)
same=>n,VoiceMail(${EXTEN}@company-voicemail,b)
same=>n,Hangup()
Now with all configurations completed. Download XMPP Client and configure it, i recommend any of the following:
Jitsi : Support Windows, Mac OS X and Linux
  1. Spark
  2. Zoiper
  3. Pidgi
  4. Psi
  5. Gajim
  6. Miranda
Android: Chatsecure, Conversations, Xabber, yaxim
iOS: ChatSecure
Web-based: Jappix
I will demonstrate on Adding account using Jitsi XMPP client. Install it on your platform, Linux,Windows, Mac,Android or iOS.
Launch Jitsi. Then click on File > Add new account, on Network select either XMPP or SIP. Add the two of them.


 From there you can easily place calls and chat using the platform you just created. Hope this article was of help to you. If you encounter any error, post it in Comment section and i won't hesistate to reply.

Viewing all articles
Browse latest Browse all 78

Trending Articles