/*************************************************
  _dial_s1.nve     16.3.99   A.B.
     
  In:

  nvtini_s1	String dial
  nvtini_s2	Ownphone
  nvtini_s3	UUI

  nvtini_i1	Rings 

*************************************************/


int ownlen
int uuilen

{
   !"Start module [dial_s1]"
 
   if nvtini_i1<1
      nvtini_i1=1
   fi
  
   strlen nvtini_s2
   ownlen=st
   strlen nvtini_s3
   uuilen=st

   offhook

   if uuilen<1 and ownlen<1
      !"Dial number: "+ nvtini_s1+" with rings "+nvtini_i1
      dial nvtini_s1 -rings nvtini_i1
   else
      if uuilen>0 and ownlen<1
         !"Dial number: "+ nvtini_s1+" with rings "+nvtini_i1+" and User to User Information: "+nvtini_s3
         dial nvtini_s1 -rings nvtini_i1 -uui nvtini_s3
      else
         nvt_own_phone=nvtini_s2
         if ownlen>0 and uuilen<1
            !"Dial number: "+ nvtini_s1+" with rings "+nvtini_i1+" and Ownphone: "+nvtini_s2            
            dial nvtini_s1 -rings nvtini_i1 -ownphone nvt_own_phone
         else
            !"Dial number: "+ nvtini_s1+" with rings "+nvtini_i1
            !"Ownphone: "+nvtini_s2+"  User to User Information: "+nvtini_s3
            dial nvtini_s1 -rings nvtini_i1 -ownphone nvt_own_phone -uui nvtini_s3
         fi
      fi
   fi

   !"ST: "+st
   !"NVT_ST: "+nvt_st
         
   if st=1
      !"Answer"
      play "hello.vox"
      if Notfound
         rec "hello.vox"
      fi
   fi

   !"Done"
   hangup
}