Ahhh sorry... schoolboy error... have been looking at this for so long today my mind had completely frozen over!
Many thanks, and works brilliantly now!
Dave
-----Original Message----- From: Ezequiel Colombo [mailto:ecolombo@arcotel.net] Sent: 29 July 2004 17:06 To: Dave Bath; serusers@lists.iptel.org Subject: Re: [Serusers] offline users vs. non-existant
Hi, i am using does_uri_exist() from uri module Ej: if (!does_uri_exist()) {log(1,"USER UNKNOWN"); sl_send_reply("404", "Not Found"); end_media_session(); break;};
..modules/uri/README: 1.4.4. does_uri_exist()
Check if username in the request URI belongs to an existing user. Example 1-12. does_uri_exist usage ... if (does_uri_exist()) { ... };
Regards Ezequiel Colombo
----- Original Message ----- From: Dave Bath To: serusers@lists.iptel.org Sent: Thursday, July 29, 2004 12:53 PM Subject: [Serusers] offline users vs. non-existant
Hey everyone,
I'm trying to work out how to recognise whether a user is offline or just doesn't exist.
I have this snippet of code .
if (!lookup("location")) {
<snip>
if ((method=="INVITE" || method=="ACK") && t_newtran() ) { t_reply("404", "Not Found"); # Put an entry in the database acc_db_request("404 Not Found","missed_calls"); break; } else { # all other requests to off-line users are simply replied # statelessly and no reports are issued sl_send_reply("404", "Not Found"); break; };
However, I don't think it's right.. as I don't see under what situations I will reach the else statement. No matter whether I call an offline user or a non-existent user I always get a 404 Not Found and an entry is stored in the database.
This is not ideal - I'd like to be able to differentiate between an offline and a non-existent user..
Can anyone help me on this please?
Many thanks in advance,
D
------------------------------------- Dave Bath dave@fuuz.com www.fuuz.com 07736 232085 NOTE: The information contained in this email is intended for the named recipients only, it may be privileged and confidential. If you are not the intended recipient, you must not copy distribute or take any action in reliance upon it. No warranties or assurances are made in relation to the safety and content of this email and any attachments. No liability is accepted for any consequences arising from it
_______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers