I am so sorry to hear that your child is suffering physically from chronic pain and emotionally from not being with other children who understand. You didn't mention the cause of your son's pain. I bring this up, because I wonder if a support group with parents and other children who share the same diagnosis might be helpful for both of you. Your son could socialize and play with children who do understand and are dealing with the same condition. You would have the support and network of parents with the same issues.
I have no personal experience or advice to share. I wish that I did. Hopefully, a reader will come forward with some helpful advice.