Skip to content

Commit

Permalink
Merge pull request #198 from dOpensource/dev
Browse files Browse the repository at this point in the history
Merge Documentation Changes
  • Loading branch information
devopsec committed Jul 3, 2019
2 parents fd2fd06 + b6ec19a commit bc9e4f7
Show file tree
Hide file tree
Showing 65 changed files with 1,652 additions and 1,554 deletions.
2,474 changes: 1,304 additions & 1,170 deletions CHANGELOG.md

Large diffs are not rendered by default.

110 changes: 90 additions & 20 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -1,58 +1,128 @@
API
===

+----------+----------------+---------------------------------------------------+
| METHODS | FUNCTIONS | ENDPOINTS THEY SUPPORT |
+==========+================+===================================================+
| PUT | Update existing| - /api/v1/endpoint/lease/<int:leaseid>/revoke |
| | information at | - /api/v1/inboundmapping |
| | endpoint | |
+----------+----------------+---------------------------------------------------+
| GET | Get Information| - /api/v1/kamailio/stats/ |
| | from Endpoint | - /api/v1/endpoint/lease/ |
| | | - /api/v1/kamailio/reload/ |
| | | - /api/v1/inboundmapping |
+----------+----------------+---------------------------------------------------+
| POST | Create new | - /api/v1/endpoint/<int:id>/api/v1/inboundmapping |
| | information at | |
| | endpoint | |
+----------+----------------+---------------------------------------------------+
| DELETE | Delete | - /api/v1/inboundmapping |
| | information at | |
| | endpoint | |
+----------+----------------+---------------------------------------------------+

The steps to obtain the API Token key and using the different curl commands are listen below.

Note: Make sure to to ssh into your serve to run these commands.
Note: Make sure to to login to your instance via ssh.

Getting Your Token
^^^^^^^^^^^^^^^^^^

::
.. code-block:: bash
DSIP_TOKEN=$(cat /opt/dsiprouter/gui/settings.py | grep API_TOKEN | cut -d "'" -f 2)
cat /opt/dsiprouter/gui/settings.py | grep API_TOKEN
|
Executing Kamailio stats API
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

::

.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN"
-X GET http://<addressOfYourInstance>:5000/api/v1/kamailio/stats
|
curl -H "Authorization: Bearer $DSIP_TOKEN"
-X GET http://demo.dsiprouter.org:5000/api/v1/kamailio/stats
One Line Version:
::

.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN" -X GET http://<addressOfYourInstance>:5000/api/v1/kamailio/stats
|
Executing Lease Point API
^^^^^^^^^^^^^^^^^^^^^^^^^
Getting the endlease
::


.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json"
-X GET "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org"
|
One Line Version:
::

.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X GET "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org"
|
Revoking and replacing with your own lease ID

::
.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json"
-X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/<leaseid>/revoke"
|
-X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/1/revoke"
One Line Version:
::

curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/<leaseid>/revoke"
|
.. code-block:: bash
curl -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "http://demo.dsiprouter.org:5000/api/v1/endpoint/lease/1/revoke"
Inbound Mapping Valid commands
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

--------------------------
GET /api/v1/inboundmapping
--------------------------

.. code-block:: bash
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping"
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3"
curl -X GET -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313"
---------------------------
POST /api/v1/inboundmapping
---------------------------

.. code-block:: bash
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "1313", "servers": ["66","67"], "notes": "1313 DID Mapping"}'
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "1313","servers": ["66","67"]}'
curl -X POST -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping" -d '{"did": "", "servers": ["66"], "notes": "Default DID Mapping"}'
---------------------------
PUT /api/v1/inboundmapping
---------------------------

.. code-block:: bash
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3" -d '{"did": "01234", "notes": "01234 DID Mapping"}'
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" -d '{"servers": ["67"]}'
curl -X PUT -H "Authorization: Bearer ${token}" --connect-timeout 3 -H "Content-Type: application/json" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313" -d '{"did": "01234", "notes": "01234 DID Mapping"}'
-------------------------------
DELETE /api/v1/inboundmapping
-------------------------------

.. code-block:: bash
curl -X DELETE -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?ruleid=3"
curl -X DELETE -H "Authorization: Bearer ${token}" "http://demo.dsiprouter.org:5000/api/v1/inboundmapping?did=1313"
File renamed without changes
19 changes: 9 additions & 10 deletions docs/carrier_groups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ Adding a Carrier
- Log into dSIPRouter using proper username and password.

- Click "Add" to create a Carrier Group. A carrier group can contain 1 or more SIP endpoints provided by the carrier. A SIP Endpoint represents a device that makes or receives calls via your Gateway. This could be a physical IP phone, a softphone app such as Skype, on a PC or smartphone, an Analog Telephone Adapter (ATA) such as for fax machines, or even a PBX system.
Select Username/Password Auth, fill in the username, password of your registration server and the registration server name. Then click ADD.


- Select Username/Password Auth, fill in the username, password of your registration server and the registration server name. Then click ADD.


