[freeside-commits] freeside/FS/FS/part_export netsapiens.pm, 1.3, 1.4
Ivan,,,
ivan at wavetail.420.am
Mon Jun 29 19:54:56 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv31155
Modified Files:
netsapiens.pm
Log Message:
add DID association w/user? docs from netsapiens rough... RT#5226
Index: netsapiens.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/netsapiens.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- netsapiens.pm 31 May 2009 04:57:00 -0000 1.3
+++ netsapiens.pm 30 Jun 2009 02:54:54 -0000 1.4
@@ -63,6 +63,15 @@
"/domains_config/$domain/subscriber_config/$phonenum";
}
+sub ns_dialplan {
+ my($self, $svc_phone) = (shift, shift);
+
+ my $countrycode = $svc_phone->countrycode;
+ my $phonenum = $svc_phone->phonenum;
+
+ "/dialplans/DID+Table/dialplan_config/sip:$countrycode$phonenum@*"
+}
+
sub ns_create_or_update {
my($self, $svc_phone, $dial_policy) = (shift, shift, shift);
@@ -80,6 +89,8 @@
$lastname = $cust_main->get('last');
}
+ #create user
+
my $ns = $self->ns_command( 'PUT', $self->ns_subscriber($svc_phone),
'subscriber_login' => $phonenum.'@'.$domain,
'firstname' => $firstname,
@@ -94,6 +105,17 @@
join(', ', $self->ns_parse_response( $ns->responseContent ) );
}
+ #map DID to user
+ my $ns2 = $self->ns_command( 'PUT', $self->ns_dialplan($svc_phone),
+ 'to_user' => $phonenum.'@'.$domain,
+ 'to_host' => $domain,
+ );
+
+ if ( $ns2->responseCode !~ /^2/ ) {
+ return $ns2->responseCode. ' '.
+ join(', ', $self->ns_parse_response( $ns2->responseContent ) );
+ }
+
'';
}
More information about the freeside-commits
mailing list