I don't understand how the phone sex line made money from it.

This is a fairly well known scam. The general idea is that the third-world phone company charges a significantly higher rate than their costs and gives a kickback to the phone sex line for bringing them the business.

Here's a nice reference I found with Google.