Browse Source

[REF] changed alert-info column into alter_info as Postgres might not accept it else

6.0
vianneydc 14 years ago
committed by Raphaël Valyi
parent
commit
55b7d66b25
  1. 6
      asterisk_click2dial/asterisk_click2dial.py
  2. 2
      asterisk_click2dial/asterisk_click2dial_demo.xml
  3. 2
      asterisk_click2dial/asterisk_server_view.xml

6
asterisk_click2dial/asterisk_click2dial.py

@ -44,7 +44,7 @@ class asterisk_server(osv.osv):
'context' : fields.char('Dialplan context', size=50, required=True, help="Asterisk dialplan context from which the calls will be made. Refer to /etc/asterisk/extensions.conf on your Asterisk server."),
'wait_time' : fields.integer('Wait time (sec)', required=True, help="Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up."),
'extension_priority' : fields.integer('Extension priority', required=True, help="Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server."),
'alert-info' : fields.char('Alert-Info SIP header', size=40, help="Set Alert-Info header in SIP request to user's IP Phone. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial, for example you could choose a silent ring tone."),
'alert_info' : fields.char('Alert-Info SIP header', size=40, help="Set Alert-Info header in SIP request to user's IP Phone. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial, for example you could choose a silent ring tone."),
'company_id' : fields.many2one('res.company', 'Company', help="Company who uses the Asterisk server."),
}
@ -220,8 +220,8 @@ class asterisk_server(osv.osv):
sock.send('CallerId: '+str(user.callerid)+'\r\n')
sock.send('Exten: '+str(ast_number)+'\r\n')
sock.send('Context: '+str(ast_server.context)+'\r\n')
if not ast_server.alert-info and user.asterisk_chan_type == 'SIP':
sock.send('Variable: SIPAddHeader=Alert-Info: '+str(ast_server.alert-info)+'\r\n')
if not ast_server.alert_info and user.asterisk_chan_type == 'SIP':
sock.send('Variable: SIPAddHeader=Alert_Info: '+str(ast_server.alert_info)+'\r\n')
sock.send('Priority: '+str(ast_server.extension_priority)+'\r\n\r\n')
sock.send('Action: Logoff\r\n\r\n')
sock.close()

2
asterisk_click2dial/asterisk_click2dial_demo.xml

@ -8,7 +8,7 @@
<field name="login">click2dial</field>
<field name="password">mypassword</field>
<field name="context">from-internal</field>
<field name="alert-info">info=&lt;Bellcore-dr5&gt;</field>
<field name="alert_info">info=&lt;Bellcore-dr5&gt;</field>
<field name="company_id" ref="base.main_company" />
</record>
<record id="base.user_root" model="res.users">

2
asterisk_click2dial/asterisk_server_view.xml

@ -33,7 +33,7 @@
<field name="national_prefix" />
<field name="international_prefix" />
<field name="country_prefix" select="1" />
<field name="alert-info" />
<field name="alert_info" />
<field name="wait_time" />
</form>
</field>

Loading…
Cancel
Save