.. image:: images/add_carrier_group.png
Expand All @@ -27,58 +26,58 @@ Select Username/Password Auth, fill in the username, password of your registrati
NOTE: Click IP authenication to use only the IP address of your PBX/endpoint.


.. image:: images/IP_authenication.PNG
.. image:: images/IP_authenication.png
:align: center


For example:

.. image:: images/username_password.PNG
.. image:: images/username_password.png
:align: center


After you have added the new group, the screen will return back to the List of Carriers Group page. Select the pencil in the blue box to the right to allow editing the Config and Endpoints.



.. image:: images/carrier_editing.PNG
.. image:: images/carrier_editing.png
:align: center



Select the Config tab. The Config tab allows you to edit/change the Carrier group name. Then click Update.

.. image:: images/config_pic.PNG
.. image:: images/config_pic.png
:align: center




To add an Endpoint, click the Endpoint tab.

.. image:: images/add_endpoint.PNG
.. image:: images/add_endpoint.png
:align: center

Click ADD, enter the Friendly name (optional), the IP address of the endpoint/device, # of characters to strip from RURI, the character to prefix to a RURI then click ADD again. RURI is when a number is dialed such as 9 plus the 1 and the number, a carrier may only want to see the phone number so the RURI would strip the "9" from in front of the telephone number. For example, if a PBX sends a number over as 914443332222 but the carrier wants the number to be sent as 14443332222 then the field should have a 1, which would strip off the 9. Some carriers request added digits, aka prefixes, in front of the phone number for validation that the call is from that carrier. In this example, the # of characters to strip from RURI is 0 as in none.



.. image:: images/add_new_carrier_details.PNG
.. image:: images/add_new_carrier_details.png
:align: center

Edit and click ADD again to add addtional endpoints. Click the gray X in that box to save window and close.

You should now see your added carrier with endpoints in the Carrier Group List.

.. image:: images/carrier_group_list.PNG
.. image:: images/carrier_group_list.png
:align: center



Be sure to click the Reload Kamailio button to apply changes.


.. image:: images/reload_button.PNG
.. image:: images/reload_button.png
:align: center


Expand Down
9 changes: 6 additions & 3 deletions docs/centos-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ Note: You can add a "-b <version number>" to the end of the git command to insta

Install (Don't Proxy audio (RTP) traffic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::

.. code-block:: bash
yum install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -kam -dsip
|
One Line Version:
::

.. code-block:: bash
yum install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -kam -dsip
Expand Down
27 changes: 9 additions & 18 deletions docs/command_line_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,33 @@ resetpassword Resets dSIPRouter admin account and displa
help|-h|--help List all of the options
=================================== ======================================================================

Refer to :ref:`installing_dsiprouter` to get the complete one line version of the command.
Refer to :ref:`debian_install` to get the complete one line version of the command.


To start dSIPRouter:

::
.. code-block:: bash
./dsiprouter.sh start
./dsiprouter.sh start
|
To stop dSIPRouter:

::
.. code-block:: bash
./dsiprouter.sh stop
./dsiprouter.sh stop
|
To restart dSIPRouter:

::
.. code-block:: bash
./dsiprouter.sh restart
./dsiprouter.sh restart
|
To uninstall dSIPRouter:

::

./dsiprouter.sh unistall

|


.. code-block:: bash
./dsiprouter.sh unistall
54 changes: 26 additions & 28 deletions docs/debian_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ Note: You can add a "-b <version number>" to the end of the git command to insta

Install (Don't Proxy audio (RTP) traffic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::

.. code-block:: bash
apt-get update
apt-get install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -kam -dsip
|
One Line Version:
::
apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -kam -dsip

.. code-block:: bash
apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -kam -dsip
Once the install is complete, dSIPRouter will automatically start MySQL, Kamailio and the UI.
Expand All @@ -32,45 +35,40 @@ Install (Proxy audio (RTP) traffic)
If you need to proxy RTP traffic then use -all install option. The command to install dSIPRouter and the RTPEngine would be:


::

apt-get update
apt-get install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -all
.. code-block:: bash
|
apt-get update
apt-get install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -all
One Line Version:
::

apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -all
.. code-block:: bash
apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -all
Install (Proxy audio (RTP) traffic with PBX and dSIPRouter behind NAT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you have a requirement where the PBX's and dSIPRouter are behind NAT then use the steps below, which are the same as above, but you will add a -servernat parameter.

::
.. code-block:: bash
apt-get update
apt-get install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -all -servernat
|
apt-get update
apt-get install -y git curl
cd /opt
git clone https://github.com/dOpensource/dsiprouter.git
cd dsiprouter
./dsiprouter.sh install -all -servernat
One Line Version:

::

apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -all -servernat

.. code-block:: bash
apt-get update;apt-get install -y git curl;cd /opt;git clone https://github.com/dOpensource/dsiprouter.git;cd dsiprouter;./dsiprouter.sh install -all -servernat

0 comments on commit bc9e4f7

Please sign in to comment.