Sylvain, merci beaucoup, c'est bien la bonne syntaxe ^^
![Citation](images/misc/quote_icon.png)
Envoyé par
olppp
peux-être un problème de type de variable ?
olppp ![Ouimaitre](images/smilies/ouimaitre.gif)
J'ai converti en int et ça roule maintenant.
Le code final, si ça peut servir à quelqu'un :
Code PHP:
#!/usr/bin/env python
import sys
from xivo import agi
agi = agi.AGI()
agi.verbose("### AGI Beginning ###")
caller = agi.env['agi_callerid']
agi.verbose("### CallerID is = %s ###" % caller)
agi.verbose("### type of callerID is = %s ###" % type(caller))
callerin = int(caller)
agi.verbose("### CallerIN is = %s ###" % callerin)
agi.verbose("### type of callerIn is = %s ###" % type(callerin))
if 4000 <= callerin <= 4099:
agi.set_callerid('0450667788')
if 4100 <= callerin <= 4199:
agi.set_callerid('0450778899')
sys.exit()
Une bonne chose de faite, merci à tous.
A+
Cordialement,