Nik Pakar | 19 Dec 12:44 2014

Multiple parameters for a custom osip field

Hello all,

I need to add a custom record-route header to an outgoing call with multiple parameters. If i separate it with ; it takes as a breaker in regexroute.

How to avoid this achieve some thing like below using osip_Record-Route from regex ?

I.e. Record-Route: <sip:;lr=on;ftag=1563393420;did=f6.1612>

Thanks for any hint.

Best Rgds
Mark Chehovsky | 18 Dec 13:04 2014

SIP-T ISUP issue

hello all,
I have latest Yate installed from SVN
When i setup isup=yes i get extra "\r\n" in SIP message and my peer(Sonus) complains about this
part of message looks like this (captured with ngrep)
Content-Length: 423.

but RFC2046 tells us to have just one "linebreak" at this place
so we need to have this way :
Content-Length: 423.

after this - all works ok, i tried fast and changed message.cpp making
s << "Content-Length: " << body->getBody().length() << "\r\n\r\n";
to be

s << "Content-Length: " << body->getBody().length() << "\r\n";

and i have one linebreak & ISUP call works,but this (as expected) destroys normal SIP operation(no linebreak and packet is malformed/unusable)

Could somebody who knows the place where fix can be applied to tell me where this place is? :)

Thanks a lot in advance











Это сообщение свободно от вирусов и вредоносного ПО благодаря avast! Antivirus защита активна.

Bipin Patel | 18 Dec 11:19 2014

yate on raspberry pi (debian) routing issue


i managed to get yate from sources and compiled it on raspberry pi, thanks to the excellent guide, but there seems to be one small issue. I want to route all calls from a single regfile account to a specific line specified in accfile and my regexroute entry works fine when used on a windows machine using the below entry:


but when i use the same on raspberry pi i keep getting errors "call cant find target" where as yate has registered to remote gateway successfully and client also registered to yate.

when i use the below entry then it seems to work but its not what i want to achieve:


can any1 guide me whats wrong in the regexroute entry that seems to work on a windows machine but not on linux

