Hi Sam,

what version of openser are you using?

try to print the content of the $di pv:
   xlog("---$di\n");

also note, that uac_replace_from() takes as param any kind of pv, so you can directly write: uac_replace_from("$di");
regards,
bogdan

Sam Lee wrote:

Hey Bogdan,

Thanks for replying.
Can you help me check my statement ?

avp_printf("i:678","$di");
uac_replace_from("$avp(i:678)");

I am trying to replace the FROM hdr using the URI in Diversion hdr.

It ends up as NULL when the SIP packet was mangled. Looks like $di is
empty.

Regards,
Sam

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:[EMAIL PROTECTED] Sent: Friday, February 02, 2007 5:02 PM
To: Sam Lee
Cc: Greg Fausak; [email protected]
Subject: Re: [Users] Hijack 'Move Temporarily'

Hi Sam,

what hdr you need to extract the uri from? maybe there are pseudo
variables available and you do not need to use regexp.
For example, you have $di for diversion URI. See:
http://www.openser.org/dokuwiki/doku.php/pseudovariables:devel#diversion
_header_uri

regards,
bogdan

Sam Lee wrote:

Hey Greg,

The regex doesn't seem to work for me.
Any ideas ?

Regards,
Sam

-----Original Message-----
From: Greg Fausak [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 31, 2007 11:42 AM
To: Sam Lee
Cc: Bogdan-Andrei Iancu; [email protected]
Subject: Re: [Users] Hijack 'Move Temporarily'


On Jan 30, 2007, at 8:34 PM, Sam Lee wrote:



Hey guys,

I'm not a particular big fan of regular expressions.. But need to use it now.

If I have a string eg <abcde> fghij

/.*<(.*)>.*/\1/

I can never remember the variants. Sometimes you need to escape the parens, like:

/.*<\(.*\)>.*/\1/

Sometimes you use $1 instead of \1, like:

/.*<(.*)>.*/$1/

-g


How / what is the regex to extract strings within the bracket (everything else not needed). I just need to extract stuff from within


the brackets.

Thanks a million !

Regards,
Sam




_______________________________________________
Users mailing list
[email protected]
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to