Home > Archive Post, Asterisk > Installing and customising App Conference Vicidial

Installing and customising App Conference Vicidial

After getting App_conference working recently but after using it for a bit I found that it is a little TOO stripped down for my liking. It doesn’t do anything else besides put people into a conference. This may be fine for some people but I need more than that so I decided to check out the Vicidial version of app_conference that sends DTMFs to the Vicidial Manager. It also plays enter and exit sounds which I thought would be nice to have. I thought that if I could see what was receiving the DTMFs and sending them off to the Vicidial manager I could modify this and perform custom actions.

Well after getting the code for app_conference here and first attempted to compile it I got a few errors. I’m compiling on a Ubuntu Server with Asterisk already installed, see my previous post about what the pre-requisites are for app_conference. Some of the errors are below:

app_conference.c:51: warning: data definition has no type or storage class
app_conference.c:51: warning: type defaults to ‘int’ in declaration of ‘STANDARD_HANGUP_LOCALUSERS’
app_conference.c:52: warning: data definition has no type or storage class
app_conference.c:52: warning: type defaults to ‘int’ in declaration of ‘LOCAL_USER_DECL’
app_conference.c:55: warning: no previous prototype for ‘unload_module’
app_conference.c: In function ‘unload_module’:
app_conference.c:58: warning: passing argument 1 of ‘__ast_module_user_hangup_all’ from incompatible pointer type
app_conference.c: At top level:
app_conference.c:67: warning: no previous prototype for ‘load_module’
app_conference.c:80: warning: no previous prototype for ‘description’
app_conference.c:85: warning: no previous prototype for ‘usecount’
app_conference.c: In function ‘usecount’:
app_conference.c:87: warning: implicit declaration of function ‘STANDARD_USECOUNT’
app_conference.c: At top level:
app_conference.c:92: warning: no previous prototype for ‘key’
app_conference.c: In function ‘app_conference_main’:
app_conference.c:106: warning: implicit declaration of function ‘LOCAL_USER_ADD’
app_conference.c:112: warning: implicit declaration of function ‘LOCAL_USER_REMOVE’
app_conference.c:106: warning: ‘u’ is used uninitialized in this function
app_conference.c: In function ‘usecount’:
app_conference.c:87: warning: ‘res’ is used uninitialized in this function

Quite a few errors. After some Google’ing around I found that a lot of these errors were because the newer version of Asterisk no longer supported these variables/functions. I began to churn through the errors by going into app_conference.c, fixing them and recompiling.

Below are the steps I took to get the app_conference going

Replace ‘STANDARD_HANGUP_LOCALUSERS’ with
ast_module_user_hangup_all(); // defined in asterisk/module.h

struct localuser *u ; with
struct ast_module_user *u ;

LOCAL_USER_ADD( u ) ; with
u = ast_module_user_add(chan);

LOCAL_USER_REMOVE( u ) ; with
ast_module_user_remove(u);

place static before the ‘int’ & char for all methods with it except for app_conference main function.

Paste into the very bottom of app_conference main. This registers the Conference as an Asterisk module.

#define AST_MODULE “Conference”
AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY,
“Channel Independent Conference Application”);
#undef AST_MODULE

I’ve attached the new app_conference.c that I know definitely compiles to this post. After doing ‘make’ on the app_conference there are still a few warnings but they don’t matter. You’ll be left with app_conference.so. Copy this to /usr/lib/asterisk/modules. When you try to connect to the Asterisk CLI it will automatically shutdown as it spots a shared object that it previously didn’t have so you’re better off just doing /etc/init.d/asterisk restart and then joining the Asterisk CLI. Test if the module is present by typing show modules like conference and you should see it returned. If not something is wrong, you may need to add it in modules.conf so that its loaded at load time. Check out the Asterisk wiki for the Conference commands and how to run it – the version we’ve installed is down under the ‘app conference with VICIDIAL ‘ section but works well so far.

There is code in the process_incoming function in member.c that can be modified to allow dtmf actions. See the default below:

[code lang="c"]
if (
f->frametype == AST_FRAME_DTMF
&& member->send_dtmf
)
{ // send the DTMF event to the MGR interface..
manager_event(
EVENT_FLAG_CALL,
"ConferenceDTMF",
"Channel: %s\r\n"
"Key: %c\r\n",
member->channel_name,
f->subclass
) ;
[/code]

The default is to pass on the DTMF to the Vicidial manager but I’ve removed this and added in a menu system and allow the user quit out of the conference and will be adding some more features. The f->subclass contains the current DTMF pressed.

I’ve found one problem with this app at present. When audio is being played and we attempt to play another piece of audio on the same channel I get a whole bunch of repeated errors:

[Mar 10 06:47:17] WARNING[9898]: codec_gsm.c:144 gsmtolin_framein: Invalid GSM data (1)
[Mar 10 06:47:17] WARNING[9898]: translate.c:199 framein: gsmtolin did not update samples 0

This is caused as the app isn’t clever enough to realise that audio is already playing so just need to put a check in the play_basic_sound function but haven’t got round to doing this yet.

Categories: Archive Post, Asterisk Tags:
  1. Qusai
    May 1st, 2009 at 12:38 | #1

    Hello
    I modified Make file to point to include/asterisk and I did all the changes but when I do make I got a lot of errors like /usr/include/unistd.h:327: error: expected declaration specifiers or ‘…’ before ‘size_t’
    So please can you help me or mail me the new app_conference.c
    Thank you

  2. May 12th, 2009 at 00:26 | #2

    Hi,

    The blog posting that you’ve been following is quite old and I have moved companies in the meanwhile. I am now no longer working on Asterisk applications and so do not have a new app_conference to email you I’m afraid, all there is for you to go on is what I have on my blog I’m afraid.

    Sorry about taking so long to reply.

    Eddie

  1. No trackbacks yet.

Anti-Spam Protection by WP-SpamFree