]> git.defcon.no Git - hermes/commitdiff
Added collision prevention to aliases, added todo for the reverse, promoted numbers...
authorjonl <jonl@sippbx.hig.no>
Thu, 12 Jan 2012 17:30:34 +0000 (18:30 +0100)
committerjonl <jonl@sippbx.hig.no>
Thu, 12 Jan 2012 17:30:34 +0000 (18:30 +0100)
alias.php
api-nodes.txt

index 0c24b01d0f3b67950d03f54b2ca164d922c1d5f9..9adb4346e82dd896d9721854f64ede3b4fdbf9fa 100644 (file)
--- a/alias.php
+++ b/alias.php
@@ -101,6 +101,11 @@ if ( !$config['sql_link'] )
                                }
 
                                // TODO: Verify that alias does not collide with existing SIP-adress
+                               if ( is_kamailio_domain( $alias_domain) &&  is_kamailio_subscriber($alias_username, $alias_domain) )
+                               {
+                                       print json_encode ( array( 'response' => 'failed', 'cause' => 'exists', 'detail' => 'The desired alias collides with an existing non-alias.' ));
+                                       break;
+                               }
 
                                list ( $dest_username, $dest_domain ) = split_sipaddress( $_GET['destination']);
 
index a82e3c2d0fcebac4ff752ad1875f282f4bf7f4a1..1a26ef8b0c0ce51c2ea9b4ff9dd9a38aa2a101fc 100644 (file)
@@ -107,7 +107,6 @@ numbers/remove?number=%2B4761123456
        Returns 'response' as 'ok' with 'number' set to the number that was pulled from the pool.
 
 numbers/inpool?number=%2B4761123456
-       A debug-node, may disappear at any time ^_^
        Tests if the given E164 number is in the pool.
        Returns 'response' = 'ok' with 'number' = '<number>' If the number is in the pool
        Returns response = 'failed' with 'cause' = 'nonexistant' if not.
@@ -152,7 +151,8 @@ Planned, but not implemented nodes/functions:
        alias/list
        alias/user?destination=foo@bar.bz
 
-Add collision prevention for aliases, make sure that no alias can be added when the alias
-address would overlap/collide with a valid user-address
-
 authentication-mechanism :)
+
+Add collision prevention for users, make sure that no user can be added when the user
+address would overlap/collide with a valid alias-address
+