Dialplan plugin executed twice
Moderator: Brekeke Support Team
-
- Posts: 18
- Joined: Wed Jan 31, 2007 1:22 am
Dialplan plugin executed twice
1. Brekeke Product Name and version: 2.0.7
2. Java version:Latest
3. OS type and the version:WIN2K3 R2
4. Your problem:
I know that this problem is discussed in another topic, but it seems to be a dead topic, and no solution has been found
http://www.brekeke-sip.com/bbs/viewtopi ... ight=twice
I have the following dialplan:
Matching:
$request=^INVITE
To=(.+)
$dialplan.findtonumber( To )=(.+)
Deploy:
$session=com.adp.dialplan.plugin.adpfordialplan %1
$target=myTarget
To=sip:45440\#%2@myTarget
As you can see I have a session plugin which handles the billing. In addition to that I have a dialplan plugin which modifies the destination number based on some internal rules of mine.
The problem is that the dialplan plugin
$dialplan.findtonumber( To )=(.+)
is called twice. I'm writing to a file within the plugin code, and from that I can conclude that the plugin is executed twice for each incomming call.
Does anyone know how to avoid this?
Thanks,
Troels
2. Java version:Latest
3. OS type and the version:WIN2K3 R2
4. Your problem:
I know that this problem is discussed in another topic, but it seems to be a dead topic, and no solution has been found
http://www.brekeke-sip.com/bbs/viewtopi ... ight=twice
I have the following dialplan:
Matching:
$request=^INVITE
To=(.+)
$dialplan.findtonumber( To )=(.+)
Deploy:
$session=com.adp.dialplan.plugin.adpfordialplan %1
$target=myTarget
To=sip:45440\#%2@myTarget
As you can see I have a session plugin which handles the billing. In addition to that I have a dialplan plugin which modifies the destination number based on some internal rules of mine.
The problem is that the dialplan plugin
$dialplan.findtonumber( To )=(.+)
is called twice. I'm writing to a file within the plugin code, and from that I can conclude that the plugin is executed twice for each incomming call.
Does anyone know how to avoid this?
Thanks,
Troels
-
- Posts: 18
- Joined: Wed Jan 31, 2007 1:22 am
-
- Posts: 18
- Joined: Wed Jan 31, 2007 1:22 am
-
- Posts: 18
- Joined: Wed Jan 31, 2007 1:22 am
Yes, here is the code in dialplan.findtonumber
In the output in the textfile I can see that there has been written twice for each call.
Thanks.
Code: Select all
static public String findtonumber(String[] arg, com.brekeke.net.sip.SIPpacket sippacket, Properties pr) throws Exception
{
String strSIPto = stripCalleeURL(sippacket.getValue("To"));
int iCallPatternID = Integer.parseInt(sippacket.getValue("X-callpatternid"));
//Adding leading 0 to all Italian landline numbers
if (iCallPatternID == 14848)
strSIPto = ItalyLandline(strSIPto);
try
{
FileWriter fil = new FileWriter("c:/ondo/test/" + evstat.callid + "-findtonumber.txt", true);
PrintWriter ud = new PrintWriter(fil);
ud.println(strSIPto);
ud.close();
}
catch (Exception e2)
{
}
return strSIPto;
}
Thanks.