Good morning,
I would like to launch such an extension that permanently connects me with an internal SIP number, e.g. 200, with a given telephone number.
I see it this way:
I run the script - how? via API? or maybe from a PHP server in asterisk? (I don’t know yet) with the given number.
ie: http://localhost:80/connect?from=fromTrunk&to=7666666666&internalConn=200
Asterisk from the fixed extension dials the call to this number and at the same time calls the given SIP / extension.
So that after lifting the handset by the extension number you have established connection:
SIP (internal, e.g. 200) with a given external number via a given access number (TRUNK).
You need to understand the basics before you try anything complex. You seem to have a fundamental understanding of what Dial() does; it supervises, as well as dials the call, so doetn’t exit until one party clears.
Also, you need to be prepared to search and read the documentation once given a hint.
step 3:
do something (php/python script) , to generate (copy or create files with .call extension in: /var/spool/asterisk/outgoing )
they have to contain:
Channel: SIP/200 ; your internal phone you want to pick up
Callerid: AUTOMATIC CALL ; as you wish
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: call-test-afya ; my extension context
Extension: 10 ; my extension number
SetVar: CUSTOMER=123456789 ; where to call - change it by script
SetVar: PBX=freepbx.pl-XXXXXXXXX-OUT ; your SIP outgoing trunk, you find this name in: http://ASTERISKIP/admin/config.php?display=trunks