• Xmpp integration with Asterisk


    http://gnu-linux.org/xmpp-integration-with-asterisk.html

    Xmpp stands for eXtensible Messaging and Presence Protocol, Its a widely used communication protocol. In this blog I will use Openfire an opensource xmpp server.
    Asterisk is opensource telephony switching exchange service for linux. In this blog I am using FreePBX install on centos 6.5.
    In this blog I assume that user has already install openfire and asterisk server on linux machines. So I will start with creating a user in openfire and intregate my opefire server with asterisk server and in finally we will able to call from sip phone to xmpp client.

    Step 1: Creating user in xmpp server

    Login to openfire server. You will find the welcome screen as in image below and then click on user/session tab

    login

    Now provide the user information and click on create user as in image below.

    create

    Step 2: Starting Spark xmpp client

    Download spark client on your linux machine.

    wget http://www.igniterealtime.org/downloadServlet?filename=spark/spark_2_7_0.tar.gz

    untar the file and run spark executable file

    tar -xvzf spark_2_7_0.tar.gz
    cd spark*
    ./spark

    You will find the spark client starts as in image below.
    provide user id, password which you created in openfire server and give server ip.

    spark

    Now again go to your openfire server and click on session tab you will find status of the user online

    online

    Step 3:Enable SIP plugin to openfire

    Download the SIP jar file

    wget http://www.igniterealtime.org/projects/openfire/plugins/sip.jar

    click on Plugins tab and upload your sip.jar file. after some time you will find phone tab inside the server tab

    Note
    The plugin work with openfire version 3.9.3

    Step 4: Configure SIP user on asterisk
    Now we need to configure sip.conf and extension.conf file to switch the call between asterisk and xmpp client.

    sip configuration settings copy paste below code in your sip.conf, more detail about this you will find in asterisk configuration blog.

    [100]
    username=100
    type=friend
    secret=123
    record_out=never
    record_in=never
    qualify=no
    port=5060
    nat=never
    host=dynamic
    dtmfmode=rfc2833
    call-limit=4
    canreinivite=no
    disallow=all
    allow=all

    extension.conf configuration

    exten => 100,1,Dial(SIP/100,20)

    Now restart your asterisk server

    service asterisk restart

    The above settings allow sip client to established call to xmpp client which is spark.

    Step 5: Configure SIP phone on openfire

    On your openfire interface go to Phone tab and then click on add new phone mapping and provide the detail as in image below.

    SIP PHONE settings

    SIP PHONE settings

    XMPP username => user name of your openfire user.
    SIP username => user name on your asterisk server which we configure in sip.conf
    Authorization username => same as SIP username
    PASSWORD => password of your SIP user.
    SERVER => IP of asterisk server

    click on create and you will find the page as below.

    successful SIP mapping

    successful SIP mapping

    Now all the configuration is done, finally you have to login to your spark and sip phone.

    Step 6:
    Make a call from SIP phone

    I am using twinkle as my SIP phone now as a dial the extension number 100 which is of my xmpp client . I get a incoming call. check the image below

    incoming call from SIP phone

    incoming call from SIP phone

    In the image you will find a box saying incoming call from the SIP user.

    Once you accept the call it will get connected .

    call accepted

    call accepted

    So we successfully integrated XMPP (Openfire) with SIP (Asterisk).

    In easy 6 step we have done this.

  • 相关阅读:
    06Redis入门指南笔记(安全、通信协议、管理工具)
    05Redis入门指南笔记(持久化)
    04Redis入门指南笔记(内部编码规则简介)
    03Redis入门指南笔记(事务、生存时间、排序、消息通知、管道)
    02Redis入门指南笔记(基本数据类型)
    01Redis入门指南笔记(简介、安装、配置)
    Libev源码分析08:Libev中的内存扩容方法
    Error While Loading Shared Libraries, Cannot Open Shared Object File
    Libev源码分析08:Libev中的信号监视器
    接口开发之PHP创建XML文件
  • 原文地址:https://www.cnblogs.com/welhzh/p/4655029.html
Copyright © 2020-2023  润新知