projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
665067c
)
add DID association w/user? docs from netsapiens rough... RT#5226
author
ivan
<ivan>
Tue, 30 Jun 2009 02:54:54 +0000
(
02:54
+0000)
committer
ivan
<ivan>
Tue, 30 Jun 2009 02:54:54 +0000
(
02:54
+0000)
FS/FS/part_export/netsapiens.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/netsapiens.pm
b/FS/FS/part_export/netsapiens.pm
index
172f7b0
..
22124e9
100644
(file)
--- a/
FS/FS/part_export/netsapiens.pm
+++ b/
FS/FS/part_export/netsapiens.pm
@@
-63,6
+63,15
@@
sub ns_subscriber {
"/domains_config/$domain/subscriber_config/$phonenum";
}
"/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);
sub ns_create_or_update {
my($self, $svc_phone, $dial_policy) = (shift, shift, shift);
@@
-80,6
+89,8
@@
sub ns_create_or_update {
$lastname = $cust_main->get('last');
}
$lastname = $cust_main->get('last');
}
+ #create user
+
my $ns = $self->ns_command( 'PUT', $self->ns_subscriber($svc_phone),
'subscriber_login' => $phonenum.'@'.$domain,
'firstname' => $firstname,
my $ns = $self->ns_command( 'PUT', $self->ns_subscriber($svc_phone),
'subscriber_login' => $phonenum.'@'.$domain,
'firstname' => $firstname,
@@
-94,6
+105,17
@@
sub ns_create_or_update {
join(', ', $self->ns_parse_response( $ns->responseContent ) );
}
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 ) );
+ }
+
'';
}
'';
}