Skinny: tuple profile, device_name, device_instance is unique
This commit is contained in:
parent
bd6f7e73c0
commit
194e57268a
|
@ -1710,6 +1710,7 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
|
|||
switch_event_t *event = NULL;
|
||||
switch_event_t *params = NULL;
|
||||
switch_xml_t xroot, xdomain, xgroup, xuser, xskinny, xparams, xparam, xbuttons, xbutton;
|
||||
listener_t *listener2 = NULL;
|
||||
char *sql;
|
||||
assert(listener->profile);
|
||||
profile = listener->profile;
|
||||
|
@ -1736,6 +1737,17 @@ switch_status_t skinny_handle_register(listener_t *listener, skinny_message_t *r
|
|||
goto end;
|
||||
}
|
||||
|
||||
skinny_profile_find_listener_by_device_name_and_instance(listener->profile,
|
||||
request->data.reg.device_name, request->data.reg.instance, &listener2);
|
||||
if (listener2) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
|
||||
"Device %s:%d is already registred on another listener.\n",
|
||||
request->data.reg.device_name, request->data.reg.instance);
|
||||
send_register_reject(listener, "Device is already registred on another listener");
|
||||
status = SWITCH_STATUS_FALSE;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if ((sql = switch_mprintf(
|
||||
"INSERT INTO skinny_devices "
|
||||
"(name, user_id, instance, ip, type, max_streams, codec_string) "
|
||||
|
|
Loading…
Reference in New Issue