How to use "external_id"?

Hi,

I would like to know the purpose of “external_id” in the contractor records or accounts table? and is there a way to insert reference records into contactors with external billing accounts reference information such as Account ID or Service ID just for purpose of mapping between two systems and parse data?

SIP Register (aor) failover: Incase a sip trunk deregistered, how can we force the inbound calls to be forwarded to a different dial-peer

Thanks

External ID is object identifier from remote system, so you can use it for integration. You can set it via admin API.

https://demo.yeti-switch.org/doc/api/admin/index.html

PS: Do not mix multiple questions in same topic pls.

Thanks Dmitry. I will raise separate tickets about the SIP registrations

I tried to use Admin API via Postman to get token as per Authentication API

I’m getting an error 403, tippin some config error or something.

Here are my logs and configs

Blockquote
==> /var/log/nginx/error.log <==
2020/01/14 11:01:48 [error] 2846#2846: *94 access forbidden by rule, client: 192.168.120.67, server: _, request: “POST /api/rest/admin/auth HTTP/1.1”, host: “192.168.120.151”

Based on the previous topic discussions, I have followed the same as per below,

Nginx Configs (/etc/nginx/sites-enabled/yeti)

upstream ts {
server 127.0.0.1:80;
}
upstream ds {
server 127.0.0.1:80;
}

upstream yeti-unicorn {
server unix:/run/yeti/yeti-unicorn.sock;
}

#server {

listen 80;

server_name localhost;

root /opt/yeti-web;

access_log /var/log/nginx/yeti-web.access.log;

location / {

rewrite ^/(.*) https://localhost$request_uri? permanent;

}

#}

server {
listen 127.0.0.1:6666;
listen 192.168.120.151:6666;
server_name _;

    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Proxy-Port $proxy_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header HTTP_CLIENT_IP $remote_addr;
    proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
    client_max_body_size        100m;
    client_body_buffer_size     128k;
    proxy_connect_timeout       100;
    proxy_send_timeout          20000;
    proxy_read_timeout          20000;
    proxy_buffer_size           32k;
    proxy_buffers               8 32k;
    proxy_busy_buffers_size     64k;
    proxy_temp_file_write_size  640k;

    allow 127.0.0.1;
    deny all;

    location /api/rest/system/jobs {
            allow 127.0.0.1;
            deny all;
            proxy_pass  http://yeti-unicorn;
    }

    location /api/rest/admin {
            allow 127.0.0.1;
            allow 192.168.120.151;
            deny all;
            proxy_pass  http://yeti-unicorn;

            if ($request_method = 'OPTIONS') {
                    add_header 'Access-Control-Allow-Origin' '*';
                    add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
                    add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
                    add_header 'Access-Control-Max-Age' 1728000;
                    add_header 'Content-Type' 'text/plain charset=UTF-8';
                    add_header 'Content-Length' 0;
                    return 204;
            }
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
            add_header 'Access-Control-Allow-Credentials' 'true';

    }

    location /api/rest/customer {
            allow 127.0.0.1;
            allow 192.168.120.151;
            deny all;
            proxy_pass  http://yeti-unicorn;

            if ($request_method = 'OPTIONS') {
                    add_header 'Access-Control-Allow-Origin' '*';
                    add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
                    add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
                    add_header 'Access-Control-Max-Age' 1728000;
                    add_header 'Content-Type' 'text/plain charset=UTF-8';
                    add_header 'Content-Length' 0;
                    return 204;
            }
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
            add_header 'Access-Control-Allow-Credentials' 'true';

    }

I would appreciate it if you could assist with the API. I have also created a customer API, it is showing the same error as well

Do we need to reboot yeti-web to get it working or am i missing some config?

Request blocked by nginx. because your configuration doesn’t allow requests from 192.168.120.67:

    location /api/rest/admin {
            allow 127.0.0.1;
            allow 192.168.120.151;
            deny all;

I have changed the config to allow my current ip and restarted nginx but it still fails with 403 forbidden

in fact, for the purpose of testing, i have set “allow all” and admin api still did not work

==> /var/log/nginx/error.log <==
2020/01/15 22:28:51 [error] 27287#27287: *1 access forbidden by rule, client: 192.168.119.253, server: _, request: “POST /api/rest/admin/auth HTTP/1.1”, host: “192.168.120.151”

Blockquote

server {
listen 127.0.0.1:6666;
listen 192.168.120.151:6666;
server_name _;

    proxy_redirect off;
    proxy_set_header Host $host;
    proxy_set_header X-Proxy-Port $proxy_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header HTTP_CLIENT_IP $remote_addr;
    proxy_set_header HTTP_X_FORWARDED_FOR $remote_addr;
    client_max_body_size        100m;
    client_body_buffer_size     128k;
    proxy_connect_timeout       100;
    proxy_send_timeout          20000;
    proxy_read_timeout          20000;
    proxy_buffer_size           32k;
    proxy_buffers               8 32k;
    proxy_busy_buffers_size     64k;
    proxy_temp_file_write_size  640k;

    allow 127.0.0.1;
    #allow 192.168.120.151;
    deny all;

    location /api/rest/system {
            allow 127.0.0.1;
            deny all;
            proxy_pass  http://yeti-unicorn;
    }

    location /api/rest/admin {
            allow 127.0.0.1;
            allow 192.168.119.253;
            deny all;
            proxy_pass  http://yeti-unicorn;

            if ($request_method = 'OPTIONS') {
                    add_header 'Access-Control-Allow-Origin' '*';
                    add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
                    add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
                    add_header 'Access-Control-Max-Age' 1728000;
                    add_header 'Content-Type' 'text/plain charset=UTF-8';
                    add_header 'Content-Length' 0;
                    return 204;
            }
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
            add_header 'Access-Control-Allow-Credentials' 'true';

    }

    location /api/rest/customer {
            allow 127.0.0.1;
            allow 192.168.119.253;
            deny all;
            proxy_pass  http://yeti-unicorn;

            if ($request_method = 'OPTIONS') {
                    add_header 'Access-Control-Allow-Origin' '*';
                    add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
                    add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
                    add_header 'Access-Control-Max-Age' 1728000;
                    add_header 'Content-Type' 'text/plain charset=UTF-8';
                    add_header 'Content-Length' 0;
                    return 204;
            }
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, api_key, Authorization';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, PATCH, OPTIONS';
            add_header 'Access-Control-Allow-Credentials' 'true';

    }

located at server that listen on:

listen 127.0.0.1:6666;
listen 192.168.120.151:6666;

You are sending requests to port 80. Check your nginx configuration

I was under the impression that it was passing proxy from :80 to :6666 but thanks to you, its working now.