Posted: Sun May 31, 2009 4:01 pm Post subject: [asterisk-dev] wanna be asterisk-dev
Hi Valter,
Welcome to the DEV list, please find my comments below:
Valter Nogueira wrote:
Quote:
Hi people,
I am a wanna be asterisk-dev, but the learning curve is somewhat hard.
As a newbie developer myself, I agree that the learning curve is
steep and hard. The best way to learn is to read various code snippets
and try to extrapolate what they do. That's what I did when I started
working on adding Hebrew to app_voicemail.c and say.c
Quote:
Do you have any clues such "IDE", debugging tools and what ever could help?
Well, I'm using a mixture of Eclipse with the CDT plugins and VIM.
Debugging is always done with GDB - other than that, just follow the
Digium coding guidelines.
Quote:
Should I start on 1.4 or 1.6 version - I am using 1.4 as user so I think
it is most apropriate stick with it as dev.
Actually, the best choice will be SVN. If you write a new feature, it
will only be evaluated on the SVN. If you fix a bug for 1.6 or 1.4, that
can be done directly on the version, however, still needs to be ported
to the SVN version. Just like you, I started working on the 1.4 version,
quickly to realize that I need to do my work twice each time - so I
migrated to SVN version.
Quote:
I am developing an Asterisk based dialer. My first version write down an
extension.conf - so I reload it every time config changes.
So, I thought: What if I create extensions on the fly: "DIALPLAN ADD
EXTENSION 1111,1,COMMAND INTO MYCONTEXT"
It sounded great, but just worked if MYCONTEXT is already present (what
is not always the case).
I thought again (what is not usual): Source code can answer it to me.
Now the hard part where in the damn giant source code DIAL PLAN ADD
EXTENSION is handled.
Few greps after I found it -> pbx_config.c - where I found 2 function -
one marked as deprecated
How should I debug asterisk to get here and understand what is happening?
Should asterisk create a new dialplan context when adding an extension?
Is there some other way to dynamically add or remove CONTEXTS?
Do you have any tips for me.
As far as I know, these functions are now available via the Asterisk
manager. In any case, I'm not sure you are going in the right direction,
as I can't see a relation between a dialer and auto-generating
extensions.conf. My only logic here would be that you are originating a
call out of Asterisk, then, creating a special dialplan for that call,
re-directing the generated the call to the newly created dialpan. In any
case, it would suggest that you're over complicating things (at least in
my book - literally).
Have a safe journey in learning the inner workings of Asterisk's
source code. If you drink coffee (or alcohol for that matter), this
would be a good point to pour yourself a pint of your finest beer, gulp
it down and use the code.
When I originate the call using a ZAP channel and I direct it to extension 010_START, s, 1 - if originate fails it leads automatically to 010_START, failed, 1
This way I was able to produce manually elaborated campaigns using just extension.conf and a python script that generated callfiles.
Now I am going a step further making all that things automatically
Welcome to the DEV list, please find my comments below:
Valter Nogueira wrote:
Quote:
Hi people,
I am a wanna be asterisk-dev, but the learning curve is somewhat hard.
As a newbie developer myself, I agree that the learning curve is
steep and hard. The best way to learn is to read various code snippets
and try to extrapolate what they do. That's what I did when I started
working on adding Hebrew to app_voicemail.c and say.c
Quote:
Do you have any clues such "IDE", debugging tools and what ever could help?
Well, I'm using a mixture of Eclipse with the CDT plugins and VIM.
Debugging is always done with GDB - other than that, just follow the
Digium coding guidelines.
Quote:
Should I start on 1.4 or 1.6 version - I am using 1.4 as user so I think
it is most apropriate stick with it as dev.
Actually, the best choice will be SVN. If you write a new feature, it
will only be evaluated on the SVN. If you fix a bug for 1.6 or 1.4, that
can be done directly on the version, however, still needs to be ported
to the SVN version. Just like you, I started working on the 1.4 version,
quickly to realize that I need to do my work twice each time - so I
migrated to SVN version.
Quote:
I am developing an Asterisk based dialer. My first version write down an
extension.conf - so I reload it every time config changes.
So, I thought: What if I create extensions on the fly: "DIALPLAN ADD
> EXTENSION 1111,1,COMMAND INTO MYCONTEXT"
Quote:
It sounded great, but just worked if MYCONTEXT is already present (what
is not always the case).
I thought again (what is not usual): Source code can answer it to me.
>
Quote:
Now the hard part where in the damn giant source code DIAL PLAN ADD
EXTENSION is handled.
Few greps after I found it -> pbx_config.c - where I found 2 function -
one marked as deprecated
>
Quote:
How should I debug asterisk to get here and understand what is happening?
Should asterisk create a new dialplan context when adding an extension?
Is there some other way to dynamically add or remove CONTEXTS?
>
Quote:
Do you have any tips for me.
As far as I know, these functions are now available via the Asterisk
manager. In any case, I'm not sure you are going in the right direction,
as I can't see a relation between a dialer and auto-generating
extensions.conf. My only logic here would be that you are originating a
call out of Asterisk, then, creating a special dialplan for that call,
re-directing the generated the call to the newly created dialpan. In any
case, it would suggest that you're over complicating things (at least in
my book - literally).
Have a safe journey in learning the inner workings of Asterisk's
source code. If you drink coffee (or alcohol for that matter), this
would be a good point to pour yourself a pint of your finest beer, gulp
it down and use the code.
Posted: Mon Jun 01, 2009 11:18 am Post subject: [asterisk-dev] wanna be asterisk-dev
Valter Nogueira wrote:
Quote:
This way I was able to produce manually elaborated campaigns using just
extension.conf and a python script that generated callfiles.
Now I am going a step further making all that things automatically
As a simple step, you can use #exec from within extensions.conf to run
another Python script to generate all the needed contexts; you still
have to 'reload' to get them into memory, but you don't have to edit any
text files or duplicate the information.
--
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kpfleming@digium.com
Check us out at www.digium.com & www.asterisk.org
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum