Extension

Overview

To enable your SIP endpoint to receive calls from Voipbin, you must set up a domain, extension, and registration.

Calling a registered SIP endpoint follows the same process as calling any other SIP URI. However, you will now use the Address of Record (AOR) of your registered SIP extension (endpoint).

Registration address

When calling your registered SIP extension (endpoint), you should use the general SIP domain URI, omitting the Voipbin’s SIP URI. Specifically, the format to call your registered SIP extension is as follows:

{extension}@{your voipbin customer id}.registrar.voipbin.net

By using this format, Voipbin can route the call to your registered SIP endpoint based on the extension and domain information provided. This allows you to receive incoming calls on your SIP endpoint and handle them using your SIP-enabled system.

The setup of domain, extension, and registration is crucial for integrating your SIP-based communication infrastructure with Voipbin. Once properly configured, you can seamlessly communicate with your SIP endpoint through Voipbin’s SIP services, ensuring efficient and reliable voice communication for your business or application needs. This integration empowers businesses and developers to create robust and scalable communication solutions, streamlining call handling and enhancing overall communication experiences.

Registration

The extension registration is the process of identifying and authenticating a user or device on a SIP network. When a device wants to make or receive calls or messages on the network, it must first register with the VoIPBin by sending a REGISTER message.

This message includes information about the user or device, such as its address, phone number, and authentication credentials (e.g., username and password). The VoIPBin verifies the user’s credentials and then responds with a confirmation message, such as a 200 OK response.

Once the device is registered, it can make and receive calls and messages on the SIP network. SIP registration is important for ensuring secure and reliable communication between devices on the network, as well as for enabling advanced features like call forwarding, voicemail, and presence.

407 Proxy Authentication Required

When a user or device sends a SIP REGISTER message to a VoIPBin with basic authentication, the VoIPBin will typically respond with a 407 Proxy Authentication Required message if the user’s credentials are not valid or not provided.

Here is an example of this process:

  1. The user or device sends a REGISTER message to the VoIPBin with its identification information.

  2. The VoIPBin checks the user’s credentials, and if they are not valid or not provided, it responds with a 407 Proxy Authentication Required message.

  3. The 407 response includes a “Nonce” value, which is a unique and random number used to help prevent replay attacks. The user’s device must use this “Nonce” value, along with the username, password, and other information, to create an “Authorization” header for the next REGISTER message.

  4. The user’s device sends a second REGISTER message with the Authorization header, including the “Nonce” value and other authentication information.

  5. The VoIPBin verifies the user’s credentials using the basic authentication method, and if they are valid, it sends a 200 OK response, confirming the registration.

Once the user’s device is registered, it can receive calls and messages on the SIP network.

UA                                   VoIPBin

|                                        |
|-------------- REGISTER --------------->|
|                                        |
|<-- 407 Proxy Authentication Required --|
|---------------- ACK ------------------>|
|                                        |
|----- REGISTER with Authorization ----->|
|                                        |
|<------------- 200 OK ------------------|
|-------------- ACK -------------------->|

Extension

Extension

{
    "id": "e1491290-c61c-4349-a7ff-5890c796b61b",
    "name": "test domain",
    "detail": "test domain creation",
    "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",
    "extension": "test12",
    "tm_create": "2021-03-21 11:24:26.485161",
    "tm_update": "",
    "tm_delete": ""
},
  • id: Extension’s id.

  • name: Extension’s name.

  • detail: Extensions’s detail description.

  • domain_id: Domain’s id.

  • extension: Extension

Tutorial

Get list of extensions

Gets the list of registered extensions of the given domain.

$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/extensions?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQzMzE0OTgsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.Gg1WsbrKDnQQh7Pvi5y5CV51NVQBz7pgU_T9TxshXPs&domain_id=cc6a05eb-33a4-444b-bf8a-359de7d95499'

{
    "result": [
        {
            "id": "0e7f8158-c770-4930-a98e-f2165b189c1f",
            "user_id": 1,
            "name": "test domain",
            "detail": "test domain creation",
            "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",
            "extension": "test11",
            "password": "bad79bd2-71e6-11eb-9577-c756bf092a88",
            "tm_create": "2021-02-18 12:42:27.688282",
            "tm_update": "",
            "tm_delete": ""
        }
    ],
    "next_page_token": "2021-02-18 12:42:27.688282"
}

Get detail of specified extension

Gets the detail of registered extension.

$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/extensions/0e7f8158-c770-4930-a98e-f2165b189c1f?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQzMzE0OTgsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.Gg1WsbrKDnQQh7Pvi5y5CV51NVQBz7pgU_T9TxshXPs'

{
    "id": "0e7f8158-c770-4930-a98e-f2165b189c1f",
    "user_id": 1,
    "name": "test domain",
    "detail": "test domain creation",
    "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",
    "extension": "test11",
    "password": "bad79bd2-71e6-11eb-9577-c756bf092a88",
    "tm_create": "2021-02-18 12:42:27.688282",
    "tm_update": "",
    "tm_delete": ""
}

Create a extension

Create a new extension.

$ curl -k --location --request POST 'https://api.voipbin.net/v1.0/extensions?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQzMzE0OTgsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.Gg1WsbrKDnQQh7Pvi5y5CV51NVQBz7pgU_T9TxshXPs' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "test domain",
    "detail": "test domain creation",
    "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",

    "extension": "test12",
    "password": "27a4d0f2-757c-11eb-bc8f-4f045857b89c"
}'

{
    "id": "6a7934ff-0e1c-4857-857b-23c9e27d267b",
    "user_id": 1,
    "name": "test domain",
    "detail": "test domain creation",
    "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",
    "extension": "test12",
    "password": "27a4d0f2-757c-11eb-bc8f-4f045857b89c",
    "tm_create": "2021-02-23 02:09:39.701458",
    "tm_update": "",
    "tm_delete": ""
}

Update the extension

Update the existed extension with given info.

$ curl -k --location --request PUT 'https://api.voipbin.net/v1.0/extensions/6a7934ff-0e1c-4857-857b-23c9e27d267b?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQzMzE0OTgsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.Gg1WsbrKDnQQh7Pvi5y5CV51NVQBz7pgU_T9TxshXPs' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "update test extension name",
    "detail": "update test extension detail",
    "password": "5316382a-757c-11eb-9348-bb32547e99c4"
}'

{
    "id": "6a7934ff-0e1c-4857-857b-23c9e27d267b",
    "user_id": 1,
    "name": "update test extension name",
    "detail": "update test extension detail",
    "domain_id": "cc6a05eb-33a4-444b-bf8a-359de7d95499",
    "extension": "test12",
    "password": "5316382a-757c-11eb-9348-bb32547e99c4",
    "tm_create": "2021-02-23 02:09:39.701458",
    "tm_update": "2021-02-23 02:11:03.992067",
    "tm_delete": ""
}

Delete the extension

Delete the existed extension of given id.

$ curl --location --request DELETE 'https://api.voipbin.net/v1.0/extensions/6a7934ff-0e1c-4857-857b-23c9e27d267b?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQzMzE0OTgsInVzZXIiOnsiaWQiOjEsInBlcm1pc3Npb24iOjEsInVzZXJuYW1lIjoiYWRtaW4ifX0.Gg1WsbrKDnQQh7Pvi5y5CV51NVQBz7pgU_T9TxshXPs'