There is, in connection with the wish to obtain a son, a continuum of ritual starting from the marriage of the parents and ending with the delivery of the mother. The relevant rites are thus either preconceptional or prenatal..
Marriage rites belong to the former category. During the marriage ritual a boy whose mother has given birth to boys only (boys who are still living) is placed on the lap of the bride (SYED To: 49 with footnote 17). There is also the rule that during the circumambulation of the sacred fire (as part of the marriage ritual) the bridegroom should grasp the bride's fingers if he wants daughters, her thumb if he wants sons, her hand if he wants both (KANE 528, SYED To 49). It seems that 'preconceptional' rites are mainly woven into the (very complicated) marriage ritual. Even then the marriage ritual is not decidedly orientated to sons. Maybe it is earlier than the time of extreme preference for sons. Refer for the marriage rites to KANE 526-541. KANE remarks: "In connection with the rites of marriage it is necessary to observe that the greatest divergence prevailed from very ancient times." (527)
Prenatal rites. The time of the pumsavana ritual, ritual for obtaining a son, is controversial (e.g. 2nd, 3rd, 4th month of pregnancy). The pregnant wife has to eat two beans and a barley corn (sexual symbolism), offered in sour milk (SYED To: 48, 68-69). Medical texts of a later period recommend pumsavana before the foetus is visible (SYED To 69). Another son-oriented prenatal ritual is connected with the Nyagrodha tree (fig-tree). Powder produced from a Nyagrodha sprig (symbol of the semen) is introduced into the right nostril of the expectant mother. The Nyagrodha sprig can be replaced by other suitable objects ('allomotifs' in DUNDES' terminology). A third prenatal ritual for obtaining a son is 'making the parting of the hair'. The act of parting is combined with a long list of sub-rites, e.g. manipulation with Udumbara fruits. The raw Udumbara fruits (U. is another fig-tree) are wrapped round the wife. SYED To 69, 77; KANE 218-220.
The prenatal ensemble with its numerous variants is bewildering. See HILLEBRANDT §§ 9-11. WALKER observes: "More than one sacrifice was devised, and dozens of rites prescribed (e.g. pumsavana), and hundreds of mantras and prayers composed, for the specific purpose of obtaining male progeny..." (WALKER II 423).