Noob here, I need help with a simple script (php or XML) that strips a portion of the inbound callerid, in Twiml then forwards that call to the original e164 number dialed. Eg. call comes from [email protected]:5061 - PHP/xml script strips everything off but the e164 number and then twiml that number. So the resulting outbound leg would simply be +16045551212.
Since Twilio supports webhooks, we should be able to take in the number, strip the unwanted bit and return a sanitized number for the outbound leg.
I have recording working and if I place a e164 number in statically, it works fine. I am just having trouble with stripping the unwanted but off the sip uri and telling the system to dial that new number.
I tried using {{From}} but that includes the entire from callerid, including the unwanted sip uri bits.
Twiml webhook I am calling from system...
<Response>
<Say> This call will be recorded for quality assurance purposes. Please standby.</Say>
<Dial record="record-from-ringing-dual" callerId="+1xxxxxxxxx">
<Number>+1xxxxxxxx
</Number>
</Dial>
</Response>
I would be grateful for any help here!