invalid_international_format_msg="The phone number is not written in valid international format. Example of valid international format : +33 1 41 98 12 42"
invalid_national_format_msg="The phone number is not written in valid national format."
invalid_format_msg="The phone number is not written in valid format."
error_title_msg=_("Invalid phone number")
invalid_international_format_msg=_("The phone number is not written in valid international format. Example of valid international format : +33 1 41 98 12 42")
invalid_national_format_msg=_("The phone number is not written in valid national format.")
invalid_format_msg=_("The phone number is not written in valid format.")
# Let's call the variable tmp_number now
# Let's call the variable tmp_number now
tmp_number=erp_number
tmp_number=erp_number
@ -190,21 +192,23 @@ class asterisk_server(osv.osv):
# Check if the number to dial is not empty
# Check if the number to dial is not empty
ifnoterp_number:
ifnoterp_number:
raiseosv.except_osv('Error','There is no phone number !')
raiseosv.except_osv(_('Error :'),_('There is no phone number !'))
# Note : if I write 'Error' without ' :', it won't get translated...
# I don't understand why !
# We check if the user has an Asterisk server configured
# We check if the user has an Asterisk server configured
ifnotuser.asterisk_server_id.id:
ifnotuser.asterisk_server_id.id:
raiseosv.except_osv('No Asterisk server configured for the current user',"You must associate an Asterisk server to the current user.")
raiseosv.except_osv(_('Error :'),_('No Asterisk server configured for the current user.'))
else:
else:
ast_server=user.asterisk_server_id
ast_server=user.asterisk_server_id
# We check if the current user has a chan type
# We check if the current user has a chan type
ifnotuser.asterisk_chan_type:
ifnotuser.asterisk_chan_type:
raiseosv.except_osv('No channel type configured for the current user',"You must configure an Asterisk channel type for the current user.")
raiseosv.except_osv(_('Error :'),_('No channel type configured for the current user.'))
# We check if the current user has an internal number
# We check if the current user has an internal number
ifnotuser.internal_number:
ifnotuser.internal_number:
raiseosv.except_osv('No internal phone number configured for the current user',"You must configure an internal phone number for the current user.")
raiseosv.except_osv(_('Error :'),_('No internal phone number configured for the current user'))
# Convert the phone number in the format that will be sent to Asterisk
# Convert the phone number in the format that will be sent to Asterisk
@ -237,7 +241,7 @@ class asterisk_server(osv.osv):
sock.close()
sock.close()
except:
except:
logger.notifyChannel('asterisk_click2dial',netsvc.LOG_WARNING,"Click2dial failed : unable to connect to Asterisk")
logger.notifyChannel('asterisk_click2dial',netsvc.LOG_WARNING,"Click2dial failed : unable to connect to Asterisk")
raiseosv.except_osv('Asterisk server unreachable',"The connection from OpenERP to the Asterisk server failed. Please check the configuration on OpenERP and on Asterisk.")
raiseosv.except_osv(_('Error :'),_("The connection from OpenERP to the Asterisk server failed. Please check the configuration on OpenERP and on Asterisk."))
logger.notifyChannel('asterisk_click2dial',netsvc.LOG_INFO,"Asterisk Click2Dial from "+user.internal_number+' to '+ast_number)
logger.notifyChannel('asterisk_click2dial',netsvc.LOG_INFO,"Asterisk Click2Dial from "+user.internal_number+' to '+ast_number)
msgid "The phone number is not written in valid international format. Example of valid international format : +33 1 41 98 12 42"
msgstr "Le numéro de téléphone n'est pas dans un format international valide. Exemple de numéro de téléphone dans un format international valide : +33 1 41 98 12 42"