lib/imperituroard/phpipamcps.rb in imperituroard-0.1.5 vs lib/imperituroard/phpipamcps.rb in imperituroard-0.1.7
- old
+ new
@@ -117,10 +117,12 @@
answer = response.to_hash[:change_subscriber_avps_response][:error_code]
end
def change_attr_cps(old_msisdn, new_msisdn)
+ ans = ""
+
current = get_current_attributes(old_msisdn)
attr_act = ["FRAMED-IP-ADDRESS", "FRAMED-NETMASK", "Default-Gateway", "VRF-ID", "DHCP-CLASS", "IPV4-UNNUMB", "FRAMED-ROUTE-1"]
res_list= []
for j in current
@@ -130,13 +132,18 @@
end
added_res = add_attribute(res_list, new_msisdn)
if added_res == "0"
- del_attribute(old_msisdn)
+ ans = del_attribute(old_msisdn)
+ p ans
end
+ if ans == "0"
+ "ok"
+ else
+ "error"
+ end
+
end
-
end
-