Author Topic: Routing call based on SIP message  (Read 13294 times)

arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Routing call based on SIP message
« on: March 28, 2014, 05:21:46 AM »
Hi

Could you please provide an example for routing a call based on SIP message in regexroute.conf

Ex.

If Yate receives an INVITE then sending INVITE according to routing table and Yate server gets 480 Temporarily unavailable SIP message then play announcement or route call to another trunk.

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Routing call based on SIP message
« Reply #1 on: March 31, 2014, 01:20:47 AM »
Hi,

See http://docs.yate.ro/wiki/Call_Forker on how to fork a call.

Here is an example of playing announcement:

^123$=fork;fork.stop=noanswer^;callto.1=sip/sip:123@127.0.0.1;callto.2=|;callto.3=wave/play//myfile.au

The above rule will call on sip to 123@127.0.0.1. If the call fails fork will stop if reason is not 'noanaswer' (480). If the call fails with 480 it will call to wavechan module to play the file myfile.au on incoming call leg.


arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Routing call based on SIP message
« Reply #2 on: April 01, 2014, 05:08:51 AM »
Hi,
thank You Marian,i will have a try.

arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Routing call based on SIP message
« Reply #3 on: January 22, 2016, 12:26:45 AM »
Hi,

Dear Marian,

Could we fix two end causes for to be checked in case of forking like

^123$=fork;fork.stop=noanswer,failure^;callto.1=sip/sip:123@127.0.0.1;callto.2=|;callto.3=wave/play//myfile.au

thank you

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Routing call based on SIP message
« Reply #4 on: January 22, 2016, 01:08:51 AM »
fork.stop is a regexp. If you want to match a list use the pipe char to separate items.
You may set multiple causes like: noanswer\|failure
Keep in mind: the char ^ added at regexp end reverses the condition, i.e. fork will stop if not matched.

arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Routing call based on SIP message
« Reply #5 on: January 22, 2016, 04:57:44 AM »
Thanks a lot Marian,

I'll try and let You know results

arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Routing call based on SIP message
« Reply #6 on: January 25, 2016, 01:28:07 PM »
Dear Marian

I have added with pipe character but in fact while receiving 480 SIP response the fork stops

^+1\(.*\)$=fork;fork.stop=noconn\|noanswer^;callto.1=sip/sip:1\1@11.22.33.44;callto.2=|;callto.3=sip/sip:1\1@55.66.77.88;

marian

  • Hero Member
  • *****
  • Posts: 513
    • View Profile
Re: Routing call based on SIP message
« Reply #7 on: January 26, 2016, 02:05:14 AM »
Please attach yate log.
I mean full log, including call fork start and end.

arts111199

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Routing call based on SIP message
« Reply #8 on: January 29, 2016, 01:27:57 AM »
Dear Marian,

Before i can collect logs because its a live server with huge amount of simultaneous calls could You PLEASE answer my new Topic "Yate changing RTP port ".
Its very important for us.
Thanks for understanding.