Exemple #1
0
 //------------------------------------------------------------------------------------------
 private SipAccount HandleSectionSipTypeUser(SipAccount sipaccount, string propertyname, string propertyvalue)
 {
     switch (propertyname)
        {
             case "canreinvite": sipaccount.CanReinvite = (propertyvalue == "yes");
                  break;
             case "context":     sipaccount.Context     = propertyvalue;
                  break;
             case "dtmfmode":    sipaccount.DTMFMode    = propertyvalue;
                  break;
             case "fromuser":    sipaccount.FromUser    = propertyvalue;
                  break;
             case "fromdomain":  sipaccount.FromDomain  = propertyvalue;
                  break;
             case "host":        sipaccount.Host        = propertyvalue;
                  break;
             case "insecure":    sipaccount.Insecure    = propertyvalue;
                  break;
             case "nat":         sipaccount.Nat         = (propertyvalue == "yes");
                  break;
             case "secret":      sipaccount.Secret      = "*****"; //propertyvalue;
                  break;
             case "username":    sipaccount.UserName    = propertyvalue;
                  break;
        }
        return sipaccount;
 }
Exemple #2
0
        //------------------------------------------------------------------------------------------
        private void HandleSectionData(string sectionname, NameValueCollection sectiondata)
        {
            for (int i = 0; i < sectiondata.Count; i++)
               {
                    if (sectiondata.Keys[i] == "type")
                    {
                         switch (sectiondata[i])
                         {
                              case "friend":
                                   break;

                              case "peer":
                                   break;

                              case "user":
                                   SipAccount sipaccount = new SipAccount();
                                   for (int x = 0; x < sectiondata.Count; x++)
                                   {
                                        sipaccount.SectionName   = sectionname;
                                        sipaccount               = HandleSectionSipTypeUser(sipaccount, sectiondata.Keys[x], sectiondata[x]);
                                   }
                                   Users.Add(sipaccount);
                                   break;
                         }
                    }
               }
        }
Exemple #3
0
 //-------------------------------------------------------------------------------------------
 public SipAccount Add(SipAccount sipaccount)
 {
     List.Add(sipaccount);
        return sipaccount;
 }
Exemple #4
0
 //-------------------------------------------------------------------------------------------
 public int IndexOf(SipAccount sipaccount)
 {
     return List.IndexOf(sipaccount);
 }
Exemple #5
0
 //-------------------------------------------------------------------------------------------
 public SipAccount Add()
 {
     SipAccount sipaccount = new SipAccount();
        return Add(sipaccount);
 }