Author |
Message |
cdouglas Brekeke Member
Joined: 15 Jun 2005 Posts: 24
|
Posted: Tue Mar 18, 2008 11:04 am Post subject: Regex to get value in deploy |
|
|
1. Brekeke Product Name and version:
sip proxy 2.1.6.6.
2. Java version:
3. OS type and the version:
Linux
4. UA (phone), gateway or other hardware/software involved:
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html :
6. Your problem:
I am using the webget function to return an XML doc back to the dialplan. i then want to parse the XML in the deploy to get each of the elements out into separate variables. Does anyone know what the syntax to do this is? I am trying to keep from calling webget more than once.
Value passed to deploy in %3 = <number>12345</number><name>Fred</name>
run function to set $to_number = 12345 and $to_name=Fred
I was told by support that this is possible, but they wouldn't elaborate.
Thanks
Chris |
|
Back to top |
|
james Brekeke Master Guru
Joined: 10 Dec 2007 Posts: 495
|
Posted: Wed Mar 19, 2008 6:26 pm Post subject: |
|
|
It will be like the following.
$webget( "http://www.domain.com/", "(<number>.+</number><name>.+</name>)" ) = <number>(.+)</number><name>(.+)</name>
In the Deploy Patterns, %1 is number and %2 is name. |
|
Back to top |
|
cdouglas Brekeke Member
Joined: 15 Jun 2005 Posts: 24
|
Posted: Wed Mar 26, 2008 5:48 am Post subject: |
|
|
thank you, very simple, not sure why I didn't think of that. |
|
Back to top |
|
|