[ previous ] [ next ] [ threads ]
 To :  Monica Tepelus <monica@v...>
 From :  Konstantin Reshetnikov <kosta@r...>
 Subject :  Re: [yate] problem with call from module queues using queue_out.php
 Date :  Fri, 23 Mar 2012 12:50:04 +0400
Thank you, Monica, it works !

I'm a little bit stupid ;) I already use 'copyparams' to add additional parameters to CDR but did't think about queue ...

23.03.2012, × 12:09, Monica Tepelus ÎÁÐÉÓÁÌ(Á):

> Hi Konstantin,
> 
> You gave to set parameter "copyparams" to "caller,..." when handling call.route so that the queues module knows this should be copied from the initial call.
> 
> |$ev->params["copyparams"] = "caller,callername,billid"     // add billid if you want it the same as the inital call as well
> |
> Regards,
> Monica Tepelus
> 
> Konstantin Reshetnikov wrote:
>> Hi, all
>> 
>> I use module queues.yate to build and work with queues. When operator is hang up, module make a new call to operator from user staying in queue. But there is no any information about caller name, here is a yate trace:
>> 
>> Sniffed 'call.execute' time=1332479866.002552
>>  thread=0xb6000a60 'Engine Worker'
>>  data=(nil)
>>  retval='(null)'
>>  param['called'] = '8122240621'
>>  param['calledname'] = '8122240621'
>>  param['direct'] = 'sip/sip:8122240621@1... '
>>  param['target'] = '8122240621'
>>  param['callto'] = 'external/nodata/splQueue_out.php'
>>  param['notify'] = 'sip/70'
>>  param['queue'] = 'que10145'
>>  param['maxcall'] = '20000'
>>  param['prompt'] = 'wave/play//usr/local/share/yate/sounds/RU/hello.slin'
>> 20120323051746.005629  ExtModChan::ExtModChan(1) [0xb60060b8]
>> 20120323051746.005691  ExtModReceiver::ExtModReceiver("splQueue_out.php","(null)") [0xb6000dc0]
>> Execing '/usr/local/share/yate/scripts/splQueue_out.php' ''
>> 20120323051746.043277  Launched External Script '/usr/local/share/yate/scripts/splQueue_out.php' ''
>> 20120323051746.065761  Install 'call.answered', prio 40 ok
>> 20120323051746.066069  Install 'chan.disconnected', prio 20 filter: 'id'='q-out/11068914554f6c077a0f9a96.76618890' ok
>> 20120323051746.071301  Install 'chan.hangup', prio 80 filter: 'id'='sip/70' ok
>> Returned true 'call.execute' delay=0.069337
>>  thread=0xb6000a60 'Engine Worker'
>>  data=(nil)
>>  retval='(null)'
>>  param['called'] = '8122240621'
>>  param['calledname'] = '8122240621'
>>  param['direct'] = 'sip/sip:8122240621@1... '
>>  param['target'] = '8122240621'
>>  param['callto'] = 'external/nodata/splQueue_out.php'
>>  param['notify'] = 'sip/70'
>>  param['queue'] = 'que10145'
>>  param['maxcall'] = '20000'
>>  param['prompt'] = 'wave/play//usr/local/share/yate/sounds/RU/hello.slin'
>> Sniffed 'call.execute' time=1332479866.000000
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb60060b8
>>  retval='(null)'
>>  param['id'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['caller'] = ''
>>  param['called'] = '8122240621'
>>  param['callto'] = 'sip/sip:8122240621@1... '
>>  param['billid'] = ''
>>  param['maxcall'] = '20000'
>>  param['cdrtrack'] = 'false'
>> 20120323051746.072377  YateSIPConnection::YateSIPConnection(0x816fa98,'sip:8122240621@1... ') [0xb600b6e0]
>> Sniffed 'chan.rtp' time=1332479866.072902
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb600b6e0
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['call_direction'] = 'outgoing'
>>  param['call_address'] = '10.0.1.91:5060'
>>  param['call_status'] = 'outgoing'
>>  param['call_billid'] = ''
>>  param['media'] = 'audio'
>>  param['transport'] = 'RTP/AVP'
>>  param['direction'] = 'bidir'
>>  param['format'] = 'alaw'
>>  param['remoteip'] = '10.0.1.91'
>> 20120323051746.073105  RTP/AVP message received
>> 20120323051746.073208  Guessed local IP '10.0.1.14' for remote '10.0.1.91'
>> 20120323051746.073253  YRTPWrapper::YRTPWrapper('10.0.1.14',0xb600b6e0,'audio',bidir,0xb6008df8,false) [0xb6004660]
>> 20120323051746.073326  YRTPWrapper::setupRTP("10.0.1.14",true) [0xb6004660]
>> 20120323051746.073456  Session 'yrtp/1738790946' 0xb600beb8 bound to 10.0.1.14:8884 +RTCP [0xb6004660]
>> 20120323051746.073510  YRTPSource::YRTPSource(0xb6004660) [0xb6005cd0]
>> 20120323051746.073578  YRTPConsumer::YRTPConsumer(0xb6004660) [0xb6005688]
>> 20120323051746.073630  YRTPWrapper::setupSRTP(false) [0xb6004660]
>> Sniffed 'chan.locate' time=1332479866.000000
>>  thread=0x8173010 'Engine Worker'
>>  data=0xb60060b8
>>  retval='(null)'
>>  param['id'] = 'sip/70'
>> Returned true 'chan.rtp' delay=0.000790
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb600b6e0
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['call_direction'] = 'outgoing'
>>  param['call_address'] = '10.0.1.91:5060'
>>  param['call_status'] = 'outgoing'
>>  param['call_billid'] = ''
>>  param['media'] = 'audio'
>>  param['transport'] = 'RTP/AVP'
>>  param['direction'] = 'bidir'
>>  param['format'] = 'alaw'
>>  param['remoteip'] = '10.0.1.91'
>>  param['localip'] = '10.0.1.14'
>>  param['localport'] = '8884'
>>  param['rtpid'] = 'yrtp/1738790946'
>> Returned true 'chan.locate' delay=0.073918
>>  thread=0x8173010 'Engine Worker'
>>  data=0x819afa0
>>  retval='(null)'
>>  param['id'] = 'sip/70'
>> Returned true 'call.execute' delay=0.074285
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb60060b8
>>  retval='(null)'
>>  param['id'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['caller'] = ''
>>  param['called'] = '8122240621'
>>  param['callto'] = 'sip/sip:8122240621@1... '
>>  param['billid'] = ''
>>  param['maxcall'] = '20000'
>>  param['cdrtrack'] = 'false'
>>  param['peerid'] = 'sip/71'
>>  param['targetid'] = 'sip/71'
>> Sniffed 'chan.startup' time=1332479866.074149
>>  thread=0xb6000a60 'Engine Worker'
>>  data=(nil)
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['status'] = 'outgoing'
>>  param['address'] = '10.0.1.91:5060'
>>  param['targetid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['answered'] = 'false'
>>  param['callid'] = 'sip/143156025@1... /1173085348/'
>>  param['caller'] = ''
>>  param['called'] = '8122240621'
>>  param['billid'] = ''
>>  param['callto'] = 'sip/sip:8122240621@1... '
>>  param['calledfull'] = '8122240621'
>>  param['sip_callid'] = '143156025@1... '
>> Returned false 'chan.startup' delay=0.000810
>>  thread=0xb6000a60 'Engine Worker'
>>  data=(nil)
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['status'] = 'outgoing'
>>  param['address'] = '10.0.1.91:5060'
>>  param['targetid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['answered'] = 'false'
>>  param['callid'] = 'sip/143156025@1... /1173085348/'
>>  param['caller'] = ''
>>  param['called'] = '8122240621'
>>  param['billid'] = ''
>>  param['callto'] = 'sip/sip:8122240621@1... '
>>  param['calledfull'] = '8122240621'
>>  param['sip_callid'] = '143156025@1... '
>> Sniffed 'chan.connected' time=1332479866.074232
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb600b6e0
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['status'] = 'outgoing'
>>  param['address'] = '10.0.1.91:5060'
>>  param['targetid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['peerid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['answered'] = 'false'
>>  param['callid'] = 'sip/143156025@1... /1173085348/'
>> Returned false 'chan.connected' delay=0.001165
>>  thread=0xb6000a60 'Engine Worker'
>>  data=0xb600b6e0
>>  retval='(null)'
>>  param['id'] = 'sip/71'
>>  param['module'] = 'sip'
>>  param['status'] = 'outgoing'
>>  param['address'] = '10.0.1.91:5060'
>>  param['targetid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['peerid'] = 'q-out/11068914554f6c077a0f9a96.76618890'
>>  param['answered'] = 'false'
>>  param['callid'] = 'sip/143156025@1... /1173085348/'
>> Sniffed 'call.cdr' time=1332479866.074885 (broadcast)
>>  thread=0xb6000a60 'Engine Worker'
>>  data=(nil)
>>  retval='(null)'
>>  param['time'] = '1332479866.074'
>>  param['chan'] = 'sip/71'
>>  param['cdrid'] = '71'
>>  param['runid'] = '1332306719'
>>  param['operation'] = 'initialize'
>>  param['direction'] = 'outgoing'
>>  param['duration'] = '0.001'
>>  param['billtime'] = '0.000'
>>  param['ringtime'] = '0.000'
>>  param['status'] = 'outgoing'
>>  param['external'] = '8122240621'
>>  param['cdrwrite'] = 'true'
>>  param['address'] = '10.0.1.91:5060'
>>  param['called'] = '8122240621'
>>  param['calledfull'] = '8122240621'
>> 20120323051746.076150  'udp:0.0.0.0:5060' sending 'INVITE sip:8122240621@1...'  0xb600b270 to 10.0.1.91:5060 [0x80c6bb8]
>> ------
>> INVITE sip:8122240621@1... SIP/2.0
>> Max-Forwards: 20
>> Via: SIP/2.0/UDP 10.0.1.14:5060;rport;branch=z9hG4bK1632063316
>> From: ;tag=1173085348
>> To: 
>> Call-ID: 143156025@1... 
>> CSeq: 341 INVITE
>> User-Agent: SIPLANT IP PBX
>> Contact: 
>> Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO, SUBSCRIBE, NOTIFY
>> Content-Type: application/sdp
>> Content-Length: 224
>> 
>> v=0
>> o=yate 1332479866 1332479866 IN IP4 10.0.1.14
>> s=SIP Call
>> c=IN IP4 10.0.1.14
>> t=0 0
>> m=audio 8884 RTP/AVP 8 3 11 101
>> a=rtpmap:8 PCMA/8000
>> a=rtpmap:3 GSM/8000
>> a=rtpmap:11 L16/8000
>> a=rtpmap:101 telephone-event/8000
>> ------
>> 
>> I marked by red empty parameter 'caller' in call.execute and as a result caller name 'anonymous' in SIP INVITE message.
>> 
>> I use queue_in/queue_out php scripts to manage messages. In queue_out.php there is a code (I don't modify it - it came from Null Team):
>> 
>> case "call.execute":
>>   $partycallid = $ev->GetValue("notify");
>>   $caller = $ev->GetValue("caller");
>>   $prompt = $ev->GetValue("prompt");
>>   $queue = $ev->GetValue("queue");
>>   $ev->handled=true;
>>   Yate::Install("chan.hangup",80,"id",$partycallid);
>>   // create call leg to operator
>>   $m = new Yate("call.execute");
>>   $m->params["id"] = $ourcallid;
>>   $m->params["caller"] = $caller;
>>   $m->params["called"] = $ev->GetValue("called");
>>   $m->params["callto"] = $ev->GetValue("direct");
>>   $m->params["billid"] = $ev->GetValue("billid");
>>   $m->params["maxcall"] = $ev->GetValue("maxcall");
>>   $m->params["cdrtrack"] = "false";
>>   $m->Dispatch();
>> 
>> I see that script try to fill parameter 'caller' (marked by red), but there is no incoming parameter 'caller' in message call.execute from queues module. This can be seen at the beginning of the trace. 
>> As a result parameter 'caller' is empty ...
>> 
>> Can anybody explain me where is my mistake ?
>> 
>> WBR,
>> 
>> Konstantin
>> 
> 

ó Õ×ÁÖÅÎÉÅÍ,

ëÏÎÓÔÁÎÔÉÎ òÅÛÅÔÎÉËÏ×.