by Alexandre Ribeiro.
thanks for your help,
the problem was with the function name and method. Also with the file name, i had "external.php" because i follow a toturial, but i see in moodle code that it looks for externallib.php so its another fix that i made.
anyway now its working fine