Return error if q931_notify() cannot send NOTIFY.

git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2167 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Richard Mudgett 2010-12-14 01:09:57 +00:00
parent b79b886fc4
commit cea6d541df

7
q931.c
View File

@ -4808,15 +4808,16 @@ int q931_notify(struct pri *ctrl, q931_call *c, int channel, int info)
break; break;
default: default:
if ((info > 0x2) || (info < 0x00)) { if ((info > 0x2) || (info < 0x00)) {
return 0; return -1;
} }
break; break;
} }
if (info >= 0) { if (info >= 0) {
info = info & 0x7F; info &= 0x7F;
} else { } else {
info = -1; /* Cannot send NOTIFY message if the mandatory ie is not going to be present. */
return -1;
} }
return q931_notify_redirection(ctrl, c, info, NULL); return q931_notify_redirection(ctrl, c, info, NULL);
} }