1. Brekeke Product Name and Version:BSS Adv Ver 3.5.2
2. Java version:1.8
3. OS type and the version:RHEL 6.1
4. UA (phone), gateway or other hardware/software involved:SIPP
5. Your problem:
I need to save the value in a variable and use the variable in the next dial plan.
In the first dial plan, I want to run a webget and retrieve the value from a remote server. If the returned value is 404 then I want to get the action to 404. In the next dial plan I want to check if returned value is 503 then I want to set the action as 503. If the length of the retuened value is more than 3 then I wan to terminate the call as explain in the last dial plan.
Matching Patterns
$addr = 192.168.2.180
$request =^INVITE
To = sip:(.+)@
From = sip:(.+)@
$web.webget("http://192.168.2.100/getValue.php?param1=%1") = (.+)
Deploy Patterns
$myVariable = %3
$log = TEST-VARIABLE:$myVariable
$log = TEST:%3
$continue
Matching Patterns
$myVariable = 404
Deploy Patterns
$action = 404
Matching Patterns
$myVariable = 503
Deploy Patterns
$action = 503
Matching Patterns
$math.gt($str.length($myVariable),3) = true
Deploy Patterns
To =sip:$myVariable@192.168.2.130
2. Java version:1.8
3. OS type and the version:RHEL 6.1
4. UA (phone), gateway or other hardware/software involved:SIPP
5. Your problem:
I need to save the value in a variable and use the variable in the next dial plan.
In the first dial plan, I want to run a webget and retrieve the value from a remote server. If the returned value is 404 then I want to get the action to 404. In the next dial plan I want to check if returned value is 503 then I want to set the action as 503. If the length of the retuened value is more than 3 then I wan to terminate the call as explain in the last dial plan.
Matching Patterns
$addr = 192.168.2.180
$request =^INVITE
To = sip:(.+)@
From = sip:(.+)@
$web.webget("http://192.168.2.100/getValue.php?param1=%1") = (.+)
Deploy Patterns
$myVariable = %3
$log = TEST-VARIABLE:$myVariable
$log = TEST:%3
$continue
Matching Patterns
$myVariable = 404
Deploy Patterns
$action = 404
Matching Patterns
$myVariable = 503
Deploy Patterns
$action = 503
Matching Patterns
$math.gt($str.length($myVariable),3) = true
Deploy Patterns
To =sip:$myVariable@192.168.2.130