There is Asterisk Now (Version 6.12.65-26) - os: Linux
Task: after the operator picked up the phone, there was a call to an external script. I tried to do something in the file extensions_custom.conf . Put in different ways.
I could only configure that the script is triggered when an incoming call is received, but so that when the operator picks up the phone there is no.
Tried it through AGI and System and Macros.
Can you show what to do with an example?
I searched Google for everything I could ( http://forums.asterisk.org/viewtopic.php?p=136759 ), but there’s no point. At least indicate where to dig.
Many suggest that you can configure via AMI. Just give at least 1 working example, I'll dig it out myself.
Here is what I got to:
[from-internal-custom] exten => _XXXX,1,Dial(SIP/${EXTEN},60,U(answer-script,${PARAM})) same => n,Hangup [answer-script] exten => s,1,AGI(answer.py,${ARG1}) same => n,Return answer.py:
#!/usr/bin/python import os,sys import datetime ROOT_PATH = os.path.abspath(u'{0}'.format(os.path.dirname(os.path.abspath(__file__)))) file_name = os.path.join(ROOT_PATH, 'answer.txt') with open(file_name, 'a') as file_to_save: save_string= u"{0:%Y-%m-%d %H:%M:%S}:{1}\n".format(datetime.datetime.now(), sys.argv) file_to_save.write(save_string) The call is working - everything is OK ( there are moments with the definition of the number (as I understand it depends on the provider and the settings of the asterix ), but this is a second time)
Now the problem is that after calling the script, when the operator switches to the required manager, the script is called again and nothing else works (- I suspect that because of this line Dial (SIP / $ {EXTEN}, 60, U
I do not need another call, I need to work only on lifting the handset on the incoming call for the operator (after the operator switches to the manager, you do not need to call the script)