Calls come in as
From: "+487561697" <sip:101@[login to view URL]>
or
From: "+487561697" <sip:101@[login to view URL]> etc the ip and sip port varies
I want call to be sent to
SIP: gsm_number@ip:5060
gsm_number will come from select gsm_number from gsm_gateways where ip = ip in from and port=1
where port mapping is as following
SIP Port
5060=1
5062=2
5064=3
5066=4
5068=5
5070=6
5072=7
5074=8
IP will be based in context
select context from gsm_gateways where ip="ip in from" and port=1