Index: asterisk/res/res_osp.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_osp.c,v retrieving revision 1.17 diff -u -r1.17 res_osp.c --- asterisk/res/res_osp.c 10 Jul 2005 23:21:39 -0000 1.17 +++ asterisk/res/res_osp.c 1 Sep 2005 14:37:13 -0000 @@ -504,6 +504,7 @@ char tmp[256]="", *l, *n; OSPTCALLID *callid; OSPE_DEST_PROT prot; + OSPE_DEST_OSP_ENABLED ospenabled; result->handle = -1; result->numresults = 0; @@ -566,7 +567,12 @@ ast_log(LOG_DEBUG, "Got destination '%s' and called: '%s' calling: '%s' for '%s' (provider '%s')\n", destination, callednum, callingnum, extension, provider); do { - ast_base64encode(result->token, token, tokenlen, sizeof(result->token) - 1); + if (!OSPPTransactionIsDestOSPEnabled (result->handle, &ospenabled) && (ospenabled == OSPE_OSP_FALSE)) { + result->token[0] = 0; + } + else { + ast_base64encode(result->token, token, tokenlen, sizeof(result->token) - 1); + } if ((strlen(destination) > 2) && !OSPPTransactionGetDestProtocol(result->handle, &prot)) { res = 1; /* Strip leading and trailing brackets */ @@ -635,6 +641,7 @@ char destination[2048]=""; char token[2000]; OSPE_DEST_PROT prot; + OSPE_DEST_OSP_ENABLED ospenabled; result->tech[0] = '\0'; result->dest[0] = '\0'; @@ -649,7 +656,12 @@ result->numresults--; if (!OSPPTransactionGetNextDestination(result->handle, OSPC_FAIL_INCOMPATIBLE_DEST, 0, NULL, NULL, &timelimit, &callidlen, uniqueid, sizeof(callednum), callednum, sizeof(callingnum), callingnum, sizeof(destination), destination, 0, NULL, &tokenlen, token)) { - ast_base64encode(result->token, token, tokenlen, sizeof(result->token) - 1); + if (!OSPPTransactionIsDestOSPEnabled (result->handle, &ospenabled) && (ospenabled == OSPE_OSP_FALSE)) { + result->token[0] = 0; + } + else { + ast_base64encode(result->token, token, tokenlen, sizeof(result->token) - 1); + } if ((strlen(destination) > 2) && !OSPPTransactionGetDestProtocol(result->handle, &prot)) { res = 1; /* Strip leading and trailing brackets */