From: ivan Date: Fri, 3 Jun 2011 16:33:01 +0000 (+0000) Subject: escape ("percent-encode") : and @ in netsapeins URLs, RT#12447 X-Git-Tag: freeside_2_3_0~183 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=d55b0bcfea714c60d87c68ad24741fbeba6cd74b escape ("percent-encode") : and @ in netsapeins URLs, RT#12447 --- diff --git a/FS/FS/part_export/netsapiens.pm b/FS/FS/part_export/netsapiens.pm index 83f0f0184..285db7e6b 100644 --- a/FS/FS/part_export/netsapiens.pm +++ b/FS/FS/part_export/netsapiens.pm @@ -1,7 +1,8 @@ package FS::part_export::netsapiens; use vars qw(@ISA $me %info); -use URI; +use URI; #needed? +use URI::Escape; use MIME::Base64; use Tie::IxHash; use FS::part_export; @@ -90,7 +91,7 @@ sub ns_registrar { my($self, $svc_phone) = (shift, shift); $self->ns_subscriber($svc_phone). - '/registrar_config/'. $self->ns_devicename($svc_phone); + '/registrar_config/'. uri_escape($self->ns_devicename($svc_phone)); } sub ns_devicename { @@ -111,7 +112,7 @@ sub ns_dialplan { my $phonenum = $svc_phone->phonenum; #"/dialplans/DID+Table/dialplan_config/sip:$countrycode$phonenum\@*" - "/dialplans/DID+Table/dialplan_config/sip:$phonenum\@*" + "/dialplans/DID+Table/dialplan_config/". uri_escape("sip:$phonenum\@*") } sub ns_device { @@ -246,8 +247,7 @@ sub export_device_insert { my $domain = $self->ns_domain($svc_phone); my $countrycode = $svc_phone->countrycode; my $phonenum = $svc_phone->phonenum; - - my $device = $self->ns_devicename($svc_phone); + #my $device = $self->ns_devicename($svc_phone); my $ns = $self->ns_device_command( 'PUT', $self->ns_device($svc_phone, $phone_device),