Богдан Ш | 3 May 15:35 2016

Reroute call on chan.disconnected message


i'm trying to implement some kind of "call forker" but able to count capacity of routes.  And my question is: how can i reroute call to a different route in "chan.disconnected" message handler. I'm trying to send new call.route message. i see that my call.route is processed by regexrouter (why not by my JS script?). Nevertheless sip channel hangups anyway, so no call is generated. here is a part of log:

016-05-03_09:25:58.166221 <iax/1:CALL> ACCEPT [0x7fe34c016b90]
2016-05-03_09:25:58.166291 <iax/1:CALL> REJECT/HANGUP: error='congestion' reason='(null)' [0x7fe34c016b90]
2016-05-03_09:25:58.166324 <iax/1:CALL> Hangup location=remote reason=congestion [0x7fe34c016b90]
2016-05-03_09:25:58.166340 <sip/1:INFO> setDisconnect(0x7fe34c016c60) [0x7fe3580019d0]
2016-05-03_09:25:58.171447 <javascript:INFO> Running onHangup(message) handler for 'chan.hangup'
2016-05-03_09:25:58.171527 <javascript:INFO> Handler for 'chan.hangup' ran for 58 usec
2016-05-03_09:25:58.171574 <cdrbuild:INFO> Hungup 'iax/1'
2016-05-03_09:25:58.171597 <javascript:INFO> Running onDisconnect(message) handler for 'chan.disconnected'
2016-05-03_09:25:58.171631 <CapacityRouter:WARN> Call disconnected: [object Message]
2016-05-03_09:25:58.171926 <INFO> Routing call to '555555' in context 'default' via 'iax/555555-Q0ErXNX1RuYbqy1ck1HvBQ@public.gmane.org:4588' in 112 usec
2016-05-03_09:25:58.171950 <javascript:INFO> Handler for 'chan.disconnected' ran for 346 usec
2016-05-03_09:25:58.172037 <javascript:INFO> Running onHangup(message) handler for 'chan.hangup'
2016-05-03_09:25:58.172269 <CapacityRouter:WARN> Call from sipp to 555555 cleared
2016-05-03_09:25:58.172281 <javascript:INFO> Handler for 'chan.hangup' ran for 81 usec
2016-05-03_09:25:58.172307 <cdrbuild:INFO> Hungup 'sip/1'

I'm using javascript. Here is my code - http://pastebin.com/jUri1ii6

Can anyone help me with this?
Aqs Younas | 3 May 13:52 2016

sip to isup/mgcp

Hi, I am new to yate just done a clean installation so pardon me for my such little knowledge. 

I have a project in which i need to convert sip to mgcp but don't know where to start. 
As there is much little documentation available for this. 

Could someone please give me some pointers to move in right direction. 

Thanks for your time. 

Best Regards, 

andrzej.ciupek | 30 Apr 08:30 2016

call fork - playback then route call to sip - forward sdp and rtp


My scenario:

PSTN ss7 -> Cisco As5400 + yate -> PBX

I need to play progress wave file, before I place a call to destination PBX.
I use fork for this, but after playing wav, when call goes to PBX DTMF  
doesn't works, they are not forwarded to target PBX, but collected by  

<yrtp:INFO> YRTPWrapper::gotDTMF('9') [0x1596290]

I am using:

.*$=fork;callto.1=wave/play//greeting.au;autoprogress=yes;callto.2=|;callto.3=sip/sip:${called} <at>;rtp_forward=yes;formats=alaw,g729;stoperror=busy;maxcall=20000;callto.1.fork.calltype=persistent;callto.1.fork.autoring=true;callto.1.fork.automessage=call.progress

is it possible to do ? When I place call only by:

.*$=sip/sip:${called} <at>;rtp_forward=yes;formats=alaw,g729

dtmf in rfc2833 is forwarded to destination pbx.

SDP at PBX site show, that audio goes from IP of Yate, not  
IP of Cisco Gateway Like it is passed by internal RTP of  

Andrzej Ciupek

strcpy | 24 Apr 19:10 2016

Building a portable GSM BTS using the Nuand bladeRF, Raspberry Pi and YateBTS (The Definitive and Step by Step Guide)

Hi guys,
I write a new article called "Building a portable GSM BTS using the Nuand bladeRF, Raspberry Pi and YateBTS (The Definitive and Step by Step Guide)".
I hope the article can help you.

Rodrigo Ricardo Passos | 23 Apr 14:36 2014

Get number in SAM

Hi Yate,

How can i get the digit in SAM message after receive an IAM using 



Dana cafe | 2 May 14:50 2014

queue.conf operators configuration

good afternoon,

I am trying to put calls in a queue and redistribute to operators 
(without using a database) but I don't know how to define these operators.

For testing i defined two users in regfile.conf:



Then in regexroute.conf I defined:


Finally test1 is defined  in the queue.conf file :


[queue test1]
mintime = 100
length= 100
onhold=wave/play/ test.wav
;definition of the operator
${queue} = test1
${required} = 1
${current} = 1
;  ${waiting}
  maxcall = 3000
;  prompt: string: Resource to play to the operator when it answers

