Author Topic: masquerade message from external does not work  (Read 6196 times)

xyswitchz

  • Newbie
  • *
  • Posts: 26
    • View Profile
masquerade message from external does not work
« on: September 19, 2017, 06:57:06 AM »
The script below does not seem to work. Sniffer show the message is received but wav file is not played.


<?php

require_once("libyate.php");

Yate::Init(true,'localhost','5050');

$m = new Yate("chan.masquerade");
$m->SetParam("messagae", "chan.attach");
$m->SetParam("id", "dumb/1");
$m->SetParam("source", "wave/play//home/sounds/jazz.slin");
$m->Dispatch();


any advice please?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: masquerade message from external does not work
« Reply #1 on: September 20, 2017, 12:56:48 AM »
You should post a log to see what happens.

xyswitchz

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: masquerade message from external does not work
« Reply #2 on: September 20, 2017, 03:41:03 AM »
This is my log


2017-09-20_11:30:09.355427 <sip:INFO> 'udp:0.0.0.0:5060' received 738 bytes SIP message from 10.196.200.15:4060 [0x1d96600]
------
INVITE sip:9000@10.196.200.15 SIP/2.0
Via: SIP/2.0/UDP 10.196.200.15:4060;branch=z9hG4bK.VawvebPnJ;rport
From: <sip:me@10.196.200.15>;tag=kgVcoLjMd
To: sip:9000@10.196.200.15
CSeq: 20 INVITE
Call-ID: 224046czBa
Max-Forwards: 70
Supported: replaces, outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 164
Contact: "desktop" <sip:desktop@10.196.200.15:4060>;+sip.instance="<urn:uuid:fb3bcaa2-27c3-4445-967a-583c0f602fe2>"
User-Agent: Linphone/3.7.0 (belle-sip/1.3.2)

v=0
o=me 2098 3773 IN IP4 10.196.200.15
s=Talk
c=IN IP4 10.196.200.15
t=0 0
m=audio 16392 RTP/AVP 0 8 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
------
2017-09-20_11:30:09.363965 <sip:INFO> 'udp:0.0.0.0:5060' sending code 100 0x7f9a900008c0 to 10.196.200.15:4060 [0x1d96600]
------
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.196.200.15:4060;branch=z9hG4bK.VawvebPnJ;rport=4060;received=10.196.200.15
From: <sip:me@10.196.200.15>;tag=kgVcoLjMd
To: sip:9000@10.196.200.15
Call-ID: 224046czBa
CSeq: 20 INVITE
Server: YATE/5.5.0
Content-Length: 0



xyswitchz

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: masquerade message from external does not work
« Reply #3 on: September 20, 2017, 03:43:03 AM »
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.196.200.15:4060;branch=z9hG4bK.VawvebPnJ;rport=4060;received=10.196.200.15
From: <sip:me@10.196.200.15>;tag=kgVcoLjMd
To: sip:9000@10.196.200.15;tag=1733506880
Call-ID: 224046czBa
CSeq: 20 INVITE
Server: YATE/5.5.0
Contact: <sip:9000@10.196.200.15:5060>
Allow: ACK, INVITE, BYE, CANCEL, REGISTER, REFER, OPTIONS, INFO, MESSAGE
Content-Type: application/sdp
Content-Length: 209

v=0
o=yate 1505903409 1505903409 IN IP4 10.196.200.15
s=SIP Call
c=IN IP4 10.196.200.15
t=0 0
m=audio 21874 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
------

xyswitchz

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: masquerade message from external does not work
« Reply #4 on: September 20, 2017, 03:43:45 AM »
------
ACK sip:9000@10.196.200.15:5060 SIP/2.0
Via: SIP/2.0/UDP 10.196.200.15:4060;rport;branch=z9hG4bK.G3oQWelLa
From: <sip:me@10.196.200.15>;tag=kgVcoLjMd
To: <sip:9000@10.196.200.15>;tag=1733506880
CSeq: 20 ACK
Call-ID: 224046czBa
Max-Forwards: 70

------
Sniffed 'chan.rtp' time=1505903409.402456
  thread=0x1d92470 'YSIP EndPoint'
  data=0x7f9a90001900
  retval='(null)'
  param['id'] = 'sip/1'
  param['module'] = 'sip'
  param['call_direction'] = 'incoming'
  param['call_address'] = '10.196.200.15:4060'
  param['call_status'] = 'answered'
  param['call_billid'] = '1505903386-1'
  param['rtpid'] = 'yrtp/1472822346'
  param['media'] = 'audio'
  param['transport'] = 'RTP/AVP'
  param['direction'] = 'bidir'
  param['format'] = 'mulaw'
  param['ipv6_support'] = 'false'
  param['localip'] = '10.196.200.15'
  param['remoteip'] = '10.196.200.15'
  param['remoteport'] = '16392'
  param['payload'] = '0'
  param['evpayload'] = '101'
