Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jamie

Pages: 1 [2] 3
16
Yate users hangout place / Re: How to Generate a series of DTMF tones
« on: March 07, 2016, 09:04:32 AM »

Hi Marian,

Thanks for the reply, much appreciated.

I thought that might be the case!

Is there any mileage using the tone generator ?

I was reading this

dtmfstr/XXXXX - an entire sequence of DTMF tones

from this page:

http://docs.yate.ro/wiki/Tonegen


17
Yate users hangout place / How to Generate a series of DTMF tones
« on: March 06, 2016, 08:51:11 PM »
Hi,

Please could I ask for some help ?

I would like to generate a series of DTMF tones ?

I can generate a single tone with the following PHP:

Code: [Select]

        $m = new Yate("chan.dtmf");
        $m->params["targetid"] = $this->channel_id;
        $m->params["text"] = '1234';
        $m->Dispatch();



However if I try a string, for example '1234', it appears to play them, but very quickly, almost on top of each-other.

I've been trying to insert a pause using the usual suspects like 'p', ',' etc, but no luck, it doesn't work.

Is the method I've described above possible or should I be looking at another solution ?

Thank you!
Jamie


( Installation is Windows  )

18
Features requests / Re: EventLog files on Windows
« on: March 19, 2015, 11:06:11 AM »

This feature has now been added,

Thanks guys !


19

Thanks Marian, I'll have a look !

20
Yate users hangout place / Chan.control example paramter values / limits
« on: February 24, 2015, 04:21:16 PM »

Hi guys!

Please could you point me in the right direction where I could find the acceptable values for the chan.control message ?

Looking at the docs here ( http://docs.yate.ro/wiki/Chan.control ) it shows me the parameter names but unfortunately not any example values / limits

In particular I'm interested in 'out_volume' 

An example or somewhere to search would be great .. ( I even tried looking through the GIT repo code to see if i could find anything ! )

Thank you!
Jamie




21

Hi Monica,

I thought that would be the case.

Thank you !

22

Hi,

Please could someone help me ?

I'm not convinced this make sense to have or should be possible , but ....


a) Is it ok to install a handler from within a global script ?

For example:

Yate::Install("chan.notify",100,"targetid",$chan_id );

b) If yes, how would you Uninstall it without perhaps uninstalling all e.g chan.notify handlers ?

For Example:

Yate::Uninstall("chan.notify");

Would this not uninstall everything ? How does it know which filter ?


Looking at libyate.php, it doesn't look as though it's implemented:


Code: [Select]
    /**
     * Uninstall a Yate message handler
     * @param $name Name of the messages to stop handling
     */
    static function Uninstall($name)
    {
    $name=Yate::Escape($name);
    _yate_print("%%>uninstall:$name\n");
    }
 

or directly from an Ext module...

Keyword: %%>uninstall
%%>uninstall:<name>
Direction: Application to engine



Thank you!

23

Thanks Monica !


24
Other Yate server issues / Re: Yate Server Security
« on: January 21, 2015, 07:08:12 PM »

If you're using a windows platform you wont have access to ip tables, but can i suggest a relatively cheap bit of software from http://www.beethink.com/ that do the same job?  ( There maybe others out there, but this was best i found at the time )

it has a command line interface, so you can modify banbrutes.php to push unwanted ip's to it and bar / white list them instantly.

25

Hi Monica,

Thanks for the reply & sorry for not posting all the code.

I've actually been using the sample scripts for help, but unfortunately as far as i understand, Windows can't use the external script routing method.

Example:

^NNN$=external/nodata/playrec.php

... so I've been attempting to use global scripts instead, but with inspiration from the sample scripts.


as you suggested i went back to the playrec.php script and extracted what I think is the relavent parts to get me going.


Pasted below is what was created:


Code: [Select]
// Start YATE
Yate::Init(true, "localhost", 5039, "");

$eventCtr = 0;

Yate::Debug(true);
Yate::Output(true);


