Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gui/dsiprouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@ def displayInboundMapping():
if len(settings.FLOWROUTE_ACCESS_KEY) > 0 and len(settings.FLOWROUTE_SECRET_KEY) > 0:
try:
dids = numbers_api.getNumbers()
# print("The did's returned: {}".format(dids))
except http_exceptions.HTTPException as ex:
debugException(ex)
return showError(type="http", code=ex.code, msg="Flowroute Credentials Not Valid")
Expand Down
21 changes: 18 additions & 3 deletions gui/modules/flowroute/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __del__(self):
self.auth = None
self.api_url = None

def getNumbers(self, starts_with=None, contains=None, ends_with=None, limit=1000000, offset=None):
def getNumbers(self, starts_with=None, contains=None, ends_with=None, limit=1000000, offset=None, alias=None):
"""
Get flowroute DID's associated with accnt

Expand All @@ -33,8 +33,23 @@ def getNumbers(self, starts_with=None, contains=None, ends_with=None, limit=1000
'contains': contains,
'ends_with': ends_with,
'limit': limit,
'offset': offset
'offset': offset,
}

# Default is to show unassigned numbers by setting alias to None
if alias is not None:
# Search for a particular alias
if len(alias) > 0:
payload['alias'] = alias
# Show all numbers
if alias == " " or alias == "":
pass

resp = requests.get(self.api_url, auth=self.auth, params=payload)
resp.raise_for_status()
return [num['attributes']['value'] for num in resp.json()['data']]
if alias == None: # Show unassigned numbers
print("look for empty space")
return [num['attributes']['value'] for num in resp.json()['data'] if num['attributes']['alias'] == None]
else:
return [num['attributes']['value'] for num in resp.json()['data']]

4 changes: 2 additions & 2 deletions gui/static/js/inboundmapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* @global window scope
* @namespace aria
*/
var aria = aria || {};
/* var aria = aria || {}; */

/**
* @global script scope
* @type {Array}
*/
var DID_LIST = DID_LIST || [];
/*var DID_LIST = DID_LIST || []; */

/**
* Search DID_LIST for search_string
Expand Down
5 changes: 3 additions & 2 deletions gui/templates/inboundmapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,9 @@ <h4 class="modal-title custom_align" id="Heading">Import DID's</h4>
{% block custom_js %}
{{ script_tag('combobox') }}
<script type="application/javascript">
var DID_LIST = JSON.parse("{{ imported_dids }}") || [];


var DID_LIST = {{ imported_dids | safe }} || [];

var gw_mapping = [];
{% for gw in gatewayList %}
gw_mapping.push({
Expand Down
8 changes: 7 additions & 1 deletion kamailio/configs/kamailio.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ listen = sctp:127.0.0.1:SIP_PORT
#!ifdef WITH_DMZ
listen = udp:EXTERNAL_IP_ADDR:SIP_PORT
listen = tcp:EXTERNAL_IP_ADDR:SIP_PORT
listen = udp:INTERNAL_IP_ADDR:SIP_PORT
listen = tcp:INTERNAL_IP_ADDR:SIP_PORT
#!endif

#!ifdef WITH_SIGNAL_SERVERNAT
Expand Down Expand Up @@ -2141,7 +2143,11 @@ route[REGISTRAR] {
# Rewrite Contact based on the domain being routed to
$var(ct_domain) = $fd;
route(REPLACE_CONTACT_DOMAIN);


# Force Register request out the internal network when using DMZ mode
#!ifdef WITH_DMZ
$fs='udp:INTERNAL_IP_ADDR:SIP_PORT';
#!endif
if (isbflagset(FLB_WS_DEVICE)) {
add_path();
}
Expand Down