Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Regex to get value in deploy
Author Message
cdouglas
Brekeke Member


Joined: 15 Jun 2005
Posts: 24

PostPosted: Tue Mar 18, 2008 11:04 am    Post subject: Regex to get value in deploy Reply with quote

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
View user's profile
james
Brekeke Master Guru


Joined: 10 Dec 2007
Posts: 494

PostPosted: Wed Mar 19, 2008 6:26 pm    Post subject: Reply with quote

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
View user's profile
cdouglas
Brekeke Member


Joined: 15 Jun 2005
Posts: 24

PostPosted: Wed Mar 26, 2008 5:48 am    Post subject: Reply with quote

thank you, very simple, not sure why I didn't think of that.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1