All pastes #811003 Raw Edit

Untitled

public text v1 · immutable
·published 2007-12-10 14:46 UTC
rendered paste body
Looking into using regex to match up / parse each portion of a client server dialog as shown below. In Example 1, I am interested in creating a regex that will allow me to replace the 4 variables (Action,Channel,Timeout,ActionID) with values and then send to the server. I then want a regular expression that will attempt to match up any responses such that it will find Response: Success, Message: Timeout Set.... Additionally, I want to replace the ActionID in the response regex with the action ID i sent in my request.

Example 1

Action: AbsoluteTimeout
Channel: SIP/testphone-10210698
Timeout: 15
ActionID: 12345

Response: Success
Message: Timeout Set
ActionID: 12345


Example 2

Action: ExtensionState
Exten: 200
Context: lab
ActionID: 54321

Response: Success
ActionID: 54321
Message: Extension Status
Exten: 200
Context: lab
Hint: SIP/testphone
Status: 0