using yate client logged as 1000 I call to 100 and the music on hold 
start but the call is not distributed to the user 2000 which is logged 
in another yate client. For sure the configuration of the operator is 
wrong, unfortunatelly I didn't find a useful example in the website and 
in internet.

thank you very much for your valuable help,


Moritz Orbach | 18 Mar 19:47 2014

Authentication-check in javascript

Hello all,

is there a javascript equivalent to regexroute's

Or more precisely: how can I (on call.route, in javascript)
1) verify that a client is registered in regfile.conf (allowed to make a
   certain call)
2) retrieve the true extension of the client (not based on any headers
   the client can set itself, but based on the registration)

I tried "msg.username", msg.params['username'] and similar properties of
the Message object in the call.route handler, but none of them seemed to

Best regards

Paul Chitescu | 18 Mar 14:06 2014

Yate 5.2 and YateBTS 2.0

Hello everybody!

We released Yate version 5.2 and also version 2.0 of YateBTS.

Yate 5.2 brings:
- Our friendly chatbot Eliza answers you by default to anything you write in 
rmanager that's not an Yate command :-)
- Improvements in Javascript that make writing an IVR much easier
- Better troubleshooting of memory leaks by having memory information from 
glibc and the ability to count objects allocated by each module

YateBTS 2.0 added:
- Support for 2G (COMP128-1) and 3G (MILENAGE) authentication
- Web interface for the Network In a Box
- USSD support (in commercial version only)
- COMP128-2 and COMP128-3 (in commercial version, only for GSMA members)

Paul Chitescu & Null Team

Marco Bisignano | 1 Apr 13:00 2014

R: R: R: [yate] Avoid multiple INVITE and BYE

Hi Marian and thank you for your suggestion. I'm writing a C++ module, but
how can I wait for call.drop to return ?

-----Messaggio originale-----
Da: Marian Podgoreanu [mailto:marian@...] 
Inviato: mercoledì 26 febbraio 2014 15:01
A: Marco Bisignano; yate@...
Oggetto: Re: R: R: [yate] Avoid multiple INVITE and BYE


In a php script you can't wait in a message handler for another message.
You may sleep for a second after sending the call.drop message.
This will give some time for the call to be dropped but it will delay things
(e.g. any other message to be handled by the script will be delayed).
This would not be acceptable on high load systems.

You may write a javascript or c++ module which:
1. Handle call.execute
2. Dispatch a call.drop for the outgoing call leg you want to stop 3. Let
call.execute continue when call.drop returns


On 26.02.2014 15:18, Marco Bisignano wrote:
> Thank you Marian, I understand; is there a way in my script to wait 
> that the first call is pre-empted and closed before sending the new INVITE
> -----Messaggio originale-----
> Da: Marian Podgoreanu [mailto:marian@...]
> Inviato: mercoledì 26 febbraio 2014 10:58
> A: Marco Bisignano; yate@...
> Oggetto: Re: R: [yate] Avoid multiple INVITE and BYE
> Hi,
> For the first call BYE is retransmitted to called party because it 
> doesn't confirm it. It does on the third retransmission.
> For the second call the INVITE is retransmitted due to the same reason.
> This may be a network issue or called party issue.
> The log also shows yate creating new dispatching threads and extmodule 
> warning a message sent to a script did not return in 10 seconds.
> Check your script(s): the message must be acknowledged after handling it.
> Example:
> $ev = Yate::GetEvent();
> if ($ev->type == "incoming")
>       $ev->Acknowledge();
> Marian
> On 26.02.2014 11:03, Marco Bisignano wrote:
>> Hi Marian and ty for your reply, here is my log with sniffer enabled:
>> http://pastebin.com/gDpnv64A
>> FIRST CALL from 3212121 ( to 9413403212121 (messages are
>> ok)
>> SECOND CALL from 3212122 ( to 9413403212122 (multiple bye 
>> and
>> invite)
>> There is a PHP script called cac.php (Call Admission Control), second 
>> call has a major priority so first call is pre-empted (call.drop to 
>> both call channels).
>> If you want I can send you Wireshark capture.
>> Regards.
>> -----Messaggio originale-----
>> Da: Marian Podgoreanu [mailto:marian@...]
>> Inviato: mercoledì 26 febbraio 2014 09:37
>> A: Marco Bisignano; yate@...
>> Oggetto: Re: [yate] Avoid multiple INVITE and BYE
>> Hi,
>> Yate don't send multiple INVITE unless it's a retransmission.
>> If you think it does, please post a log to show it.
>> Marian
>> On 26.02.2014 10:25, Marco Bisignano wrote:
>>> Hi all, someone know if there is a way to avoid Yate sending 
>>> multiple INVITE or BYE messages all equals in the same call ?
>> --
>> Il messaggio e' stato analizzato alla ricerca di virus o contenuti 
>> pericolosi da MailScanner, ed e' risultato sicuro
> --
> Il messaggio e' stato analizzato alla ricerca di virus o contenuti 
> pericolosi da MailScanner, ed e' risultato sicuro

Il messaggio e' stato analizzato alla ricerca di virus o contenuti
pericolosi da MailScanner, ed e' risultato sicuro