[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r196617 - /team/jpeeler/asteri...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun May 24 15:59:02 CDT 2009
Author: jpeeler
Date: Sun May 24 15:58:56 2009
New Revision: 196617
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196617
Log:
Use the analog signalling module code as intended for dahdi_call and dahdi_write. Also, link chan_dahdi against sig_analog instead of including it in chan_dahdi.
Modified:
team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c
team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=196617&r1=196616&r2=196617
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Sun May 24 15:58:56 2009
@@ -6616,6 +6616,11 @@
}
if (newchan->_state == AST_STATE_RINGING)
dahdi_indicate(newchan, AST_CONTROL_RINGING, NULL, 0);
+
+ if (analog_lib_handles(p->sig, p->radio, p->oprmode)) {
+ analog_fixup(oldchan, newchan, p->sig_pvt);
+ }
+
update_conf(p);
ast_mutex_unlock(&p->lock);
return 0;
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c?view=diff&rev=196617&r1=196616&r2=196617
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c Sun May 24 15:58:56 2009
@@ -2888,7 +2888,7 @@
ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
index = analog_get_index(ast, p, 1);
-
+
p->subs[index].f.frametype = AST_FRAME_NULL;
p->subs[index].f.datalen = 0;
p->subs[index].f.samples = 0;
@@ -3225,3 +3225,20 @@
free(p);
}
+/* called while dahdi_pvt is locked in dahdi_fixup */
+int analog_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, void *newp)
+{
+ struct analog_pvt *new_pvt = newp;
+ int x;
+ ast_debug(1, "New owner for channel %d is %s\n", new_pvt->channel, newchan->name);
+ if (new_pvt->owner == oldchan) {
+ new_pvt->owner = newchan;
+ }
+ for (x = 0; x < 3; x++)
+ if (new_pvt->subs[x].owner == oldchan) {
+ new_pvt->subs[x].owner = newchan;
+ }
+
+ analog_update_conf(new_pvt);
+ return 0;
+}
Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h?view=diff&rev=196617&r1=196616&r2=196617
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h Sun May 24 15:58:56 2009
@@ -307,4 +307,6 @@
int analog_ss_thread_start(struct analog_pvt *p, struct ast_channel *ast);
+int analog_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, void *newp);
+
#endif /* _SIG_ANSLOG_H */
More information about the asterisk-commits
mailing list