properly clean capabilites from the endpoint
authorJeremy McNamara <jj@nufone.net>
Wed, 26 May 2004 19:14:51 +0000 (19:14 +0000)
committerJeremy McNamara <jj@nufone.net>
Wed, 26 May 2004 19:14:51 +0000 (19:14 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3079 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/h323/ast_h323.cpp

index ba7de93..cb78730 100755 (executable)
@@ -853,6 +853,7 @@ void h323_callback_register(setup_incoming_cb       ifunc,
 int h323_set_capability(int cap, int dtmfMode)
 {
        H323Capabilities oldcaps;
+       PStringArray codecs;
        int g711Frames = 30;
        int gsmFrames  = 4;
 
@@ -863,7 +864,10 @@ int h323_set_capability(int cap, int dtmfMode)
 
        /* clean up old capabilities list before changing */
        oldcaps = endPoint->GetCapabilities();
-       oldcaps.RemoveAll();
+       for (PINDEX i=0; i< oldcaps.GetSize(); i++) {
+                 codecs.AppendString(oldcaps[i].GetFormatName());
+         }
+         endPoint->RemoveCapabilities(codecs);
 
        mode = dtmfMode;
        if (dtmfMode == H323_DTMF_INBAND) {