--- chan_unicall.c.ori 2006-08-22 01:17:42.719685144 -0300 +++ chan_unicall.c 2006-08-22 01:37:37.451058368 -0300 @@ -8,6 +8,12 @@ * * Steve Underwood * Based on chan_zap.c by Mark Spencer + * + * Implementation of identify collect call from + * Romeu Medeiros + * + * Implementacao do indentificador de chamadas a cobrar por + * Romeu Medeiros * * This program is free software, distributed under the terms of * the GNU General Public License @@ -33,6 +39,7 @@ #include "asterisk.h" + ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/lock.h" @@ -55,6 +62,9 @@ #include "asterisk/dsp.h" #include "asterisk/utils.h" #include "asterisk/causes.h" +#include "asterisk/linkedlists.h" + + /* XXX @@ -2631,6 +2641,9 @@ { struct ast_channel *c; struct unicall_pvt *i; + + char cat[5]; + int ch; int ret; @@ -2703,7 +2716,9 @@ ev->offered.parms.originating_number, ev->offered.parms.destination_number, ev->offered.parms.calling_party_category); - if ((ch = ev->offered.channel) >= 0) + sprintf(cat,"%d",ev->offered.parms.calling_party_category); + pbx_builtin_setvar_helper(ev->offered.channel,"CAT",cat); + if ((ch = ev->offered.channel) >= 0) { /* Get caller ID */ if (i->use_callerid) @@ -2786,6 +2801,7 @@ ast_log(LOG_WARNING, "Dest '%s'\n", ev->offered.parms.destination_number); if ((ch = ev->offered.channel) >= 0) { + /* Get caller ID */ if (i->use_callerid) {