Yate::Install("call.route", 80 );
Yate::Install("call.execute", 70  );  // Added because we dont get the call.execute event without it

Yate::Install("chan.notify"  );


$ourcallid = "";
$chl_id    = "";




/* The main loop. We pick events and handle them */

for (;;) {


$ev=Yate::GetEvent();

// To help see all events
if ( $ev && $ev->name != 'engine.timer' && $ev->type !== 'installed' && $ev->type !== 'watched'   )
{
Yate::Debug( '   E -------------------> ' . $ev->type . ' -> ' . $ev->name );
};




/* If Yate disconnected us then exit cleanly */
if ($ev === false)
break;
/* Empty events are normal in non-blocking operation.
   This is an opportunity to do idle tasks and check timers */
if ($ev === true) {

Yate::Output("PHP event: empty");
continue;
}


// Handling Functions


/* If we reached here we should have a valid object */
switch ($ev->type) {

case "incoming":




if ( $ev && $ev->name == "call.route"  )
{


if ( $ev->getValue("called") == '600' ) {

Yate::Debug( 'Route Called ' . $ev->getValue("called") );

$chl_id = NULL;
$ourcallid   = "playtest/" . uniqid(rand(),1);

// Not sure about this, it's all I can do to get it to start.

//$ev->retval = "tone/noise";
$ev->retval = "dumb/";
$ev->handled = true;
$ev->Acknowledge();   
$ev = false;


}


}





if ( $ev && $ev->name == "call.execute"  )
{

Yate::Debug( 'Execute ' . $ev->params["id"] );

$chl_id = $ev->params["id"];

$ev->params["targetid"] = $ourcallid;
$ev->handled = true;
// we must ACK this message before dispatching a call.answered
$ev->Acknowledge();
// we already ACKed this message
$ev = false;


        $m = new Yate("call.answered");
$m->params["id"] = $ourcallid;
$m->params["targetid"] = $chl_id;
$m->Dispatch();



$m = new Yate("chan.attach");
$m->params["source"] = "wave/play/C:/Program Files/Yate/share/sounds/test.wav";
$m->Dispatch();


// Resulted in the error
//<WARN> Wave source 'C:/Program Files/Yate/share/sounds/test.wav' attach request with no data channel!




}







if ( $ev  )
{
$ev->Acknowledge();
};


break;
case "answer":
Yate::Output("PHP Answered -: " . $ev->name . " time: " . microtime(true) );

break;
case "installed":
Yate::Output("PHP Installed: " . $ev->name . " time: " . microtime(true) );
break;
case "uninstalled":
Yate::Output("PHP Uninstalled: " . $ev->name . " time: " . microtime(true) );
break;
case "setlocal":
Yate::Output("PHP Parameter: ". $ev->name . "=" . $ev->retval . ($ev->handled ? " (OK)" : " (error)")  . " time: " . microtime(true)  );
break;
default:
( $ev->type != 'empty' ? Yate::Output("PHP Event: " . $ev->type . " time: " . microtime(true) ) : NULL );




}
}

Yate::Output("PHP: bye!");



However, this kept giving me an error:

<WARN> Wave source 'C:/Program Files/Yate/share/sounds/test.wav' attach request with no data channel!

      
So .... I did a bit of Googling and found a previous question that was almost the same query as mine.

http://permalink.gmane.org/gmane.comp.telephony.yate/6182


Here, you suggested replacing chan.attach with a chan.masquerade and chan.attach, for example:

Code: [Select]
$m = new Yate("chan.masquerade");
$m->params["message"] = "chan.attach";
$m->params["source"] = "wave/play/C:/Program Files/Yate/share/sounds/test.wav";
$m->params["id"] = $peerid;
$m->params["notify"] = $chl_id;




( This was initially inserted in place of the chan.attach code above )

But sadly I couldn't get this to work as $peerid of the other channel wasn't available to catch yet. ie it's wasn't in 'call.execute'



So, what i came up with was the following: ( this replaces the $ev->type 'incoming' above )

Which works, but I'm not so happy with chan.connected being the best way to detect when a call is 'answered' and ready to play prompts etc etc !

Sorry, for the long post, but please could you help point me in the right direction ?
Thank you!


Code: [Select]


if ( $ev && $ev->name == "chan.connected" && $ev->params["module"] == 'sip'  )
{

$peer_id = $ev->params["peerid"];

$m = new Yate("chan.masquerade");
$m->params["message"] = "chan.attach";
//$m = new Yate("chan.attach");
$m->params["source"] = "wave/play/C:/Program Files/Yate/share/sounds/test.wav";
$m->params["id"] = $peer_id;
$m->params["notify"] = $ourcallid;
$m->Dispatch();
}



if ( $ev && $ev->name == "call.route"  )
{


if ( $ev->getValue("called") == '600' ) {

Yate::Debug( 'Route Called ' . $ev->getValue("called") );

$chl_id = NULL;
$ourcallid   = $ev->params["id"];

// Not sure about this, it's all I can do to get it to start.

$ev->retval = "tone/noise";
//$ev->retval = "dumb/";
$ev->handled = true;
$ev->Acknowledge();   
$ev = false;


   

}


}





if ( $ev && $ev->name == "call.execute"  )
{

Yate::Debug( 'Execute ' . $ev->params["id"] );


        $m = new Yate("call.answered");
$m->params["id"] = $chl_id;
$m->params["targetid"] = $chl_id;
$m->Dispatch();




}




26

Thanks Marian

I've added a feature request :

http://forum.yate.ro/index.php?topic=397.0

27
Me again ...


Using PHP, I have a simple script to ... 1) answer the call, 2) send call.answered and 3) play a prompt

Yate::Install( "call.route" );
Yate::Install( "call.answered"   );

$ev->retval = "wave/play/C:/Program Files/Yate/share/sounds/test.wav";
$ev->params['targetid'] = $ev->params["id"];
$ev->handled = true;
$ev->Acknowledge();   

$m = new Yate("call.answered");
$m->params["id"] = $ev->params["id"];
$m->params["targetid"] = $ev->params["id"];
$m->Dispatch();       
   
But for some reason i can't understand why I never see the  incoming - call.answered event.


However if i do the following in JavaScript routing, the incoming - call.answered event arrives fine.
       
var m = new Message('call.answered');
m['id'] = msg['id'];
m['targetid'] = msg['id'];
m.enqueue();


any help and dummies guide would be much appreciated,
Thank you
Jamie

28
Features requests / RESOLVED: EventLog files on Windows
« on: January 19, 2015, 06:48:46 AM »

Please could Event Log files be added to the Windows installation ?

IE what's found in here: eventlogs.conf

Thank you



This was originaly posted here:

http://forum.yate.ro/index.php?topic=392.0

29

Hi,

Please can you help ?

I'm having some problems getting this to work.

I've edited eventlogs.conf as below, but i just can't get a file.
I've given the folder write permission, but still no file!

Is there anything i'm missing ?

I have noticed there's no .yate module for this in my /modules/ installation foler.

Thank you!



Code: [Select]
[general]
; This section controls the global behavior of the events log module

; logs_dir: string: Base directory for event log files, must be set to enable the module
; The last component of the path will be created if missing
; Example: logs_dir=/var/log/yate-events
logs_dir="C:/logs/yate-events/"


; public_read: bool: Make the log files publically readable
; This setting does not apply to Windows
;public_read=false


[mappings]
; This section maps event sources to file names
; Each line holds a regexp and a filename that can include replacements
; First line that matches writes to file name at right of = and exits
; You must take care to create valid file names

; If this section is missing or empty a default line is added:
; ^[A-Za-z0-9_-]\+ = \0.log

30
Yate users hangout place / Re: External Scripts support - Windows
« on: January 13, 2015, 12:46:27 PM »
Thanks Monica, much appreciated.

Pages: 1 [2] 3