0

I am implementing a Twilio call functionality in my Django app, where in I want to get a call to specified no, after the call is picked by a person it should connect the call to another phone no. This is what I have already implemented to get the call functionality running but I am not able to forward it to the desired no.

def call(country_code, to, lead_cc, lead_no, configuration):
account_sid = "XXX22a62f54bXXXXXXXXXXXXX"
auth_token = "XXXXXa61188eXXXXXXXXXXX"
client = Client(account_sid, auth_token)
no_str = str(country_code) + str(to[0])
no_uni = unicode(no_str)
lead_str = str(lead_cc) + str(lead_no[0])
lead_uni = unicode(lead_str)

client.calls.create(from_="+17xxXXXXX",
                               to=no_uni,
                               url= 'http://twimlets.com/forward?PhoneNumber=+91xxxxxxxxx')

Also, I need pass "lead_uni" in the URL like this but it's now working (url= 'http://twimlets.com/forward?PhoneNumber=lead_uni').Please, sugges !

1 Answers1

0

It worked! I am using Twilio Trial account so, I need to verify all the phone no used. But passing the Variable 'lead_uni' in the twimlets URL is still not in place.

  • Not quite sure what you're trying to achieve with the url variable? Could you explain a bit more and what is working or not working? I'd love to help. – philnash Aug 10 '17 at 12:03
  • Thanks @philnash ,the issue is resolved .url='http://twimlets.com/forward?PhoneNumber='+lead_str This is what need to be done. – gupta_hargobind Aug 13 '17 at 10:54