743 IT Telegram . ?

(BioDamage)

4

- SMS .

, . , , GSM . SMS .

, FreePBX

" "

- chan_dongle SMS. , chan_dngle, , .

, , :)
Asterisk:  SMS

FreePBX MySQL. , .

, :

/etc/asterisk/extensions_custom.conf

. :

[send-sms]
exten => _.,1,NoOp(Start sms)
exten => _.,n,DIAL(SIP/${EXTEN},,trg) ; g  " ".       (sip  pjsip)
exten => _X.,n,GotoIf($[${DIALSTATUS}=BUSY]?busy:answered) //,    ,              .
exten => _X.,n(busy),Hangup()
exten => _X.,n(answered),Goto(sms,${EXTEN},1)

[sms]
exten => _X.,1,NoOp(Statrt SendSms)
exten => _X.,n,Answer()
        same => n,Set(COUNT=1);  .  ,    ,      .      ? :)
        same => n,Set(RECIVER=   );    
        same => n,Set(RECIPIENT=${CALLERID(num)})
        same => n,Set(TEXT="        ");  
        same => n,GotoIf($["${RECIPIENT:0:2}" != "79"]?end);       .    CALLERID(num)    -   7  8? 
        same => n,System(/usr/sbin/asterisk -rx 'dongle sms ${RECIVER} 7${RECIPIENT:1} ${TEXT}');    .
        same => n,Set(COUNT=$[${COUNT} + 1]);   (  ,  )
        same => n,GotoIf($["${COUNT}" > "1"]?end);     
exten => _X.,n(end),Goto(macro-hangupcall,s,1); 

. , . , 7 8. , E164. + , ${RECIPIENT:0:2} ${RECIPIENT:0:3}

, extensions_custom.conf . queues_post_custom.conf :

member=Local/4015781@send-sms/n,0,4015781,hint:4015781@ext-local

4015781 . , , dialplan reload .

, , .

, GoIP Gsm , , "" :

SMS ( ), API. PHP API :

#!/usr/bin/php -q
<?php
#   AGI
require(′phpagi.php′); 
$agi = new AGI(); 
$phone = $agi->request[′agi_arg_1′];
text = $agi->request[′agi_arg_2′];
$sender = ′INFORM′;
// !!!  API-  .
$apikey = ′XXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZ′;
$url = ′https://smspilot.ru/api.php′
	′?send=′.urlencode( $text )
	.′&to=′.urlencode( $phone )
	.′&from=′.$sender
	.′&apikey=′.$apikey
	.′&format=json′;

$json = file_get_contents( $url );
echo $json.′
′; $j = json_decode( $json ); if ( !isset($j->error)) { echo ′SMS server_id=′.$j->send[0]->server_id; } else { trigger_error( $j->description_ru, E_USER_WARNING ); } ?>

AGI. , :

same => n,System(/usr/sbin/asterisk -rx 'dongle sms ${RECIVER}  ${TEXT}');    .

:

same => n,AGI(sendsms.php, 7${RECIPIENT:1}, "${TEXT}")

- . ? , :)

, SMS , . , , SMS.

, -. !


?


: