Hi,

On 05/01/2012 07:42 PM, Sébastien Cramatte wrote:
Hello,

I'm trying to setup a lab for sbc  prepaid module.  Currently I've
loaded  sbc, cc_acc and xmlrpc2di

Searching google I've seen that some script are required to manage
internal database of cc_acc module:

sems-acc-add-credit, sems-acc-get-credit, sems-acc-set-credit,
sems-acc-subtract-credit
I expect you got these scripts from the mailing list, right?
http://lists.iptel.org/pipermail/sems/2011-August/003867.html


When I try to execute one off them I obtain some

# ./sems-acc-add-credit test1 500
Active calls: 0
Traceback (most recent call last):
   File "./sems-acc-add-credit", line 13, in<module>
     print s.addCredit(sys.argv[1], sys.argv[2])
   File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
     return self.__send(self.__name, args)
   File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
     verbose=self.__verbose
   File "/usr/lib/python2.6/xmlrpclib.py", line 1253, in request
     return self._parse_response(h.getfile(), sock)
   File "/usr/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response
     return u.close()
   File "/usr/lib/python2.6/xmlrpclib.py", line 838, in close
     raise Fault(**self._stack[0])
xmlrpclib.Fault:<Fault 300: 'Exception: Type mismatch in arguments.'>
root@km1:/usr/local/sbin#
from SEMS log, you could see:
[#7f7f0ed92700/23154] [execute, XMLRPC2DI.cpp:488] DEBUG: XMLRPC2DI: calls = 0 [#7f7f0ed92700/23154] [execute, XMLRPC2DI.cpp:542] DEBUG: XMLRPC2DI: factory 'cc_acc' function 'setCredit' [#7f7f0ed92700/23154] [invoke, CCAcc.cpp:42] DEBUG: cc_acc: setCredit(['test1', '500']) [#7f7f0ed92700/23154] [invoke, CCAcc.cpp:59] ERROR: type mismatch: expected: 1; received: 4.

SEMS expects integer value for the credit, so in your python script, just convert the string to int:
print s.di('cc_acc','setCredit', sys.argv[1], int(sys.argv[2]))

[#7f7f0ea8f700/23157] [execute, XMLRPC2DI.cpp:488] DEBUG: XMLRPC2DI: calls = 0 [#7f7f0ea8f700/23157] [execute, XMLRPC2DI.cpp:542] DEBUG: XMLRPC2DI: factory 'cc_acc' function 'setCredit' [#7f7f0ea8f700/23157] [invoke, CCAcc.cpp:42] DEBUG: cc_acc: setCredit(['test1', 500])


hth,
-Vladimir


Can anybody can give me some clue to get this up and running ?

Best regards
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to