On Tue, Jul 6, 2010 at 9:19 AM, Premalatha Kuppan <span dir="ltr"><<a href="mailto:premalatha@ngintech.com">premalatha@ngintech.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
My Purpose:<br><br>1. At Opensips, iam getting registration request as sip:aaa_bbb_cc@domain.<br>So, i need to parse this "username: aaa_bbb_ccc" and store it in MySQL DB as aaa,bbb,ccc against the coulmn a,b,c.<br>
<br>2. When user is registred, the URL has to be parsed and stored. During de-registration corresponding entries from the MYSQL table should be deleted.<br><br>3. In test.sh: iam parsing the username e.g "aaa_bbb_ccc" and rewriting it as "aaa","bbb","ccc" and storing it in MySQL DB.<br>
<br>Now to integrate with OpenSIPS as a fisrt step during registration , iam using exec_msg to execute this test.sh.<br><br>Is there any other solution, i can do it. ?<br><br></blockquote><div><br></div><div>Ok, well the registrar module has a lot of mechanism to store registrations already. So I'd definitely look at using those. For your custom parsing needs, I'd look at using the "select" pseudo-var transformation.... You'll need to check on the exact syntax, but it'll be something like:</div>
<div><br></div><div>$(rU{s.select,1,_}) # is bbb</div><div><br></div><div>Then you can use avp_db_query to push that direct to the database like:</div><div><br></div><div>avp_db_query("INSERT INTO MyFunnyRegistration VALUES($(rU{s.select,0,_}),$(rU{s.select,1,_}),$(rU{s.select,2,_}));</div>
<div><br></div><div><br></div><div>That should get you going on something. :)</div><div>-Brett</div><div><br></div></div>