2017-09-20_11:30:09.402588 <yrtp:INFO> RTP starting format 'mulaw' payload 0 [0x7f9a9400bbe0]
Returned true 'chan.rtp' delay=0.000217
  thread=0x1d92470 'YSIP EndPoint'
  data=0x7f9a90001900
  retval='(null)'
  param['id'] = 'sip/1'
  param['module'] = 'sip'
  param['call_direction'] = 'incoming'
  param['call_address'] = '10.196.200.15:4060'
  param['call_status'] = 'answered'
  param['call_billid'] = '1505903386-1'
  param['rtpid'] = 'yrtp/1472822346'
  param['media'] = 'audio'
  param['transport'] = 'RTP/AVP'
  param['direction'] = 'bidir'
  param['format'] = 'mulaw'
  param['ipv6_support'] = 'false'
  param['localip'] = '10.196.200.15'
  param['remoteip'] = '10.196.200.15'
  param['remoteport'] = '16392'
  param['payload'] = '0'
  param['evpayload'] = '101'
  param['handlers'] = 'yrtp:100'
  param['localport'] = '21874'
  param['status'] = 'updated'
2017-09-20_11:30:09.402770 <NOTE> Choosing started 'audio' format 'mulaw' [0x7f9a90008ac0]
Sniffed 'module.update' time=1505903415.000851
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'yrtp'
  param['chans'] = '1'
  param['mirrors'] = '0'
Returned true 'module.update' delay=0.000187
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'yrtp'
  param['chans'] = '1'
  param['mirrors'] = '0'
  param['handlers'] = 'engine:1,monitoring:100'
  param['nodename'] = 'himalaya'
Sniffed 'module.update' time=1505903415.000878
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'sip'
  param['failed_auths'] = '0'
  param['transaction_timeouts'] = '0'
  param['bye_timeouts'] = '0'
Returned true 'module.update' delay=0.000217
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'sip'
  param['failed_auths'] = '0'
  param['transaction_timeouts'] = '0'
  param['bye_timeouts'] = '0'
  param['handlers'] = 'engine:1,monitoring:100'
  param['nodename'] = 'himalaya'
Sniffed 'module.update' time=1505903415.000903
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'dumb'
  param['routed'] = '0'
  param['routing'] = '0'
  param['total'] = '1'
  param['chans'] = '1'
Returned true 'module.update' delay=0.000248
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['module'] = 'dumb'
  param['routed'] = '0'
  param['routing'] = '0'
  param['total'] = '1'
  param['chans'] = '1'
  param['handlers'] = 'engine:1,monitoring:100'
  param['nodename'] = 'himalaya'


2017-09-20_11:30:42.068970 <INFO> Listener 'conferlisterner' got connection from '127.0.0.1:51743'
2017-09-20_11:30:42.069107 <ExtModule:INFO> Read EOF on 0x7f9a880008c0 [0x7f9a88000980]
Sniffed 'chan.masquerade' time=1505903442.000000
  thread=0x1ca10c0 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['messagae'] = 'chan.attach'
  param['id'] = 'dumb/1'
  param['source'] = 'wave/play//home/sounds/Jazz.slin'
Returned false '(null)' delay=0.069205
  thread=0x1ca10c0 'Engine Worker'
  data=0x7f9a94007390
  retval='(null)'
  param['messagae'] = 'chan.attach'
  param['id'] = 'dumb/1'
  param['source'] = 'wave/play//home/sounds/Jazz.slin'
  param['handlers'] = 'conf:10,iax:10,wave:10,tone:10,jingle:10,filetransfer:10,callfork:10,analyzer:10,sip:10,dumb:10'
  param['module'] = 'dumb'
  param['status'] = 'outgoing'
  param['targetid'] = 'sip/1'
  param['billid'] = '1505903386-1'
  param['peerid'] = 'sip/1'
  param['lastpeerid'] = 'sip/1'
  param['answered'] = 'false'
  param['direction'] = 'outgoing'
Unloading external module 'conferlisterner' ''





marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: masquerade message from external does not work
« Reply #5 on: September 20, 2017, 03:54:18 AM »
Didn't saw it in first post: message name parameter in chan.masquerade should be 'message' not 'messagae'

xyswitchz

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: masquerade message from external does not work
« Reply #6 on: September 20, 2017, 04:57:10 AM »
awesome, thank you