Convert this file over the new method of getting the Asterisk version.
authorRussell Bryant <russell@russellbryant.com>
Sat, 5 Jan 2008 23:05:35 +0000 (23:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 5 Jan 2008 23:05:35 +0000 (23:05 +0000)
(I don't have this building on this machine, so caio1982 on IRC is going to
 test it for me.  :) )

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@96743 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/snmp/agent.c

index 65f0fd4..207acb8 100644 (file)
@@ -731,10 +731,13 @@ static u_char *ast_var_Version(struct variable *vp, oid *name, size_t *length,
 
        switch (vp->magic) {
        case ASTVERSTRING:
-               *var_len = strlen(ASTERISK_VERSION);
-               return (u_char *)ASTERISK_VERSION;
+       {
+               const char *version = ast_get_version();
+               *var_len = strlen(version);
+               return (u_char *)version;
+       }
        case ASTVERTAG:
-               long_ret = ASTERISK_VERSION_NUM;
+               sscanf(ast_get_version_num(), "%lu", &long_ret);
                return (u_char *)&long_ret;
        default:
                break;