Hello List:
It would be really great, If I could write something like this in ser.cfg:
if (method=="MESSAGE") { if (src_ip==192.168.1.0/24) { route("handle_internal_message"); } else { route("handle_message"); }; };
if (!uri=~myself) { route("handle_other_uri"); };
route["handle_internal_message"] { # code of handle_internal_message };
route["handle_message"] { # code of handle_message };
route["handle_other_uri"] { # code of other_uri };
I think, everybody will agree with me: this way ser.cfg would be more readable and would be easier to write longer script. Its really painful to remember route number.
Thanks for reading my posting.
MOhammad
Mohammad Khan wrote:
Hello List:
It would be really great, If I could write something like this in ser.cfg:
if (method=="MESSAGE") { if (src_ip==192.168.1.0/24) { route("handle_internal_message"); } else { route("handle_message"); }; };
if (!uri=~myself) { route("handle_other_uri"); };
route["handle_internal_message"] { # code of handle_internal_message };
route["handle_message"] { # code of handle_message };
route["handle_other_uri"] { # code of other_uri };
I agree! It'll be really good feature...
Why not use m4 macroes?
Then you can do exact what you request there, without any modifications of ser.
-Atle
* Alexey N. Kovyrin @ Home alexey@home.kovyrin.net [050305 10:35]:
Mohammad Khan wrote:
Hello List:
It would be really great, If I could write something like this in ser.cfg:
if (method=="MESSAGE") { if (src_ip==192.168.1.0/24) { route("handle_internal_message"); } else { route("handle_message"); }; };
if (!uri=~myself) { route("handle_other_uri"); };
route["handle_internal_message"] { # code of handle_internal_message };
route["handle_message"] { # code of handle_message };
route["handle_other_uri"] { # code of other_uri };
I agree! It'll be really good feature...
-- /Scoundrel
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
On Mar 04, 2005 at 09:58, Mohammad Khan info@beeplove.com wrote:
Hello List:
It would be really great, If I could write something like this in ser.cfg:
[...]
I think, everybody will agree with me: this way ser.cfg would be more readable and would be easier to write longer script. Its really painful to remember route number.
Yes, it would be easier and it won't be difficult to implement. However what ser needs first is refurbishing the config parsing code. A lot of new features depend on changing it. This is a long and boring job which I will do someday :-) Until then I don't want to add new features that will prolong the transition even further.
Andrei