[freeside-commits] freeside/FS/FS/part_export phone_sqlopensips.pm, 1.2, 1.3

Erik Levinson levinse at wavetail.420.am
Mon Jan 17 18:19:38 PST 2011


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv1810/FS/FS/part_export

Modified Files:
	phone_sqlopensips.pm 
Log Message:
OpenSIPS provisioning improvements, RT10993

Index: phone_sqlopensips.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/phone_sqlopensips.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- phone_sqlopensips.pm	16 Jan 2011 03:33:59 -0000	1.2
+++ phone_sqlopensips.pm	18 Jan 2011 02:19:36 -0000	1.3
@@ -29,14 +29,23 @@
 
 sub _export_insert {
   my($self, $svc_x) = (shift, shift);
+
+  my $conf = new FS::Conf;
+  my $agentnum = $svc_x->cust_svc->cust_pkg->cust_main->agentnum || 0;
+  my $gwlist = $conf->config('opensips_gwlist',$agentnum) 
+		|| $svc_x->phone_name;
+  my $description = $conf->config('opensips_description',$agentnum)
+		|| $svc_x->gwlist;
+  my $route = $conf->config('opensips_route',$agentnum) || $svc_x->route;
+
   my $dbh = $self->opensips_connect;
   my $sth = $dbh->prepare("insert into dr_rules ".
 	    "( groupid, prefix, timerec, routeid, gwlist, description ) ".
 	    " values ( ?, ?, ?, ?, ?, ? )") or die $dbh->errstr;
-  $sth->execute('0',$svc_x->phonenum,'',$svc_x->route,$svc_x->gwlist,
-		$svc_x->phone_name) or die $sth->errstr;
+  $sth->execute('0',$svc_x->phonenum,'',$route,$gwlist,
+		$description) or die $sth->errstr;
   $dbh->disconnect;
-  $self->dr_reload;
+  $self->dr_reload; # XXX: if this fails, do we delete what we just inserted?
 }
 
 sub opensips_connect {
@@ -46,6 +55,10 @@
 }
 
 sub _export_replace {
+    # disabled the below for now as we went with a agent-virtualized config for the params
+return '';
+
+
   my( $self, $new, $old ) = (shift, shift, shift);
     my @update = ();
     my @paramvalues = ();
@@ -95,7 +108,7 @@
     or die $dbh->errstr;
   $sth->execute($svc_x->phonenum) or die $sth->errstr;
   $dbh->disconnect;
-  $self->dr_reload;
+  $self->dr_reload; # XXX: if this fails, do we re-insert what we just deleted?
 }
 
 sub dr_reload {



More information about the freeside-commits mailing list