[OpenSIPS-Devel] [ opensips-Feature Requests-3512070 ] sipmsg_validate multiple return values

SourceForge.net noreply at sourceforge.net
Thu Mar 29 12:02:42 CEST 2012


Feature Requests item #3512070, was opened at 2012-03-27 12:09
Message generated for change (Comment added) made by razvancrainea
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3512070&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: trunk
>Status: Closed
Priority: 5
Private: No
Submitted By: Ryan Bullock (rrb3942)
Assigned to: Razvan Crainea (razvancrainea)
Summary: sipmsg_validate multiple return values

Initial Comment:
It would be helpful if sipmsg_validate returned a different value based on flags used and what in the message was no compliant.

For instance, calling sipmsg_validate("sh") could return -1 if the request is not RFC3261 Compliant, -2 if header validation failed, and -3 if SDP body validation failed. This way the script writer could use a switch statement to return a more exact response without multiple calls to sipmsg_validate().

Example idea of usage:

if (!sipmsg_validate("sh")) {
    switch($retcode) {
         case -1:
                 send_reply("400", "Not RFC3261 Compliant");
         break;
         case -2:
                send_reply("400", "Bad Header Body");
         break;
         case -3:
                send_reply("400", "Bad SDP");
         break;
         default:
                send_reply("400", "Bad Request");
    }

    exit;
}

----------------------------------------------------------------------

>Comment By: Razvan Crainea (razvancrainea)
Date: 2012-03-29 03:02

Message:
Hi, Ryan!

I have just added this enhancement in the trunk svn, revision #8880.

Regards,
Răzvan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086413&aid=3512070&group_id=232389



More information about the Devel mailing list