Skip to content
Snippets Groups Projects
Commit 062becab authored by Richard Mudgett's avatar Richard Mudgett
Browse files

Convert sig_analog to use a global callback table.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent e5718974
No related branches found
No related tags found
No related merge requests found
...@@ -3768,7 +3768,7 @@ static int my_have_progressdetect(void *pvt) ...@@ -3768,7 +3768,7 @@ static int my_have_progressdetect(void *pvt)
} }
} }
   
static struct analog_callback dahdi_analog_callbacks = struct analog_callback analog_callbacks =
{ {
.play_tone = my_play_tone, .play_tone = my_play_tone,
.get_event = my_get_event, .get_event = my_get_event,
...@@ -12630,7 +12630,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf, ...@@ -12630,7 +12630,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
tmp->outsigmod = conf->chan.outsigmod; tmp->outsigmod = conf->chan.outsigmod;
   
if (analog_lib_handles(chan_sig, tmp->radio, tmp->oprmode)) { if (analog_lib_handles(chan_sig, tmp->radio, tmp->oprmode)) {
analog_p = analog_new(dahdisig_to_analogsig(chan_sig), &dahdi_analog_callbacks, tmp); analog_p = analog_new(dahdisig_to_analogsig(chan_sig), tmp);
if (!analog_p) { if (!analog_p) {
destroy_dahdi_pvt(tmp); destroy_dahdi_pvt(tmp);
return NULL; return NULL;
......
This diff is collapsed.
...@@ -239,6 +239,8 @@ struct analog_callback { ...@@ -239,6 +239,8 @@ struct analog_callback {
int (* const have_progressdetect)(void *pvt); int (* const have_progressdetect)(void *pvt);
}; };
/*! Global analog callbacks to the upper layer. */
extern struct analog_callback analog_callbacks;
struct analog_subchannel { struct analog_subchannel {
...@@ -254,8 +256,6 @@ struct analog_pvt { ...@@ -254,8 +256,6 @@ struct analog_pvt {
enum analog_sigtype sig; enum analog_sigtype sig;
/* To contain the private structure passed into the channel callbacks */ /* To contain the private structure passed into the channel callbacks */
void *chan_pvt; void *chan_pvt;
/* Callbacks for various functions needed by the analog API */
struct analog_callback *calls;
/* All members after this are giong to be transient, and most will probably change */ /* All members after this are giong to be transient, and most will probably change */
struct ast_channel *owner; /*!< Our current active owner (if applicable) */ struct ast_channel *owner; /*!< Our current active owner (if applicable) */
...@@ -346,7 +346,7 @@ struct analog_pvt { ...@@ -346,7 +346,7 @@ struct analog_pvt {
int ringt_base; int ringt_base;
}; };
struct analog_pvt *analog_new(enum analog_sigtype signallingtype, struct analog_callback *c, void *private_data); struct analog_pvt *analog_new(enum analog_sigtype signallingtype, void *private_data);
void analog_delete(struct analog_pvt *doomed); void analog_delete(struct analog_pvt *doomed);
void analog_free(struct analog_pvt *p); void analog_free(struct analog_pvt *p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment