PHP code example of odannyc / sipit

1. Go to this page and download the library: Download odannyc/sipit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

odannyc / sipit example snippets


use Sipit\SipitFactory as Sipit;

$destination_ip = '192.168.1.100';
$destination_port = 5060;

Sipit::ping($destination_ip, $destination_port);

{
  ""odannyc/sipit": "*"
  }
}

use sipit\SipitFactory as Sipit;

Sipit::ping('192.168.1.10', 5060);

Array
(
    [request_full] => Array
        (
            [OPTIONS sip] => OPTIONS sip:192.168.1.10:5060 SIP/2.0
            [Via] => Via: SIP/2.0/UDP 192.168.1.121:5090;rport;branch=z9hG4bK572601
            [From] => From: <sip:[email protected]>;tag=10877
            [To] => To: <sip:192.168.1.10:5060>
            [Call-ID] => Call-ID: callid:1d6a6668d796af55d63b1c712602c34b;@192.168.1.121
            [CSeq] => CSeq: 20 OPTIONS
            [Contact] => Contact: <sip:[email protected]:5090>
            [Max-Forwards] => Max-Forwards: 70
            [User-Agent] => User-Agent: SIPIT
            [Content-Length] => Content-Length: 0
        )

    [response_code] => 403
    [response_message] => Forbidden
    [response_concat] => 403 Forbidden
    [response_full] => Array
        (
            [SIP/2.0 403 Forbidden] => SIP/2.0 403 Forbidden
            [Via] => Via: SIP/2.0/UDP 192.168.1.121:5090;received=192.168.1.121;branch=z9hG4bK572601;rport=5090
            [From] => From: <sip:[email protected]>;tag=10877
            [To] => To: <sip:192.168.1.10:5060>;tag=aprqngfrt-qra2n33000081
            [Call-ID] => Call-ID: callid:1d6a6668d796af55d63b1c712602c34b;@192.168.1.121
            [CSeq] => CSeq: 20 OPTIONS
        )

)