'''Read the number to dial and call _connect_to_asterisk the right way'''
ifcontextisNone:
context={}
ifnotisinstance(context.get('field2dial'),list):
raiseosv.except_osv(_('Error :'),"The function action_dial must be called with a 'field2dial' key in the context containing a list ['<phone_field_displayed>', '<phone_field_e164>'].")
raiseosv.except_osv(_('Error :'),_('There is no phone number !'))
eliferp_number_displayandnoterp_number_e164:
raiseosv.except_osv(_('Error :'),_("The phone number isn't stored in the standard E.164 format. Try to run the wizard 'Reformat all phone numbers' from the menu Settings > Configuration > Asterisk."))
'''Read the number to dial and call _connect_to_asterisk the right way'''
ifcontextisNone:
context={}
ifnotisinstance(context.get('field2dial'),list):
raiseosv.except_osv(_('Error :'),"The function action_dial must be called with a 'field2dial' key in the context containing a list ['<phone_field_displayed>', '<phone_field_e164>'].")
raiseosv.except_osv(_('Error :'),_('There is no phone number !'))
eliferp_number_displayandnoterp_number_e164:
raiseosv.except_osv(_('Error :'),_("The phone number isn't stored in the standard E.164 format. Try to run the wizard 'Reformat all phone numbers' from the menu Settings > Configuration > Asterisk."))