Actions

ProSBC:Restful API NAP: Difference between revisions

No edit summary
No edit summary
Line 108: Line 108:
</pre>
</pre>


Most important fields in the JSON file
Important parameters in the JSON file


* name = NAP name
* [[Parameter: Name|name]]
* proxy_address = NAP Ip address or FQDN
* [[Parameter: Proxy Address|proxy_address]]
* proxy_port = Port to communicate with the destination
* [[Parameter: Proxy Port|proxy_port]]
* [[Parameter: Poll Remote Proxy|poll_remote_proxy]]
* [[Parameter: Register to Proxy|registration_parameters]]
* sip_transport_servers =  transport server to use in ProSBC to communicate with the destination
* sip_transport_servers =  transport server to use in ProSBC to communicate with the destination
* port_ranges = RTP port ranges used for this NAP
* port_ranges = RTP port ranges used for this NAP
* authentication_parameters = If you want to authenticate this NAP to the far end you need to fill up the parameters under authentication
* authentication_parameters = If you want to authenticate this NAP to the far end you need to fill up the parameters under authentication
* registration_parameters = If you want to register this NAP to the far end you need to fill up the parameters under registration
 


==Adding a new NAP==
==Adding a new NAP==

Revision as of 07:17, 23 January 2023


You can create/modify a NAP in your system with RestFul API using JSON format. The JSON must be in the following format:

{
    "sip_cfg": {
        "registration_parameters": {
            "register_to_proxy": false,
            "address_to_register": "",
            "***meta***": {
                "valid_url": false
            }
        },
        "filtering_parameters": {
            "filter_by_local_port": true,
            "filter_by_proxy_address": true,
            "filter_by_proxy_port": true,
            "***meta***": {
                "valid_url": false
            }
        },
        "accept_only_authorized_users": false,
        "proxy_polling_interval": "1 minute",
        "proxy_address": "192.168.1.55",
        "sipi_parameters": {
            "append_f_to_outgoing_calls": false,
            "call_progress_method": "183 Call Progress",
            "content_type": "itu-t",
            "isup_protocol_variant": "ITU",
            "enable": false,
            "***meta***": {
                "valid_url": false
            }
        },
        "nap_sip_acls": [],
        "proxy_port_type": "UDP",
        "authentication_parameters": {
            "password": "",
            "ignore_realm": false,
            "reuse_challenge": false,
            "user": "",
            "realm": "",
            "***meta***": {
                "valid_url": false
            }
        },
        "advanced_parameters": {
            "map_any_response_to_available_status": true,
            "response_timeout": "12 seconds",
            "privacy_type": "P-Asserted-Identity",
            "proxy_polling_max_forwards": 1,
            "183_triggers_call_progress": false,
            "***meta***": {
                "valid_url": false
            }
        },
        "network_address_translation": {
            "local_method_sip": "",
            "remote_method_sip": "None",
            "remote_method_rtp": "None",
            "local_method_rtp": "",
            "***meta***": {
                "valid_url": false
            }
        },
        "proxy_port": 5060,
        "***meta***": {
            "valid_url": false
        },
        "poll_remote_proxy": true,
        "sip_use_proxy": true
    },
    "enabled": true,
    "port_ranges": [
        "Host.pr_voip0"
    ],
    "name": "MyPBX",
    "congestion_threshold": {
        "nb_calls_per_period": 1,
        "period_duration": "1 minute",
        "***meta***": {
            "valid_url": false
        }
    },
    "sip_transport_servers": [
        "voip0_ts_5060"
    ],
    "default_profile": "default",
    "call_rate_limiting": {
        "processing_delay_low_threshold": "3 seconds",
        "maximum_call_burst": 0,
        "processing_delay_high_threshold": "6 seconds",
        "maximum_calls_per_second": 0,
        "maximum_outgoing_calls_per_second": 0,
        "maximum_simultaneous_outgoing_calls": 0,
        "maximum_incoming_calls_per_second": 0,
        "maximum_simultaneous_total_calls": 0,
        "maximum_simultaneous_incoming_calls": 0,
        "***meta***": {
            "valid_url": false
        }
    },
    "***meta***": {
        "version": "3.1.137",
        "src_path": ""
    }
}

Important parameters in the JSON file

  • name
  • proxy_address
  • proxy_port
  • poll_remote_proxy
  • registration_parameters
  • sip_transport_servers = transport server to use in ProSBC to communicate with the destination
  • port_ranges = RTP port ranges used for this NAP
  • authentication_parameters = If you want to authenticate this NAP to the far end you need to fill up the parameters under authentication


Adding a new NAP

You can add a new NAP with the POST command:

POST http://ProSBCIP:12358/configurations/configuration name/naps/

ProSBC will create a new NAP from the name in the JSON file.

Example: We use the Postman tool in this example and the URL is:

http://192.168.1.25:12358/configurations/config_2/naps/

If the new NAP is created successfully, you will see the following information in the Postman Tool

Modifiying a NAP

You can modify the existing NAP with the PUT command:

PUT http://ProSBCIP:12358/configurations/Configurationname/naps/NapName

Example: We use the Postman tool in this example and the URL is

http://192.168.1.25:12358/configurations/config_2/naps/TEST_NAP and changed the proxy_address from 192.168.1.99 to 192.168.1.100

If the update is successful you will see the following information in the Postman Tool


You can get more information about how to use RestFul API and Postman Tool from the following link Northbound_interface:RESTful