Since 2011, the conflict in Syria has driven more than 4 million people into refugee camps in surrounding countries like Turkey, Jordan and Lebanon, and many others towards Europe.
Lebanon has called on other countries to share its refugee burden.
The United Nations refugee agency says there are around 1.1 million refugees in Lebanon, or one person in four in the country, and at least 620,000 UN-registered refugees in Jordan.
Lebanon and Jordan say international aid meets only a fraction of the billions of dollars that it costs them to host the refugees, straining their infrastructure and basic services.
The flood of migrants arriving in Europe over the summer has prompted some leaders to announce a greater refugee intake. Germany says it expects an estimated 800,000 people to arrive this year - four times as many as last year.
The civil war in Syria has killed 250,000 people and forced half of the population from their homes, creating the worst refugee crisis since World War Two.
About 7.6 million people are displaced within the country.
Lebanon's Salam said his country was struggling to cope with the influx from its much larger neighbour, especially given that some international aid had been cut.
"We are convinced that the refugee crisis which reached the crux of Europe today is a phenomenon that cannot come to a halt unless we find a political solution to put an end to the war in Syria," he said.
Cameron discussed with Salam and the Jordanian king the threat of the Islamist militants who control swathes of territory in Iraq and Syria.
Britain will continue to support the Lebanese security services and boost defence co-operation with Jordan, he said.
"Of course that threat is more acute here with ISIS-held territory just 60 miles from your border," Cameron told Salam, referring to land held by Islamic State militants in Syria.
King Abdullah of Jordan, which is part of the US led coalition fighting the militants, said "the global fight against terror is a major challenge" for his country and the region.