From fd88d8999672f7647b80d064976696e3ef0161a6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 17 Dec 2014 00:21:26 +0100 Subject: [PATCH] Ability to avoid the 'Not found in Odoo' as callerID name when phone is not found --- asterisk_click2dial/scripts/set_name_agi.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/asterisk_click2dial/scripts/set_name_agi.py b/asterisk_click2dial/scripts/set_name_agi.py index 29983de..3795169 100755 --- a/asterisk_click2dial/scripts/set_name_agi.py +++ b/asterisk_click2dial/scripts/set_name_agi.py @@ -103,8 +103,9 @@ from optparse import OptionParser # Name that will be displayed if there is no match -# and no geolocalisation -not_found_name = "Not in OpenERP" +# and no geolocalisation. Set it to False if you don't want +# to have a 'not_found_name' when nothing is found +not_found_name = "Not in Odoo" # Define command line options options = [ @@ -353,10 +354,11 @@ def main(options, arguments): res = convert_to_ascii(res) stdout_write('VERBOSE "Name = %s"\n' % res) - if options.outgoing: - stdout_write('SET VARIABLE connectedlinename "%s"\n' % res) - else: - stdout_write('SET CALLERID "%s"<%s>\n' % (res, phone_number)) + if res: + if options.outgoing: + stdout_write('SET VARIABLE connectedlinename "%s"\n' % res) + else: + stdout_write('SET CALLERID "%s"<%s>\n' % (res, phone_number)) return True if __name__ == '__main__':