body { font-family: Verdana, sans-serif; font-size: 0.8em; color:#484848; } h1, h2, h3 { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; } p.footr { font-family: "Trebuchet MS", Verdana, sans-serif; margin:0in; margin-bottom:.0001pt; } h1 { font-size: 1.2em; } h2, h3 { font-size: 1.1em; } a, a:link, a:visited { color: #2A5685;} a:hover, a:active { color: #c61a1a; } { display: none; } hr { width: 100%; height: 1px; background: #ccc; border: 0; } Regards,

Arthur Taylor | 9 Dec 12:23 2014

Rare Race Condition in RefObject::ref()

Firstly, Hello, this is my first post to this mailing list.

Secondly, although rare, there exits a race condition in 
RefObject::ref() when atomic operations are enabled. The desired 
behaviour of the function is increment it the refcount if it is greater 
than zero atomically. Currently the function, when using atomics 
operations is:
(pseudo code)

if atomic(++refcount) > 1:
	return true
return false

Unfortunately while two components are atomic, together they are not, 
and it is possible for the code to be pre-empted between the increment 
and decrement. I have written a test program which does this by 
continually ref()'ing and if the ref() succeeds deref()'ing a dead 
(refcount == 0) object. The result is that an object with a ref-count 
of zero will be incremented twice by two inter-spliced ref() calls, one 
of which fails, the other succeeding. When the corresponding deref() 
for the succeeding call is executed the object will be destroyed again, 
causing a seg-fault.

Admittedly, this is only an issue with repeated attempts by different 
threads to ref() a destroyed object, a behaviour which is already a 
programing bug. To that end, I'm not sure how much point there is to 
decrementing the refcount and returning false, as surely it would be 
better to abort or print a loud warning.

However, there is a fix to make the ref() function atomic, using the 
atomic-compare-exchange-loop pattern (which is how gcc implements some 
of the __sync... functions on x86 anyways).
(pseudo code)

int i := refcount
while i > 0:
	int j
	int k := i + 1
		j := refcount
		if refcount == i:
			refcount := k
	if j == i:
		return true
	i := j
return false

As a patch:

diff --git a/engine/TelEngine.cpp b/engine/TelEngine.cpp
index 185803b..ccd3e12 100644
--- a/engine/TelEngine.cpp
+++ b/engine/TelEngine.cpp
 <at>  <at>  -933,14 +933,15  <at>  <at>  bool RefObject::ref()
 #ifdef ATOMIC_OPS
 #ifdef _WINDOWS
-    if (InterlockedIncrement((LONG*)&m_refcount) > 1)
-	return true;
-    InterlockedDecrement((LONG*)&m_refcount);
+    for (LONG i = m_refcount, j; i > 0; i = j) {
+	j = InterlockedCompareExchange((LONG*)&m_refcount, i + 1, i);
-    if (__sync_add_and_fetch(&m_refcount,1) > 1)
-	return true;
-    __sync_sub_and_fetch(&m_refcount,1);
+    for (int i = m_refcount, j; i > 0; i = j) {
+	j = __sync_val_compare_and_swap(&m_refcount, i, i + 1);
+	if (i == j)
+	    return true;
+    }
     Lock lock(m_mutex);
     if (m_refcount > 0) {

Igor Projoga | 9 Dec 10:57 2014

302 and call.fork

Hello, I need a help,

when I make a fork in call.route and endpoint send to me 302(moved temporarily), nothing happens.
If call.route return without fork, all right work correct.
Module pbx.assist enabled.

How do I do that redirect work when I use call.fork?

thank you
Dragon | 7 Dec 13:12 2014

yate to pstn

   I want to YATE as call center,but connect PSTN is analog/digital line  ,no ISDN,such as sangoma card A200,A400.  which one module is analog /digital interface to PSTN? please give me a image of TOPO,thanks .
Dragon | 6 Dec 16:15 2014

转发:analog to PSTN

------------------ 原始邮件 ------------------
发件人: "我自己的邮箱";<23560450 <at>>;
发送时间: 2014年12月6日(星期六) 晚上11:10
收件人: "yate-info"<yate-info <at>>; "yate-faq"<yate-faq <at>>;
主题: analog to PSTN

   I want to YATE as call center,but connect PSTN is analog/digital line  ,no ISDN,such as sangoma card A200,A400.  which one module is analog /digital interface to PSTN? please give me a image of TOPO,thanks .
Kulkov Ivan | 5 Dec 13:42 2014

Re: Configuring SS7: Audiocodes Mediant 200

Thanks for the advice, I learned about m2pa this late at night today )

Now my configuration files:



Layer 2 works well:

%%+status:sig m2k-linkset0

And what to do with Layer 3? Or it depends on the remote side?

status sig isup-tr0
%%+status:sig isup-tr0
module=sig,trunk=isup-tr0,type=ss7-isup;circuits=30,status=Remote unavailable,calls=0,available=30,resetting=0,locked=0,idle=30

My second question. Can tell by routing it should be, what would make my first call, through the SS7 trunk?

I found this example:

${address}^192\.168\.x\.x\:=goto authorized

; then ask the indicators answer an incoming call with SS7
${module}^sig$=sip/sip:${called} <at> 192.168.x.x

.*=-;error=forbidden;reason=Protocol not allowed


;then set the indicators on the outgoing o in SS7
^[1-9][0-9]\{10,\}$=; sig.ForwardCallIndicators = international,isdn-orig,isup-path;
^[1-9][0-9]\{10,\}$=; sig.callerscreening = user-provided-passed;
^[1-9][0-9]\{10,\}$=; sig.TransmissionMediumRequirement = 3.1khz-audio; sig.inn = 0; caller = ${caller}
^[1-9][0-9]\{10,\}$= sig/${called}.; link = m2k-link0;


04.12.2014 6:40, Romeu Medeiros пишет:
Hello Kulkov 

The mediant do not support m2pa, only the m2ua, change your configuration to use m2ua, if don't work tell us.


Em quarta-feira, 3 de dezembro de 2014, Kulkov Ivan <> escreveu:
Good day! I want to configure the Mediant 2000 gateway for calls from Yate.
But until they rise signaling links

status sig isup-tr0
%%+status:sig isup-tr0
module=sig,trunk=isup-tr0,type=ss7-isup;circuits=30,status=Layer 3 down,calls=0,available=30,resetting=0,locked=0,idle=30
status sig m2k-linkset0
%%+status:sig m2k-linkset0

My configuration files


[m2k-link0] type=sctp stream=true local=192.168.x.x:3566 remote=192.168.x.x:3566 endpoint=true

[gw ds/tr0] user=ds/tr0/1 version=MGCP 1.0 chans=31 host=192.168.x.x address=192.168.x.x voicechans=1-15.17-31 forward_rtp=yes bearer=alaw

[isup-tr0] enable=yes type=ss7-isup pointcodetype=ITU pointcode=0-14-1 defaultpointcode=0-14-1 remotepointcode=0-75-3 netindicator=national service=5 voice=ds/tr0 sls=auto format=alaw lockgroup=yes earlyacm=yes strategy=increment strategy-restrict=even numplan=isdn presentation=allowed screening=user-provided [m2k-linkset0] type=ss7-m2u netind2pctype=ITU local=ITU,0-14-1 adjacent=ITU,0-75-3 link=m2k-link0 [m2k-link0] type=ss7-m2pa sig=m2k-link0 autostart=yes print-messages=yes extended-debug=yes

May be some settings incorrect?

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