Cleanup approach in 217804 and don't reach inside the sig_pvt.
authorJeff Peeler <jpeeler@digium.com>
Thu, 10 Sep 2009 23:49:09 +0000 (23:49 +0000)
committerJeff Peeler <jpeeler@digium.com>
Thu, 10 Sep 2009 23:49:09 +0000 (23:49 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@217987 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_dahdi.c
channels/sig_pri.c
channels/sig_pri.h

index ade108d..9424037 100644 (file)
@@ -6357,10 +6357,7 @@ static int dahdi_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
        } 
 #ifdef HAVE_PRI
        else if (dahdi_sig_pri_lib_handles(p->sig)) {
-               struct sig_pri_chan *pchan = p->sig_pvt;
-               if (pchan->owner == oldchan) {
-                       pchan->owner = newchan;
-               }
+               sig_pri_fixup(oldchan, newchan, p->sig_pvt);
        }
 #endif
 
index 779d7f6..f76113e 100644 (file)
@@ -3198,4 +3198,11 @@ int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int change
 }
 #endif
 
+void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan)
+{
+       if (pchan->owner == oldchan) {
+               pchan->owner = newchan;
+       }
+}
+
 #endif /* HAVE_PRI */
index eb6bd02..a61ef31 100644 (file)
@@ -266,4 +266,6 @@ int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channe
 int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus);
 #endif
 
+void sig_pri_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, struct sig_pri_chan *pchan);
+
 #endif /* _SIG_PRI_H */