[Serusers] Multiply Domain Registration Problem

Jan Janak jan at iptel.org
Tue May 13 13:00:14 CEST 2003


On 13-05 12:48, Andrzej Radke wrote:
> You right ! But if I remove this "break" command nothing is happend
> Nobody from gda.pl and gdynia.pl is registered. :(
> I'd like a support for 2 different domains. What can I do ?
> I think the problem is in my config script, not in database tables, which 
> I created

  OK, to achieve this you will need a condition to differentiate the
  domains. For example something like this:

  if (uri=~".*gda\.pl") {
  	if (method=="REGISTER") {
		if (!www_authorize("gda.pl", "subscriber")) {
			www_challenge("gda.pl", "0");
			break;
		};

		save("location");
		break;
	};

	if (!lookup("location")) {
		sl_send_reply("404", "Not Found");
		break;
	};
   } else if (uri=~".*gdynia\.pl") {
   	if (method=="REGISTER") {
		if (!www_authorize("gdynia.pl", "subscriber2")) {
			www_challenge("gdynia.pl", "0");
			break;
		};

		save("location2");
		break;
	};

	if (!lookup("location2")) {
		sl_send_reply("404", "Not Found");
		break;
	};
   };

   if (!t_relay()) {
   	sl_reply_error();
   };

   This is easy if you have a small number of domains that you want to
   handle and you don't change it very often.

   If you need multidomain support and the domains are created often or
   automatically then it is also possible to do this without
   modifications of the script and restarting the server. But only CVS
   version of ser supports that.

     Jan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20030513/832bfa8d/attachment.pgp>


More information about the sr-users mailing list