[Asterisk-cvs] libpri q931.c,1.75,1.76
markster at lists.digium.com
markster at lists.digium.com
Wed Jun 16 18:33:18 CDT 2004
Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv3216
Modified Files:
q931.c
Log Message:
Handle DISC and REL with missing mandatory information elements
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- q931.c 16 Jun 2004 18:25:35 -0000 1.75
+++ q931.c 16 Jun 2004 22:19:11 -0000 1.76
@@ -2223,6 +2223,9 @@
pri_message("NEW_HANGUP DEBUG: Calling q931_hangup, ourstate %s, peerstate %s\n",callstate2str(c->ourcallstate),callstate2str(c->peercallstate));
if (!pri || !c)
return -1;
+ /* If mandatory IE was missing, insist upon that cause code */
+ if (c->cause == PRI_CAUSE_MANDATORY_IE_MISSING)
+ cause = c->cause;
if (cause == 34 || cause == 44 || cause == 82 || cause == 1 || cause == 81) {
/* We'll send RELEASE_COMPLETE with these causes */
disconnect = 0;
@@ -2731,8 +2734,8 @@
break;
case Q931_RELEASE:
if (missingmand) {
- q931_release_complete(pri, c, PRI_CAUSE_MANDATORY_IE_MISSING);
- break;
+ /* Force cause to be mandatory IE missing */
+ c->cause = PRI_CAUSE_MANDATORY_IE_MISSING;
}
if (c->ourcallstate == Q931_CALL_STATE_RELEASE_REQUEST)
c->peercallstate = Q931_CALL_STATE_NULL;
@@ -2754,8 +2757,8 @@
break;
case Q931_DISCONNECT:
if (missingmand) {
- q931_release(pri, c, PRI_CAUSE_MANDATORY_IE_MISSING);
- break;
+ /* Still let user call release */
+ c->cause = PRI_CAUSE_MANDATORY_IE_MISSING;
}
if (c->newcall) {
q931_release_complete(pri,c,PRI_CAUSE_INVALID_CALL_REFERENCE);
More information about the svn-commits
mailing list