Catalyzes the ATP-dependent amidation of the two carboxylate groups at positions a and c of hydrogenobyrinate, using either L-glutamine or ammonia as the nitrogen source. To a much lesser extent, can also use cobyrinate as substrate in vitro, but the physiological substrate is indeed hydrogenobyrinate, as part of the aerobic pathway for cobalamin biosynthesis. 2 ATP + 2 H2O + hydrogenobyrinate + 2 L-glutamine = 2 ADP + 2 H(+) + hydrogenobyrinate a,c-diamide + 2 L-glutamate + 2 phosphate Optimum pH is around 7.3. Cofactor biosynthesis; adenosylcobalamin biosynthesis; cob(II)yrinate a,c-diamide from precorrin-2 (aerobic route): step 9/10. Homodimer. Comprises of two domains. The C-terminal domain contains the binding site for glutamine and catalyzes the hydrolysis of this substrate to glutamate and ammonia. The N-terminal domain is anticipated to bind ATP and hydrogenobyrinate and catalyzes the ultimate synthesis of the diamide product. The ammonia produced via the glutaminase domain is probably translocated to the adjacent domain via a molecular tunnel, where it reacts with an activated intermediate. The a and c carboxylates of hydrogenobyrinate are likely activated for nucleophilic attack via formation of a phosphorylated intermediate by ATP. CobB catalyzes first the amidation of the c-carboxylate, and then that of the a-carboxylate. Belongs to the CobB/CbiA family. Was originally thought to originate from Pseudomonas denitrificans, but similarity searches show that the sequence is much closer to Sinorhizobium. The entry's taxonomy has been changed.