Hi, after a large discussion in sip-implementros maillist I realize that a proxy/location server shouldn't reply "404" if a callee DOES exist but it's not registered in that moment.
In fact:
480 Temporarily Unavailable [...] This status is also returned by a redirect or proxy server that recognizes the user identified by the Request-URI, but does not currently have a valid forwarding location for that user.
404 Not Found The server has definitive information that the user does not exist at the domain specified in the Request-URI. [...]
Why then every body suggest to reply "404 Not Found" when "lookup(location)" returns -1? For example, the "registrar" module doc suggests it:
Example 1-22. lookup usage lookup("location"); switch ($?) { case -1: case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; };
Best regards.
El Wednesday 05 March 2008 11:04:04 Iñaki Baz Castillo escribió:
Why then every body suggest to reply "404 Not Found" when "lookup(location)" returns -1? For example, the "registrar" module doc suggests it:
Example 1-22. lookup usage lookup("location"); switch ($?) { case -1: case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; };
IMHO it should be:
if ( ! does_uri_exist()) { ## User doesn't exit here. sl_send_reply("404", "Not Found"); exit; }
if ( ! lookup("location")) { ## User does exist, but it not registered now. sl_send_reply("480", "Not Available Now"); exit; }
Hi Iñaki, my consideration on 404/480 responses comes both from RFC 3261 and from the RFC 3398 (Integrated Services Digital Network (ISDN) User Part (ISUP) to Session Initiation Protocol (SIP) Mapping)
ISUP Cause value SIP response ---------------- ------------ 1 unallocated number 404 Not Found 2 no route to network 404 Not found 3 no route to destination 404 Not found
19 no answer from the user 480 Temporarily unavailable 20 subscriber absent 480 Temporarily unavailable
Anyway it seems that the best practise is to send 404 both cases, but I prefer to distinguish this two situatations.
Cosimo Fadda
Iñaki Baz Castillo ha scritto:
El Wednesday 05 March 2008 11:04:04 Iñaki Baz Castillo escribió:
Why then every body suggest to reply "404 Not Found" when "lookup(location)" returns -1? For example, the "registrar" module doc suggests it:
Example 1-22. lookup usage lookup("location"); switch ($?) { case -1: case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; };
IMHO it should be:
if ( ! does_uri_exist()) { ## User doesn't exit here. sl_send_reply("404", "Not Found"); exit; }
if ( ! lookup("location")) { ## User does exist, but it not registered now. sl_send_reply("480", "Not Available Now"); exit; }
El Wednesday 05 March 2008 11:43:09 Cosimo Fadda escribió:
Hi Iñaki, my consideration on 404/480 responses comes both from RFC 3261 and from the RFC 3398 (Integrated Services Digital Network (ISDN) User Part (ISUP) to Session Initiation Protocol (SIP) Mapping)
About it, I got a very good response in sip-implementators maillist:
"A UAS should not in general know whether it has been called by a gateway or some other sip device. And so it should not be adjusting its responses based on the kind of thing it thinks is calling. The response returned by the UAS should best reflect the condition at the UAS. The purpose of specs like 3398 is to specify how the sip codes should be mapped to/from the pstn by gateways, not to specify how other sip devices should behave."
ISUP Cause value SIP response
1 unallocated number 404 Not Found 2 no route to network 404 Not found 3 no route to destination 404 Not found
19 no answer from the user 480 Temporarily unavailable 20 subscriber absent 480 Temporarily unavailable
Anyway it seems that the best practise is to send 404 both cases, but I prefer to distinguish this two situatations.
I don't know why you think is best to reply 404 in both cases, in fact, if I reply with 404 then the caller PSTN provider will receive a "unallocated number" so it will playback an early media message like: "The number you are calling doesn't exist" (that's obviously false, it does exist but it's disconnected now).
But finally you use 404 and 480 ;)
Best regards.
Iñaki Baz Castillo napsal(a):
Hi, after a large discussion in sip-implementros maillist I realize that a proxy/location server shouldn't reply "404" if a callee DOES exist but it's not registered in that moment.
In fact:
480 Temporarily Unavailable [...] This status is also returned by a redirect or proxy server that recognizes the user identified by the Request-URI, but does not currently have a valid forwarding location for that user.
404 Not Found The server has definitive information that the user does not exist at the domain specified in the Request-URI. [...]
Why then every body suggest to reply "404 Not Found" when "lookup(location)" returns -1? For example, the "registrar" module doc suggests it:
Example 1-22. lookup usage lookup("location"); switch ($?) { case -1: case -3: sl_send_reply("404", "Not Found"); exit; case -2: sl_send_reply("405", "Not Found"); exit; };
Best regards.
Hi Iñaki,
at least in Czech Republic there are TSPs which replay with 480 :-) On the other side: one TSP - in case he receives 480 - sends INVITE again and again till you don't send him 404,486,5xxx,6xx :-(
Just my 2c...
kokoska.rokoska
El Wednesday 05 March 2008 11:38:25 kokoska rokoska escribió:
at least in Czech Republic there are TSPs which replay with 480 :-)
Great :)
On the other side: one TSP - in case he receives 480 - sends INVITE again and again till you don't send him 404,486,5xxx,6xx :-(
Ops, but it's a wrong implementation I understand.
Regards.