0

I need to do special handling in freeswitch when receiving a REFER message from an Avaya SIP trunk. But I am not sure whether Sofia-SIP allows users to specify a callback hook when REFER is received. I haven't found one.

I want to add a custom freeswitch module just to handle REFER. How can I force Sofia-SIP to cede control to my custom module while handling REFER?

Slimshadddyyy
  • 4,085
  • 5
  • 59
  • 121
Sharath
  • 1,627
  • 2
  • 18
  • 34

2 Answers2

1

Having FreeSWITCH, i would recommend using the LUA module that provides a Event Callback for the REFER handling. This can allow you control with what you want to do with the REFER message.

mod_lua is well documented as a module in freeswitch. The pain is coding in LUA which is easy or hard based on your preferences.

Rajesh
  • 660
  • 4
  • 12
  • Ah! I looked up whether an event is generated when out-of-dialogue REFER is received. It does generate CALL_SETUP_REQ event, which I can easily catch in my custom module written in C++. I don't need lua to process it. Thanks, this works for me. :-) – Sharath Apr 29 '15 at 15:07
0

I would suggest to place Kamailio server between them, and do the granular message handling as required

Stanislav Sinyagin
  • 1,973
  • 10
  • 10
  • Hmm.. I just have a 20 line c++ code that needs to be executed when REFER is received by freeswitch. Does Kamailio let me execute my code? BTW, I don't want to run into GPL license issues. – Sharath Apr 28 '15 at 12:42
  • You can easily rewrite this piece in kamailio script language. I don't know how easy it is to add a c++ code to kamailio, need to look up the docs. – Stanislav Sinyagin Apr 28 '15 at 16:03
  • Let me investigate this. I need to start a SIP dialog, if I start it in Kamailio, then I need to work out how all the rest of the stuff falls in place. – Sharath Apr 28 '15 at 17:56
  • Come over to Skype: ssinyagin – Stanislav Sinyagin Apr 28 '15 at 18:34