Author Topic: H323 To SIP Signalling Proxy - SIP REFER error  (Read 21041 times)

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
H323 To SIP Signalling Proxy - SIP REFER error
« on: April 21, 2015, 11:41:27 AM »
Hi all,

I have setup yate as H323 To SIP Signalling Proxy between Avaya and Asterisk.

The proxy works fine until i try to transfer the call.

I am getting the below error as response from yate to the SIP REFER message of Asterisk .

<sip/5:STUB> initTransfer. Possible incomplete NOTIFY party creation [0x7f20a00230e0]

I have enabled transfer in ysipchan.conf
transfer=enable

and my routing in regexroute.conf is the below (example form official website)

${rtp_forward}possible=;rtp_forward=yes
 ${formats}^\([^,]*\)=;formats=\1
 ${module}^sip$=h323/${called}@50.x.x.50:1720
 ${module}^h323$=sip/sip:${called}@50.x.x.30:5060
.*=-;error=forbidden;reason=Protocol not allowed


I would appreciate some guidelines. Any additional configurations needed for yate in order to handle REFER message?


Below is the log with SIP REFER along with sniffed call.route

------
REFER sip:3xxxxxxxxxxxx4@50.x.x.30:5065 SIP/2.0
Via: SIP/2.0/UDP 50.x.x.30:5060;branch=z9hG4bK6ddcc84b;rport
Max-Forwards: 70
From: <sip:20000@50.x.x.30:5060>;tag=as1ca0dea3
To: "50.x.x.50" <sip:3xxxxxxxxxxxx4@50.x.x.30:5065>;tag=1643256148
Contact: <sip:20000@50.x.x.30:5060>
Call-ID: 829575849@50.x.x.30:5065
CSeq: 102 REFER
User-Agent: Asterisk PBX 1.8.32.2
Refer-To: <sip:3000@50.x.x.30:5065>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Referred-By: <sip:20000@50.x.x.30:5060>
Content-Length: 0

------
2015-04-21_19:24:14.404448 <sip:INFO> 'udp:50.x.x.30:5065' sending code 100 0x7f2a04021120 to 50.x.x.30:5060 [0x12bc560]
------
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 50.x.x.30:5060;branch=z9hG4bK6ddcc84b;rport=5060;received=50.x.x.30
From: <sip:20000@50.x.x.30:5060>;tag=as1ca0dea3
To: "50.x.x.50" <sip:3xxxxxxxxxxxx4@50.x.x.30:5065>;tag=1643256148
Call-ID: 829575849@50.x.x.30:5065
CSeq: 102 REFER
Server: YATE/5.4.3
Content-Length: 0

------
2015-04-21_19:24:14.404936 <sip/1:STUB> initTransfer. Possible incomplete NOTIFY party creation [0x7f2a04005760]
Sniffed 'call.route' time=1429633454.404720
  thread=0x7f2a0402b3d0 'YSIP Transfer'
  data=(nil)
  retval='(null)'
  param['id'] = 'h323/1'
  param['billid'] = '1429633433-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '20000'
  param['divertername'] = ''
  param['reason'] = 'transfer'
  param['sip_contact'] = '<sip:20000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:20000@50.x.x.30:5060>'
2015-04-21_19:24:14.406008 <INFO> Routing call to '3000' in context 'default' via '-' in 417 usec
Returned true 'call.route' delay=0.001310
  thread=0x7f2a0402b3d0 'YSIP Transfer'
  data=(nil)
  retval='-'
  param['id'] = 'h323/1'
  param['billid'] = '1429633433-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '20000'
  param['divertername'] = ''
  param['reason'] = 'Protocol not allowed'
  param['sip_contact'] = '<sip:20000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:20000@50.x.x.30:5060>'
  param['handlers'] = 'subscription:100,jingle:100,h323:100,regexroute:100'
  param['formats'] = ''
  param['error'] = 'forbidden'
2015-04-21_19:24:14.410481 <sip:INFO> 'udp:50.x.x.30:5065' sending code 603 0x7f29f4001c10 to 50.x.x.30:5060 [0x12bc560]
------

