Does anybody have any tips on solving the following
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
Does this require uri_db ?
Using 0.8.14
Br /Kevin
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Apart from the spammers I need to get a seperate cause code back to the PSTN (if user is not diverted to voicemail) as retunring 504 gives announcement "This is an invalid number". Also I only want to divert valid numbers to voicemail.
Br /Kev.
Nils Ohlmeier wrote:
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Sorry did you meant 404 gives "This is an invalid number"? Otherwise I would be interested which vendor/ITSP convert the return code "504 Server Time-Out" (according to 3261) into such an announcement, and into what the return code 404 gets converted.
Nils
On Friday 26 August 2005 22:42, Kevin Brennan wrote:
Apart from the spammers I need to get a seperate cause code back to the PSTN (if user is not diverted to voicemail) as retunring 504 gives announcement "This is an invalid number". Also I only want to divert valid numbers to voicemail.
Br /Kev.
Nils Ohlmeier wrote:
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Yes typo - 404.
Nils Ohlmeier wrote:
Sorry did you meant 404 gives "This is an invalid number"? Otherwise I would be interested which vendor/ITSP convert the return code "504 Server Time-Out" (according to 3261) into such an announcement, and into what the return code 404 gets converted.
Nils
On Friday 26 August 2005 22:42, Kevin Brennan wrote:
Apart from the spammers I need to get a seperate cause code back to the PSTN (if user is not diverted to voicemail) as retunring 504 gives announcement "This is an invalid number". Also I only want to divert valid numbers to voicemail.
Br /Kev.
Nils Ohlmeier wrote:
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
So I added the does_uri_exist to my offline user check and received the following error upon startup. The problem is not obvious to me. Nils have you seen this error? If so any advice on how to proceed?
Aug 31 06:32:54 ser[20035]: register_udomain(): Invalid table version (use ser_mysql.sh reinstall) Aug 31 06:32:54 ser[20035]: domain_fixup(): Error while registering domain Aug 31 06:32:54 ser[20035]: ERROR: fix_expr : fix_actions error
Commenting out the if-then block containing the does_uri_exist removed this error.
Thanks,Steve
Nils Ohlmeier wrote:
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
It looks to me as the tables in your database, which you once created with ser_mysql, are older then the uri module which you use. So you probably need to "update" your database tables (like suggested with the 'ser_mysql reinstall' command).
Nils
On Wednesday 31 August 2005 12:48, Steve Blair wrote:
So I added the does_uri_exist to my offline user check and received the following error upon startup. The problem is not obvious to me. Nils have you seen this error? If so any advice on how to proceed?
Aug 31 06:32:54 ser[20035]: register_udomain(): Invalid table version (use ser_mysql.sh reinstall) Aug 31 06:32:54 ser[20035]: domain_fixup(): Error while registering domain Aug 31 06:32:54 ser[20035]: ERROR: fix_expr : fix_actions error
Commenting out the if-then block containing the does_uri_exist removed this error.
Thanks,Steve
Nils Ohlmeier wrote:
On Friday 26 August 2005 22:01, Kevin Brennan wrote:
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
I think does_uri_exist() from the uri module should do the job. Note: if you reply with different codes on existing and non-existing users, your community becomes an easy target for potential spamers.
Nils
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Kevin Brennan wrote:
Does anybody have any tips on solving the following
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
Does this require uri_db ?
Using 0.8.14
I'm about to try the following. I'd appreciate any input on this approach that others might have.
-Steve
# Offline user if (lookup("subscriber")) { if (!registered("location")) { xlog("L_INFO", "\n[SER]: OFFLINE: Subscriber is offline. Go to voicemail. Time: [%Tf] \n"); route(6); }; };
Br /Kevin
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
This is interesting. I suppose you'd have to add an extra field contact in table 'subscriber' to get a positive result - and of course the value in contact would re-write the uri so you should do it after lookup("location").
Will give it a try. Br /Kev./
Steve Blair wrote:
Kevin Brennan wrote:
Does anybody have any tips on solving the following
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
Does this require uri_db ?
Using 0.8.14
I'm about to try the following. I'd appreciate any input on this approach that others might have.
-Steve
# Offline user if (lookup("subscriber")) { if (!registered("location")) { xlog("L_INFO", "\n[SER]: OFFLINE: Subscriber is offline. Go to
voicemail. Time: [%Tf] \n"); route(6); }; };
Br /Kevin
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Kevin Brennan wrote:
This is interesting. I suppose you'd have to add an extra field contact in table 'subscriber' to get a positive result - and of course the value in contact would re-write the uri so you should do it after lookup("location").
Thanks for the note. This will save me the trouble of trying it.
Will give it a try. Br /Kev./
Steve Blair wrote:
Kevin Brennan wrote:
Does anybody have any tips on solving the following
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
Does this require uri_db ?
Using 0.8.14
I'm about to try the following. I'd appreciate any input on this approach that others might have.
-Steve
# Offline user if (lookup("subscriber")) { if (!registered("location")) { xlog("L_INFO", "\n[SER]: OFFLINE: Subscriber is offline. Go
to voicemail. Time: [%Tf] \n"); route(6); }; };
Br /Kevin
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
ser doesn't like lookup on subscribers table even with contact field added, it must need an identical table to aliases/location. Br /Kev
Steve Blair wrote:
Kevin Brennan wrote:
Does anybody have any tips on solving the following
I want to differenciate between offline users and unknown users. When you use lookup("location") there is no differenciation between the two.
Does this require uri_db ?
Using 0.8.14
I'm about to try the following. I'd appreciate any input on this approach that others might have.
-Steve
# Offline user if (lookup("subscriber")) { if (!registered("location")) { xlog("L_INFO", "\n[SER]: OFFLINE: Subscriber is offline. Go to
voicemail. Time: [%Tf] \n"); route(6); }; };
Br /Kevin
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Steve Blair wrote:
I'm about to try the following. I'd appreciate any input on this approach that others might have. # Offline user if (lookup("subscriber")) {
You can only lookup domains which have an appropriate table format like "location" table has, because usrloc tries to preload that domains on SER startup, and this will miserably for "subscriber" because of wrong table version, missing columns etc.
Andy
I suppose one solution is to create a table (say voicemail) of type location/alias and put a url pointing to voicemail/announcment in the contact field for any sub you want to divert.
something like
if (!lookup("location")) { #ok it's offline or unknown
# alternate routing like PSTN here.
if(lookup("voicemail")) { route(1); #send it off to uri from contact field break; } sl_send_reply("404", "Not Found"); } /Kev/
Andreas Granig wrote:
Steve Blair wrote:
I'm about to try the following. I'd appreciate any input on this approach that others might have. # Offline user if (lookup("subscriber")) {
You can only lookup domains which have an appropriate table format like "location" table has, because usrloc tries to preload that domains on SER startup, and this will miserably for "subscriber" because of wrong table version, missing columns etc.
Andy
Kevin Brennan wrote:
I suppose one solution is to create a table (say voicemail) of type location/alias and put a url pointing to voicemail/announcment in the contact field for any sub you want to divert.
That's what we use for call diversions, yes. Another possibility would be to use avp_db_load(...) which is easier for provisioning because you don't have to insert the contacts into all your SERs via FIFO/unixsock...
Andy
The problem I have with does_uri_exist() is it matches the full uri, I may have requests from the same user using different domains in the uri ex. calls from PSTN would have user@pstn.gateway.com others could also have user@sip.domain.com or just plain old user@domain.com depending on how they were resolved. I don't want to re-write the uri domain part because I'm also serving multiple domains. I know I could add an alias for all these but I was looking for a simpler alternative. Br /Kev/
Andreas Granig wrote:
I wrote:
and this will miserably for "subscriber"
"miserably fail" of course...
And what's wrong with does_uri_exist()?
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Kevin Brennan wrote:
The problem I have with does_uri_exist() is it matches the full uri, I may have requests from the same user using different domains in the uri ex. calls from PSTN would have user@pstn.gateway.com others could also have user@sip.domain.com or just plain old user@domain.com depending on how they were resolved. I don't want to re-write the uri domain part because I'm also serving multiple domains. I know I could add an alias for all these but I was looking for a simpler alternative.
But if you use domains then a lookup(...) will fail like does_uri_exists() because it must match the user- and domain-part too.
Andy
The server serves multiple domains but not using domains module, using multiple alias="xxxxx". We use E.164 numbers as usernames but these can be attached to multiple domains. br /Kev/
Andreas Granig wrote:
Kevin Brennan wrote:
The problem I have with does_uri_exist() is it matches the full uri, I may have requests from the same user using different domains in the uri ex. calls from PSTN would have user@pstn.gateway.com others could also have user@sip.domain.com or just plain old user@domain.com depending on how they were resolved. I don't want to re-write the uri domain part because I'm also serving multiple domains. I know I could add an alias for all these but I was looking for a simpler alternative.
But if you use domains then a lookup(...) will fail like does_uri_exists() because it must match the user- and domain-part too.
Andy
Kevin Brennan writes:
The problem I have with does_uri_exist() is it matches the full uri, I may have requests from the same user using different domains in the uri ex. calls from PSTN would have user@pstn.gateway.com
i accept your point regarding calls from pstn gw provided that the user part of the r-uri is an e.164 number, which is unique.
others could also have user@sip.domain.com or just plain old user@domain.com depending on how they were resolved.
sip.domain.com example i don't see valid. that can happen, but sip ua sending the request is somehow misconfigured.
one solution might be a new radius_does_uri_user_exist() function that would return true if the user part exists and is unique, in which case the domain would come back in reply item.
-- juha
Juha Heinanen wrote:
Kevin Brennan writes:
The problem I have with does_uri_exist() is it matches the full uri, I may have requests from the same user using different domains in the uri ex. calls from PSTN would have user@pstn.gateway.com
i accept your point regarding calls from pstn gw provided that the user part of the r-uri is an e.164 number, which is unique.
others could also have user@sip.domain.com or just plain old user@domain.com depending on how they were resolved.
sip.domain.com example i don't see valid. that can happen, but sip ua sending the request is somehow misconfigured.
ref to http://mit.edu/sip/sip.edu/dns.shtml
A SIP UA wanting to initiate a call to sip:bigcheese@bigu.edu will first send a DNS SRV lookup to bigu.edu. With a successful return, the SIP URI may be re-written to sip:bigcheese@sipserver1.bigu.edu.
one solution might be a new radius_does_uri_user_exist() function that would return true if the user part exists and is unique, in which case the domain would come back in reply item.
-- juha
Kevin Brennan writes:
A SIP UA wanting to initiate a call to sip:bigcheese@bigu.edu will first send a DNS SRV lookup to bigu.edu. With a successful return, the SIP URI may be re-written to sip:bigcheese@sipserver1.bigu.edu.
that is definitely not the right behavior. dns srv + a lookup results destination ip address where request it sent, not domain for the request uri.
-- juha
kevin,
just to add to your problem, i haven't seen it because i use gws that can add different domain parts to invites to different numbers.
perhaps you should switch to better gws.
-- juha
We control gws but don't want to rewrite based on each e164 number as number series is not divided into groups (per hundred etc.). /Kev/
Juha Heinanen wrote:
kevin,
just to add to your problem, i haven't seen it because i use gws that can add different domain parts to invites to different numbers.
perhaps you should switch to better gws.
-- juha
I think what I'll do is insert the full uri into contact on alias table for every user then then do a lookup on this at first to rewrite the ruri (ie. E164 -> uri translation). If the user is not in this table then it's "unknown" the following failures to lookup location will be offline subs so they can go to voicemail.
Thanks all for pointers /Kev/
Juha Heinanen wrote:
Kevin Brennan writes:
We control gws but don't want to rewrite based on each e164 number as number series is not divided into groups (per hundred etc.). /Kev/
in that case, my suggestion on a new radius_does_uri_user_exist() function would solve your problem.
-- juha