<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Holy cow! you made my day....<br><br>Thank you so much... It works great!!! <br><br>S. <br><br><hr id="stopSpelling">From: mdeneen@gmail.com<br>Date: Tue, 17 May 2011 17:02:55 -0400<br>To: asterisk-users@lists.digium.com<br>Subject: Re: [asterisk-users] script to trim sip.conf<br><br><div class="ecxgmail_quote">On Tue, May 17, 2011 at 4:21 PM, satish patel <span dir="ltr"><<a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a>></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
Hey Guys! <br><br>Sorry i am posting scripting question in asterisk forum but i had no choice. also i am not script expert so i though anyone here might help me. <br><br>following is my example sip.conf now i want to add accountcode="<callerid_name>" for example accountcode="Katie Wilson" in entire file. we have around 200 extension could someone help me to figure out how to do that with perl script or shell would be fine.<br>
<br>[100](seb-exten)<br>callerid="Katie Wilson" <100><br>mailbox=100@default<br><br>[200](seb-exten)<br>callerid="Ramona Minero" <200><br>mailbox=200@default<br></div></blockquote><div><br>
</div><div>Satish,</div><div><br></div><div>Give this a shot:</div><div><br></div><div>cat sip.conf | perl -pi -e "s/^callerid=\"(.*)\" <(.*)>/callerid=\"\$1\" <\$2>\naccountcode=\"\$1\"/" > sip.conf.new </div>
<div><br></div><div>and compare them.</div><div> </div></div>
<br>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users                                            </body>
</html>