Thanks

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #1 on: April 23, 2015, 12:39:13 AM »
As you can see in log the call.route message for the transfer don't have a 'module' parameter.
You regexrouyte rules reject transfer route.
See log entry: Routing call to '3000' in context 'default' via '-' in 417 usec

You may use the 'reason'='transfer' parameter to match it

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #2 on: April 23, 2015, 01:44:49 AM »
Thank you Marian very much for your response,

Let me explain what i am trying to do.

Someone calls to Avaya(H323) and through Yate(H323 <-->SIP proxy) the call is reaching Asterisk(SIP) on extension 2000.

After that i want to transfer the call back to Avaya to extension 3000, so that the person who called talks with 3000 and Asterisk and Yate channels are free...

By putting the below route in regexroute.conf

${reason}transfer=h323/3000@50.x.x.50:1720

i am achieving the call routing to 3000, but as long as the person who called is speaking , Yate has two channels busy... (so it's not actually a transfer but new call...)

I need to release the channels of Yate....

How can i achieve that?




marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #3 on: April 23, 2015, 04:12:49 AM »
A in call with B
A send TRANSFER to C
On success B leg is released, A is connected with C.
If this don't happen please attach a log with sniffer enabled.

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #4 on: April 23, 2015, 06:23:30 AM »
Appreciate your help

I am attaching a scheme of what i want to achieve.

A calls to Avaya and routes to extension 2000 (Yate<-->Asterisk) .
Asterisk transfers the call on Avaya extension 3000 so that A could speak to extension 3000. Asterisk is release . Yate no.

%%+status:h323
name=h323,type=varchans,format=Status|Address|Peer;routed=1,routing=0,total=2,chans=2,cleaning=0;h323/1=connected|50.x.x.50:12406|h323/2,h323/2=answered|50.x.x.50:1720|h323/1


Below is a section from logs, attached is more.


REFER sip:3xxxxxxxxxxxx4@50.x.x.30:5065 SIP/2.0
Via: SIP/2.0/UDP 50.x.x.30:5060;branch=z9hG4bK54f5ee91;rport
Max-Forwards: 70
From: <sip:2000@50.x.x.30:5060>;tag=as062d18a0
To: "50.x.x.50" <sip:3xxxxxxxxxxxx4@50.x.x.30:5065>;tag=1028355859
Contact: <sip:2000@50.x.x.30:5060>
Call-ID: 1819746144@50.x.x.30:5065
CSeq: 102 REFER
User-Agent: Asterisk PBX 1.8.32.2
Refer-To: <sip:3000@50.x.x.30:5065>
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Referred-By: <sip:2000@50.x.x.30:5060>
Content-Length: 0

------
2015-04-23_13:39:00.682197 <sip:INFO> 'udp:50.x.x.30:5065' sending code 100 0x7f993c0029c0 to 50.x.x.30:5060 [0x26294b0]
------
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 50.x.x.30:5060;branch=z9hG4bK54f5ee91;rport=5060;received=50.x.x.30
From: <sip:2000@50.x.x.30:5060>;tag=as062d18a0
To: "50.x.x.50" <sip:3xxxxxxxxxxxx4@50.x.x.30:5065>;tag=1028355859
Call-ID: 1819746144@50.x.x.30:5065
CSeq: 102 REFER
Server: YATE/5.4.3
Content-Length: 0

------
2015-04-23_13:39:00.682649 <sip/1:STUB> initTransfer. Possible incomplete NOTIFY party creation [0x7f9938006cd0]
Sniffed 'call.route' time=1429785540.682420
  thread=0x7f993c00e620 'YSIP Transfer'
  data=(nil)
  retval='(null)'
  param['id'] = 'h323/1'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '2000'
  param['divertername'] = ''
  param['reason'] = 'transfer'
  param['sip_contact'] = '<sip:2000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:2000@50.x.x.30:5060>'
2015-04-23_13:39:00.683929 <INFO> Routing call to '3000' in context 'default' via 'h323/3000@50.x.x.50:1720' in 512 usec
Returned true 'call.route' delay=0.001528
  thread=0x7f993c00e620 'YSIP Transfer'
  data=(nil)
  retval='h323/3000@50.x.x.50:1720'
  param['id'] = 'h323/1'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '2000'
  param['divertername'] = ''
  param['reason'] = 'transfer'
  param['sip_contact'] = '<sip:2000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:2000@50.x.x.30:5060>'
  param['handlers'] = 'javascript:15,cdrbuild:50,fileinfo:90,subscription:100,jingle:100,h323:100,regexroute:100'
  param['formats'] = ''
Sniffed 'call.execute' time=1429785540.682420
  thread=0x7f993c00e620 'YSIP Transfer'
  data=0x7f9944012be0
  retval='(null)'
  param['id'] = 'h323/1'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '2000'
  param['divertername'] = ''
  param['reason'] = 'transfer'
  param['sip_contact'] = '<sip:2000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:2000@50.x.x.30:5060>'
  param['handlers'] = 'javascript:15,cdrbuild:50,fileinfo:90,subscription:100,jingle:100,h323:100,regexroute:100'
  param['formats'] = ''
  param['callto'] = 'h323/3000@50.x.x.50:1720'
2015-04-23_13:39:00.684199 <h323:INFO> Found call to H.323 target='3000@50.x.x.50:1720'
Sniffed 'call.cdr' time=1429785540.683260 (broadcast)
  thread=0x24ec230 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['time'] = '1429785540.496'
  param['chan'] = 'h323/1'
  param['cdrid'] = '1'
  param['runid'] = '1429785529'
  param['operation'] = 'update'
  param['direction'] = 'incoming'
  param['duration'] = '0.187'
  param['billtime'] = '0.175'
  param['ringtime'] = '0.000'
  param['status'] = 'answered'
  param['external'] = '3xxxxxxxxxxxx4'
  param['cdrwrite'] = 'true'
  param['address'] = '50.x.x.50:12406'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['called'] = '2000'
  param['reason'] = 'transfer'
Returned false 'call.cdr' delay=0.003391 (broadcast)
  thread=0x24ec230 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['time'] = '1429785540.496'
  param['chan'] = 'h323/1'
  param['cdrid'] = '1'
  param['runid'] = '1429785529'
  param['operation'] = 'update'
  param['direction'] = 'incoming'
  param['duration'] = '0.187'
  param['billtime'] = '0.175'
  param['ringtime'] = '0.000'
  param['status'] = 'answered'
  param['external'] = '3xxxxxxxxxxxx4'
  param['cdrwrite'] = 'true'
  param['address'] = '50.x.x.50:12406'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['called'] = '2000'
  param['reason'] = 'transfer'
  param['handlers'] = 'queuesnotify:10,cdrcombine:100'
Sniffed 'call.cdr' time=1429785540.684135 (broadcast)
  thread=0x24ec230 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['time'] = '1429785540.496'
  param['chan'] = 'h323/1'
  param['cdrid'] = '1'
  param['runid'] = '1429785529'
  param['operation'] = 'update'
  param['direction'] = 'incoming'
  param['duration'] = '0.188'
  param['billtime'] = '0.176'
  param['ringtime'] = '0.000'
  param['status'] = 'answered'
  param['external'] = '3xxxxxxxxxxxx4'
  param['cdrwrite'] = 'true'
  param['address'] = '50.x.x.50:12406'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['called'] = '2000'
  param['reason'] = 'transfer'
Returned false 'call.cdr' delay=0.002654 (broadcast)
  thread=0x24ec230 'Engine Worker'
  data=(nil)
  retval='(null)'
  param['time'] = '1429785540.496'
  param['chan'] = 'h323/1'
  param['cdrid'] = '1'
  param['runid'] = '1429785529'
  param['operation'] = 'update'
  param['direction'] = 'incoming'
  param['duration'] = '0.188'
  param['billtime'] = '0.176'
  param['ringtime'] = '0.000'
  param['status'] = 'answered'
  param['external'] = '3xxxxxxxxxxxx4'
  param['cdrwrite'] = 'true'
  param['address'] = '50.x.x.50:12406'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['called'] = '2000'
  param['reason'] = 'transfer'
  param['handlers'] = 'queuesnotify:10,cdrcombine:100'
2015-04-23_13:39:00.711870 <h323:ALL> YateH323Connection::YateH323Connection(0x2614830,20223,0x7f993c001980) [0x7f9934000af0]
2015-04-23_13:39:00.711909 <h323/2:ALL> YateH323Chan::YateH323Chan(0x7f9934000af0,(null)) outgoing [0x7f9934005790]
2015-04-23_13:39:00.711964 <h323/2:INFO> Setting H.323 caller: number='3xxxxxxxxxxxx4' name='50.x.x.50'
2015-04-23_13:39:00.711980 <h323/2:ALL> YateH323Connection::rtpForward(0x7f993c001980,0) [0x7f9934000af0]
2015-04-23_13:39:00.712000 >>> DataTranslator::detachChain(0x7f9944025350,0x7f993801fad0)
2015-04-23_13:39:00.712017 <<< DataTranslator::detachChain
2015-04-23_13:39:00.712023 >>> DataTranslator::detachChain(0x7f993801f8f0,0x7f9944026450)
2015-04-23_13:39:00.712030 <<< DataTranslator::detachChain
2015-04-23_13:39:00.712079 <sip/1:ALL> YateSIPConnection::disconnected() 'transfer' [0x7f9938006cd0]
Returned true 'call.execute' delay=0.029910
  thread=0x7f993c00e620 'YSIP Transfer'
  data=0x7f9944012be0
  retval='(null)'
  param['id'] = 'h323/1'
  param['billid'] = '1429785529-1'
  param['caller'] = '3xxxxxxxxxxxx4'
  param['callername'] = '50.x.x.50'
  param['called'] = '3000'
  param['calledname'] = ''
  param['diverter'] = '2000'
  param['divertername'] = ''
  param['reason'] = 'transfer'
  param['sip_contact'] = '<sip:2000@50.x.x.30:5060>'
  param['sip_user-agent'] = 'Asterisk PBX 1.8.32.2'
  param['sip_refer-to'] = '<sip:3000@50.x.x.30:5065>'
  param['sip_allow'] = 'INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE'
  param['sip_supported'] = 'replaces, timer'
  param['sip_referred-by'] = '<sip:2000@50.x.x.30:5060>'
  param['handlers'] = 'javascript:15,cdrbuild:50,fileinfo:90,subscription:100,jingle:100,h323:100,regexroute:100,javascript:15,gvoice:20,queues:45,yrtp:50,cdrbuild:50,lateroute:75,dbwave:90,jingle:90,analyzer:90,dumb:90,conf:90,filetransfer:90,h323:90'
  param['formats'] = ''
  param['callto'] = 'h323/3000@50.x.x.50:1720'
  param['peerid'] = 'h323/2'
  param['targetid'] = 'h323/2'

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #5 on: April 23, 2015, 06:28:48 AM »
I'm sorry, seems that I gave you a wrong information.
The correct one is:

A in call with B
A send TRANSFER to C
On success A leg is released, B is connected with C.

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #6 on: April 23, 2015, 06:59:35 AM »
Actually i am not sure i understand you.

A (telephone device) is in call with B (B = is avaya extension connected to Yate + Asterisk)
I need B to send transfer to C ( C = another extension of avaya, a telephone device)

On Success B is released, A is connected to C.

Currently i am achieving the below

A in call with B
B send transfer to C
A connects with C, but B isn't released ( Yate has two h323 channels open as i see with status h323 command)

Maybe  i am confusing you? Did you understand what i am trying to do  ;D


marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #7 on: April 23, 2015, 08:25:40 AM »
I don't understand.
If you want the REFER to reach the other party: it is not possible, yate is not a proxy, it will handle it!

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #8 on: April 23, 2015, 10:17:44 AM »
Yes i want the REFER message from Asterisk to reach Avaya through Yate...
I thought Yate could act like proxy....

so it is impossible?

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #9 on: April 24, 2015, 02:14:27 AM »
You a SIP to H323 call.
I don't see how a transfer request would reach the remote party.
The only scenario this would work is to use a custom DTMFs sequence and hope the remote party would handle it and initiate a transfer.
Maybe the Avaya would handle it, I don't know if it's possible.

kapoios

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: H323 To SIP Signalling Proxy - SIP REFER error
« Reply #10 on: April 24, 2015, 03:30:22 AM »
i see...

I appreciate your help Marian!!