[sr-dev] [kamailio/kamailio] lost: lost_held_dereference do not handles error message (#2724)

sergey-safarov notifications at github.com
Mon May 3 06:14:14 CEST 2021


Generally LIS code and error message also important for error handling. Error code may be used for `switch` statement and a message for log description for humans.
Here examples of LIS error messages
*from RFC*
```xml
<?xml version="1.0"?>
  <error xmlns="urn:ietf:params:xml:ns:geopriv:held" code="locationUnknown">
    <message xml:lang="en">Unable to determine location
  </message>
</error>
```
my use case
```xml
<?xml version="1.0" encoding="UTF-8"?>
<urn:error xmlns:urn="urn:ietf:params:xml:ns:geopriv:held" code="generalLisError">
  <urn:message>An unspecified error occurred while handling LocationRequest.</urn:message>
</urn:error>
```
So I can use a `switch` statement like
```
if ($var(res) == 200 && $var(res) > 203 ) {
  switch $(varLisErrorCode) {
    case "locationUnknown":
      xlog(L_ERR, "Received LIS error response: $(varLisErrorMessage)");
      route(TRY_DEFAULT_PSAP);
    case "generalLisError":
      xlog(L_ERR, "Received unexpected LIS error response: $(varLisErrorMessage)");
      route(TRY_OTHER_LOCATION_METHOD);
    default:
  }
}
```
For me more preferable to define module param `xavp_responce`
```
modparam("lost", "xavp_responce", "held_responce")
```
If `xavp_responce` defined then set keys.
1) HTTP_ERROR_CODE;
2) HELD_ERROR_CODE;
3) HELD_ERROR_MESSAGE.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2724#issuecomment-831009598
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210502/42788fa4/attachment-0001.htm>


More information about the sr-dev mailing list