
98 Cal.App.2d 292 (1950)
RICHARD J. FRANKLIN, SR., Petitioner,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent.
Civ. No. 14435. 
California Court of Appeals. First Dist., Div. Two.  
July 6, 1950.
 Cresswell & Davis for Petitioner.
 Emmett Lucey and J. Joseph Sullivan for Respondent.
 DOOLING, J.
 Petitioner, a resident of Missouri, seeks a writ of prohibition to prevent the further prosecution of an action in the superior court in which he is defendant and Elsie Barker is plaintiff on the ground that the court has no jurisdiction of his person.
 Petitioner was married to Elsie Barker's daughter and has by her one son, Richard J. Franklin, Jr. In May, 1948, petitioner's wife took the son to California and the two lived in San Francisco with Elsie Barker until the wife's death on June 15, 1949. Thereafter petitioner made efforts through his attorneys in California to have Elsie Barker deliver the custody of his son to him. Elsie Barker demanded compensation for the support given to the wife and son by her in San Francisco. On September 5, 1949, petitioner came to California. On September 13 petitioner filed a petition for habeas corpus in the superior court to obtain custody of his son and on September 16 the court issued a writ of habeas corpus directing Elsie Barker to deliver the son to petitioner at 5 p. m. on September 17.
 Armed with this writ petitioner went to the home of Elsie Barker on September 17 to get his son and while there he was served with a summons and complaint in an action by Elsie Barker to recover from him the reasonable value of the support given by her to the wife and child. *294
 Petitioner appeared specially and moved to quash the service of summons. In his supporting affidavit petitioner averred among other things:
 "That on September 5, 1949, petitioner entered the State of California for the sole purpose of obtaining custody of his said son and with the intention of instituting whatever legal proceedings as should be required to accomplish this objective; that despite repeated requests the said Elsie Barker failed to deliver over custody of said child to petitioner and petitioner was required to and did file his petition for a Writ of Habeas Corpus ... on September 13, 1949 ...." Then follows a recital of the order of September 16 granting the writ, its service on Elsie Barker on September 17 according to its terms and the service of the summons and complaint on petitioner at that time.
 [1] It is the general rule that parties and witnesses coming from outside the state to participate in the hearing of litigation in a court of the state are ordinarily exempt from the service of process in another action for a reasonable time in coming, attending court and leaving the jurisdiction; and (while a minority of courts have held otherwise) by the great weight of authority this privilege extends to parties plaintiff. (42 Am.Jur., Process,  144, pp. 125-126; Stewart v. Ramsay, 242 U.S. 128 [37 S.Ct. 44, 61 L.Ed. 192]; Diamond v. Earle, 217 Mass. 499 [105 N.E. 363, 51 L.R.A.N.S. 1178, Ann.Cas. 1915D 984]; State ex rel. Coe v. District Ct., 73 Mont. 265 [235 P. 766]; Fisk v. Westover, 43 S.D. 233 [55 N.W. 961, 46 Am.St.Rep. 780]; In re Healey, 53 Vt. 694 [38 Am.Rep. 713]; Sofge v. Lowe, 131 Tenn. 626 [176 S.W. 106, L.R.A. 1916A 734]; Minch & Eisenbrey Co. v. Cram, 136 Md. 122 [110 A. 204]; Moseley v. Ricks, 223 Iowa 1038 [274 N.W. 23].) It is petitioner's contention that the facts recited in his affidavit bring him within this rule.
 [2] In assaying this claim we are bound by the rule that all intendments are in favor of the action of the trial court and that the burden is on petitioner to satisfy this court that the lower court is acting in excess of its jurisdiction.
 Examining petitioner's affidavit with these rules in mind it appears on petitioner's own averment: "That on September 5, 1949, petitioner entered the State of California for the sole purpose of obtaining custody of his said son and with the intention of instituting whatever legal proceedings as should be required to accomplish this objective ...." It further appears that he was in the state for eight days before filing *295 his petition in habeas corpus, the only explanation for this delay being, "that despite repeated requests the said Elsie Barker failed to deliver over custody of said child to petitioner."
 It is a fair inference from these averments that petitioner came to California for the purpose of obtaining the custody of his child from Mrs. Barker without legal action if possible, and of taking legal action if, and only if, his negotiations failed.
 [3] The privilege of exemption from service of process which petitioner claims is limited to persons coming into the jurisdiction for the purpose of attending court, attending on the court and leaving. "It is not to be extended so far as to exempt all persons voluntarily coming within the jurisdiction of the court from being served, merely because they may come to consult with attorneys, investigate transactions, or otherwise attend to matters which may become the subject of litigation, or which may eventually reach a trial." (42 Am.Jur., Process,  148, p. 129; 50 C.J., Process,  237, p. 554.) "This exemption from service of process is, of course, in derogation of the right which every creditor has to collect his debt by subjecting his debtor to suit in any jurisdiction where he may find him. Since this is so, the privilege should not be extended beyond the reason of the rule upon which it is founded." (Murrey v. Murrey, 216 Cal. 707, 710 [16 P.2d 741, 85 A.L.R. 1335].)
 [4] Petitioner asserts that while he can find no authority for his position the privilege should be extended to a suitor who comes into the state for the purpose of filing an action. If this is his controlling purpose and he files his action with reasonable promptness after arriving in the state this may be so. But here the trial court was entitled to infer that petitioner's primary purpose was to get his son without legal action if possible and only secondarily to resort to the court if negotiation failed. If Mrs. Barker had delivered his son to petitioner during the eight-day period while he was in the state before filing his petition he could not have claimed an exemption on the ground now urged, that he was in the state attending on a court thereof.
 The controlling purpose of the visit to the jurisdiction must be the suitor's attendance on the court and, while he may engage in other subordinate activities while in the state, he waives the privilege if he occupies an unreasonable time in *296 coming or going. (Gerard v. Superior Court, 91 Cal.App.2d 549, 552, 554 [205 P.2d 109].) [5] Here on petitioner's own showing he spent eight days in California before commencing any legal proceedings and the inference is reasonable that his controlling purpose in coming into the state was to avoid litigation if possible, rather than to prosecute it. These factors seem decisive and we need not consider respondent's contention that the subject matter of Mrs. Barker's suit is so intimately connected with the right to custody involved in the habeas corpus proceeding as to bring this case within the rule of Von Kesler v. Superior Court, 109 Cal.App. 89 [292 P. 544].
 The alternative writ is discharged and the petition denied.
 Nourse, P. J., and Goodell, J., concurred.
