A computer-implemented method for modifying a Session Initiation Protocol SIP message, at a session border controller SBC or other internet appliance that handle SIP messages, said message being included in a series of SIP messages associated with a SIP message flow comprising: providing a scripting-type computer programming language with contexts that reference pre-defined portions of data of a SIP message and variables for storing data associated with a particular SIP message flow; providing a user interface for creating, modifying, or deleting one or more rules via the scripting language by an end user, wherein the rules are executed when processing one or more SIP messages in the SIP message flow, and wherein each of the one or more rules includes at least one action, the action describing a modification to be made to a particular SIP message in the SIP message flow; receiving, by at least one or more processors, a particular SIP message included in the series of SIP messages; parsing the particular SIP message to determine one or more contexts corresponding to one or more particular portions of the particular SIP message, the parsing including associating a particular portion of the particular SIP message with a particular pre-defined context; determining whether criteria associated with each rule applies to at least the data referenced by one of the contexts; and when data referenced by a particular context meets the criteria associated with a particular rule, modifying the particular SIP message based on the one or more actions associated with the particular rule characterized in that the method comprises receiving, via the user interface, from an end user, a rule for modification of a SIP message based on data stored from previous SIP message processing in response to determining that data referenced by a particular context meets the criteria associated with a particular rule, storing data from the particular SIP message to a variable associated with a memory location based on the one or more actions associated with the particular rule; and modifying a subsequent SIP message in the series of SIP messages associated with the SIP message flow according to the received rule for modification of a SIP message based on data stored from previous SIP message processing. providing a scripting-type computer programming language with contexts that reference pre-defined portions of data of a SIP message and variables for storing data associated with a particular SIP message flow; providing a user interface for creating, modifying, or deleting one or more rules via the scripting language by an end user, wherein the rules are executed when processing one or more SIP messages in the SIP message flow, and wherein each of the one or more rules includes at least one action, the action describing a modification to be made to a particular SIP message in the SIP message flow; receiving, by at least one or more processors, a particular SIP message included in the series of SIP messages; parsing the particular SIP message to determine one or more contexts corresponding to one or more particular portions of the particular SIP message, the parsing including associating a particular portion of the particular SIP message with a particular pre-defined context; determining whether criteria associated with each rule applies to at least the data referenced by one of the contexts; and when data referenced by a particular context meets the criteria associated with a particular rule, modifying the particular SIP message based on the one or more actions associated with the particular rule