Converting old to new style "hold" reINVITE reques
Moderator: Brekeke Support Team
Converting old to new style "hold" reINVITE reques
1. Brekeke Product Name and Version: BSS 3.3.4.4 Evaluation
2. Java version: 1.7.0
3. OS type and the version: Windows 7
4. UA (phone), gateway or other hardware/software involved: Nuance NVP, Lync 2013
5. Your problem:
Nuance issues their "hold" reINVITE requests in the old RFC 2543 way, namely specifying a reINVITE with connection information of 0.0.0.0 as the IP address. However, this has been deprecated, being replaced with RFC 3264, section 8.4, where instead, you keep the Connection Information address, and change the media attribute on the stream from sendrecv to sendonly, and Lync 2013 only supports the latter.
So I need to know if the BSS can help me rewrite the SDP in the reINVITE packet to change the Connection Information address and add the media attribute I need, and if so, how to do it in the dial plan.
(Parenthetically, is there a document that indicates all the things that one can manipulate in packets traversing the BSS?)
Thanks in advance,
/Will Sadkin
2. Java version: 1.7.0
3. OS type and the version: Windows 7
4. UA (phone), gateway or other hardware/software involved: Nuance NVP, Lync 2013
5. Your problem:
Nuance issues their "hold" reINVITE requests in the old RFC 2543 way, namely specifying a reINVITE with connection information of 0.0.0.0 as the IP address. However, this has been deprecated, being replaced with RFC 3264, section 8.4, where instead, you keep the Connection Information address, and change the media attribute on the stream from sendrecv to sendonly, and Lync 2013 only supports the latter.
So I need to know if the BSS can help me rewrite the SDP in the reINVITE packet to change the Connection Information address and add the media attribute I need, and if so, how to do it in the dial plan.
(Parenthetically, is there a document that indicates all the things that one can manipulate in packets traversing the BSS?)
Thanks in advance,
/Will Sadkin
Use Brekeke PBX instead of Brekeke SIP Server.
It will recognize 0.0.0.0 as call-hold and then the callee will hear call-hold music.
Another way is the plugin for Brekeke SIP Server.
This plugin converts SDP to meet the requirement.
The Plugin API is:
http://www.brekeke-sip.com/download/bss ... gin_en.txt
With the plugin, you can keep using Brekeke SIP Server.
It will recognize 0.0.0.0 as call-hold and then the callee will hear call-hold music.
Another way is the plugin for Brekeke SIP Server.
This plugin converts SDP to meet the requirement.
The Plugin API is:
http://www.brekeke-sip.com/download/bss ... gin_en.txt
With the plugin, you can keep using Brekeke SIP Server.
I cannot find "the plugin" for the BSS, or "this plugin [that] converts SDP to meet the requirement..." The document you linked to shows a sketch of how to roll my own using an API, but gives few details about the actual construction or the primitives available in that API. Is that what you intended, or is there a library of existing compiled, installable plugins I can choose/buy from?Another way is the plugin for Brekeke SIP Server.
This plugin converts SDP to meet the requirement.
The Plugin API is:
http://www.brekeke-sip.com/download/bss ... gin_en.txt
With the plugin, you can keep using Brekeke SIP Server.
Plugin java API are parts of Brekeke SIP Server's JAR files.
I tried to make the plugin and it seems to work.
I tried to make the plugin and it seems to work.
Code: Select all
package plugin.session ;
import java.util.regex.* ;
import com.brekeke.net.sip.sv.session.plugins.* ;
import com.brekeke.net.content.* ;
public class test extends AccountingBase
{
static Pattern pattern = Pattern.compile( "c=IN *IP4 *(.+)" ) ;
String szConnectAddrUAC = null ;
String szConnectAddrUAS = null ;
public void procINVITE( com.brekeke.net.sip.sv.ClientStat cs, com.brekeke.net.sip.SIPpacket sippacket, boolean bRequest )
{
try {
// Get SDP Content
Content sdpContent = ( Content.getContent( sippacket.getContent(), "application/sdp" ) ) ;
if ( sdpContent != null ) {
String data = sdpContent.toString() ;
Matcher matcher = pattern.matcher( data ) ;
if ( matcher.find() ) {
String szConnectAddr = matcher.group( 1 ) ;
if ( szConnectAddr.equals( "0.0.0.0" ) ) {
// Replace
if ( cs.bSrc ) {
if ( szConnectAddrUAC != null ) {
data = matcher.replaceFirst( "c=IN IP4 " + szConnectAddrUAC ) ;
}
}
else {
if ( szConnectAddrUAS != null ) {
data = matcher.replaceFirst( "c=IN IP4 " + szConnectAddrUAS ) ;
}
}
// Add "a=sendonly"
if ( data.indexOf( "a=sendonly" ) < 0 ) {
data += "a=sendonly\r\n" ;
}
sdpContent.setData( data.getBytes() ) ;
}
else {
if ( cs.bSrc ) {
if ( szConnectAddrUAC == null ) {
szConnectAddrUAC = szConnectAddr ;
}
}
else {
if ( szConnectAddrUAS == null ) {
szConnectAddrUAS = szConnectAddr ;
}
}
// Add "a=sendrecv"
if ( data.indexOf( "a=sendrecv" ) < 0 ) {
data += "a=sendrecv\r\n" ;
}
sdpContent.setData( data.getBytes() ) ;
}
}
}
}
catch ( Exception ex ) {
}
super.procINVITE( cs, sippacket, bRequest ) ;
}
}
Thanks Laurie;
There's only one problem: I've never worked with java or compiled a .jar file, so I don't know how to go from what you've graciously provided to something I can use. Can you provide me with the .jar you built and/or give me "face the stove" instructions on building it for myself and then installing it on my system?
Thanks,
/Will Sadkin
There's only one problem: I've never worked with java or compiled a .jar file, so I don't know how to go from what you've graciously provided to something I can use. Can you provide me with the .jar you built and/or give me "face the stove" instructions on building it for myself and then installing it on my system?
Thanks,
/Will Sadkin
Laurie,
I found this post (http://www.brekeke-sip.com/bbs/viewtopic.php?t=5338) which pointed me in enough of the right direction that I think I have compiled and produced the necessary jar file. (I had to replace "proxy" with "sip" in the paths, but it seemed to compile with no errors, and I put the resulting jar in the appropriate lib dir with the others.)
I then went to the Configuration/Advanced tab in the BSS control UI, and specified
since that seems to be what's at the top of your example. (Please let me know if this is correct or if not, how I should activate the plugin.)
However, I'm a bit confused on the resulting dial plan/admin UI details; your classes' procINVITE method signature looks like:
That is, it takes something other than a string as its first argument, and it doesn't return anything, so it doesn't follow the tutorial's model of invoking the plugin, as there's no deployment pattern that seems applicable, so I don't understand how to therefore apply this method in the dial plan.
Can you give me an example of how you would write a rule that uses this?
Thanks in advance
I found this post (http://www.brekeke-sip.com/bbs/viewtopic.php?t=5338) which pointed me in enough of the right direction that I think I have compiled and produced the necessary jar file. (I had to replace "proxy" with "sip" in the paths, but it seemed to compile with no errors, and I put the resulting jar in the appropriate lib dir with the others.)
I then went to the Configuration/Advanced tab in the BSS control UI, and specified
Code: Select all
dialplan.plugins.matching.pkg = plugin.session
However, I'm a bit confused on the resulting dial plan/admin UI details; your classes' procINVITE method signature looks like:
Code: Select all
public void procINVITE( com.brekeke.net.sip.sv.ClientStat cs, com.brekeke.net.sip.SIPpacket sippacket, boolean bRequest )
{
That is, it takes something other than a string as its first argument, and it doesn't return anything, so it doesn't follow the tutorial's model of invoking the plugin, as there's no deployment pattern that seems applicable, so I don't understand how to therefore apply this method in the dial plan.
Can you give me an example of how you would write a rule that uses this?
Thanks in advance
Hi
> I then went to the Configuration/Advanced tab in the BSS control UI, and specified
> dialplan.plugins.matching.pkg = plugin.session
You don't have to put it in the [Advanced] page.
For executing the plugin, use this line in the Deploy Pattern.
$session = plugin.session.test
so the DialPlan rule will look like this.
[Matching patterns]
$request = ^INVITE
[Deploy patterns]
$session = plugin.session.test
$continue = true
> and it doesn't return anything, so it doesn't follow the tutorial's model of invoking the plugin,
Refer the section "3. SIP-METHOD PROCEDURE".
A method named "procXXX" doesn't return anything.
> I then went to the Configuration/Advanced tab in the BSS control UI, and specified
> dialplan.plugins.matching.pkg = plugin.session
You don't have to put it in the [Advanced] page.
For executing the plugin, use this line in the Deploy Pattern.
$session = plugin.session.test
so the DialPlan rule will look like this.
[Matching patterns]
$request = ^INVITE
[Deploy patterns]
$session = plugin.session.test
$continue = true
> and it doesn't return anything, so it doesn't follow the tutorial's model of invoking the plugin,
Refer the section "3. SIP-METHOD PROCEDURE".
A method named "procXXX" doesn't return anything.