Regex to get value in deploy

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
cdouglas
Posts: 24
Joined: Wed Jun 15, 2005 7:58 am

Regex to get value in deploy

Post by cdouglas »

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/ ... terns.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
james
Posts: 501
Joined: Mon Dec 10, 2007 12:56 pm

Post by james »

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.
cdouglas
Posts: 24
Joined: Wed Jun 15, 2005 7:58 am

Post by cdouglas »

thank you, very simple, not sure why I didn't think of that.
Post Reply