Hello:
I'm trying to load a number from MySQL, check that number to insure it matches "appropriate" syntax then replace the username part of the RURI with this new string.
I've tried several things without success. Does anyone have any suggestions on how this can be accomplished.
I successfully load a numeric string (a telephone number) from the usr_preferences table. I'd like to check if this value is a five digit extension, eleven digit local number (preficed with a 9), or some other type of call.
One approach I used follows. This fails with a syntax error.
avp_write("^sip:[3468][0-9]{4}", "$callmatch"); if (avp_check("$calltype","re/$callmatch/g)) { avp_write("oncampus", "$calltype"); xlog("L_INFO", "\n[SER]: call type: ONCAMPUS \n"); };
I've also tried embedding the regular expression in the if construct without success.
Any thoughts?
Thanks,Steve