Re: Help on simple example

233 views
Skip to first unread message

Charles_Doc_Team

unread,
Jan 24, 2013, 3:45:38 PM1/24/13
to mobicent...@googlegroups.com
Hello Jason,

What do you mean by "I have been successful in getting my servlet to intercept the calls"? Were you able to build the servlet and see the logger.info() message in the Tomcat server console?

Why you trying to perform a maven install from Eclipse when you got the error output?


Regards


Charles
TeleStax_Doc_Team



On Thursday, January 24, 2013 1:42:05 PM UTC-6, jason wrote:
I am sure most have following this tutorial.

http://ben-touron.blogspot.com/2009/11/developping-simple-sip-application-with.html

I followed and I have not been successful in getting my servlet to intercept the calls with the breakpoints I have placed for the system out messages in Eclipse Indigo.

After scrutinizing the logs, I think my culprit is the following line:

---
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:SimpleServlet' did not find a matching property.
---

I have the "SimpletServlet" in my "mobicents-dar.properties" for an INVITE defined as follows:

---
INVITE:("SimpleServlet", "DAR:From", "TERMINATING", "", "NO_ROUTE", "0")
----

I have my servlet.xml with the following in the host section:

---
      <Context docBase="SimpleServlet" path="/SimpleServlet" reloadable="true" source="org.eclipse.jst.j2ee.server:SimpleServlet"/></Host>
---

There is no "hostConfigClass" for attributes in my host section which most have deduce is the problem.

I am using "mss-2.0.0.FINAL-apache-tomcat-7.0.29-1210011535".  I am getting really frustrated.  Can anybody help?

George Vagenas

unread,
Jan 25, 2013, 4:36:08 AM1/25/13
to mobicent...@googlegroups.com
Jason,

This example was provided for an version of SipServlets, i think you should better check some of the recent example that come with the container. For example check the Click2CallAsync example http://code.google.com/p/sipservlets/wiki/Click2CallAsync that is already deployed at the mss-2.0.0. 


George


On Fri, Jan 25, 2013 at 12:40 AM, jason <ivory...@gmail.com> wrote:
Also, how long does it take for posts to get approved?  Feels like I have been waiting quite a while on my reply to my topic.

--
 
 



--
George Vagenas

jason

unread,
Jan 25, 2013, 10:46:59 AM1/25/13
to mobicent...@googlegroups.com
Already did that last week.  I could not get Click2CallAsync to work.  I worked with it for a day.  It was VERY frustrating.  When I went to Click2CallAsync and had the 2 LinPhones working (which was a pain in the butt to get 2 instances), the phones talked just fine and communicated.  I could see from the DOS window of tomcat that they were communicating.  I brought up Click2CallAsync and there were NO phones listed.  I had no idea why the program was not working.  So I gave up.  I could not even get the tomcat to work right in Eclipse with Click2CallAsync.  The whole demo I was looking at had to run as standalone.

I feel like I have to explain where I have started and why I went to where I am.

In short, the example I mention at the top of this thread is the closest example that was promising in working.  All the other examples have been failures for me.

Why am I not able to get this simple example to work?  Is there a flawless tutorial somewhere or better yet a virtual image of a working demo on Ubuntu?

Ivelin Ivanov

unread,
Jan 25, 2013, 11:05:40 AM1/25/13
to mobicent...@googlegroups.com
Hi Jason,

Thank you for sharing your difficulties running basic SIP Servlets examples.

Can I ask that we step back for a moment and look at your end goals. 
- Are you building a Java app that requires SIP Servlets, or
- Are you trying to build an app and you are looking for the tools that can help you. In this case, which is your preferred programming language?
- Have you considered Restcomm as an alternative higher-level development environment?

Ivelin


--
 
 

jason

unread,
Jan 25, 2013, 11:29:23 AM1/25/13
to mobicent...@googlegroups.com
Where I work, we are a Java shop.  So, Java is ideal for implementing a Communication Platform for "educational purposes" at work.  We currently use Avaya, but wanted something that was more "open source" to understand the general functionality.

The main objective is to setup the platform, perform a DTMF PIN entry into the system for it to acknowledge.  If I make it this far then, I have finished my first goal.

After looking at all the examples out there (which are very out of date), I decided to use the link that was on this post because it was suppose to be simple and straightforward.  It provided Tomcat with mobicents and Eclipse with plugins in a Java-based environment.

So, yes.

- I would like to get the SIP Servlet to work.
- I am not building a "real app" -- yet, but may in the future.  Java is preferred for language.
- I have not looked at RestComm, but from what I am seeing so far it might be a quick out of the box turnkey that I probably can look at.  I will check it out.

Meanwhile, if any assistance can be given to what I have done so far, I would appreciate it.

thanks

jason

unread,
Jan 25, 2013, 12:20:02 PM1/25/13
to mobicent...@googlegroups.com
The RestComm might take more effort to get working.  The User Guide is Unix-based and we use Windows for our desktop development.  I don't have a dedicated Unix box to follow the user guide.

Not sure what I will do next.

Charles_Doc_Team

unread,
Jan 25, 2013, 12:26:12 PM1/25/13
to mobicent...@googlegroups.com

Hi Jason,

I tried these examples this week and I was able to display the messages.

Linphone: The issue with starting two instances of linphone requires that you start the first instance with the current user profile by typing 'linphone" and the second instance using "sudo linphone"


I am running

mss-1.8.0-SNAPSHOT-apache-tomcat-7.0.27

In the bin directory I started tomcat

sudo ./catalina.sh run

In the browser I went to

http://127.0.0.1:8080/Click2CallAsync/

Later I started   an instance of linephone and it registered correctly after I refreshed the http://127.0.0.1:8080/Click2CallAsync/ web page


By the way, did you check the mss-1.8.0-SNAPSHOT-apache-tomcat-7.0.27/webapps directoy to make sure it has the Click2CallAsync.war file ?


Sorry if you've gone through these steps but I just need to make sure we are on the same page.


Regards


Charles
Telestax_Doc_Team

 




On Friday, January 25, 2013 10:29:23 AM UTC-6, jason wrote:

jason

unread,
Jan 25, 2013, 12:36:22 PM1/25/13
to mobicent...@googlegroups.com
Your instructions are not readily available on Windows.

I do not have a Unix box available to perform the actions you have indicated below.

The Click2CallAsync is there, but I only get empty information.  I do not get the 2 phones that are "suppose" to show up.  So, the app "appears" to be working, but I do not see any phones.

That demo I followed is nice for "proof of concept" (if I ever get it to work), but I probably will want to get the example on "http://ben-touron.blogspot.com/2009/11/developping-simple-sip-application-with.html" working more than that one.  The main reason is because I will be able to code straight from Eclipse and deploy my modified SipServlet to the Tomcat  Mobicents platform.

jason

unread,
Jan 25, 2013, 12:38:46 PM1/25/13
to mobicent...@googlegroups.com
As fyi I tried following the steps using cygwin to execute the "curl" command (since we develop in Windows where I am) and I got the following:

$ curl --data "PhoneNumber=1234&VoiceUrl=http://127.0.0.1:8080/restcomm/demo/hello-world.xml&VoiceMethod=POST" http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f842...@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers.json
<html><head><title>Apache Tomcat/6.0.35 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.35</h3></body></html>

Not sure why it happened.


On Friday, January 25, 2013 10:29:23 AM UTC-6, jason wrote:

Ivelin Ivanov

unread,
Jan 25, 2013, 1:54:03 PM1/25/13
to mobicent...@googlegroups.com

jason

unread,
Jan 25, 2013, 2:00:11 PM1/25/13
to mobicent...@googlegroups.com
I made some progress on the example from "http://ben-touron.blogspot.com".  I found that the "init" IS being called.  The problems lies in the fact that the "doInvite" is not being called for some reason.  I attribute this to the "mobicents-dar.properties", I think.  I tried the following variations:

I kicked around the can some more and I GOT it working.  Yeah!

I had to do this:

INVITE: ("org.example.servlet.sip.SimpleServlet", "DAR\:From", "TERMINATING", "", "NO_ROUTE", "0")

I could not just use "SimpleServlet" for the first parameter.  I had to completely qualify the class object.  Any ideas why?

jason

unread,
Jan 25, 2013, 2:02:41 PM1/25/13
to mobicent...@googlegroups.com
That is the one I followed.  Very Unix-centric.  Thing completely failed on me for Windows -- even with cygwin installed.  I built the entire restcomm and put it in the webapps directory.  The curl command did not work.   I think there is another command that needed to be documented to authenticate me for executing the curl command, but that was not provided in the guide.

Very discouraging how all the examples out there are missing important details on getting any of this to work.


On Friday, January 25, 2013 12:54:03 PM UTC-6, ivelin wrote:
Have you had a chance to review the User Guide:
On Fri, Jan 25, 2013 at 11:38 AM, jason <ivory...@gmail.com> wrote:
As fyi I tried following the steps using cygwin to execute the "curl" command (since we develop in Windows where I am) and I got the following:

jason

unread,
Jan 25, 2013, 2:28:39 PM1/25/13
to mobicent...@googlegroups.com
After some more fiddling with what I have, I found that Tomcat 6 is the only way this demo is working for me.  Tomcat 7 is just giving me issues.  I am not sure if it is because of the way the mobicents configuration are set for restcomm with Tomcat 6 packaging or it is Tomcat 7 itself in the mobicent Tomcat 7 packaging.

At least I can move forward for now.

If there are any ideas on how to make the mobicents Tomcat 7 package to work, let me know.  For now I will use restcomm Tomcat 6 package with my Eclipse for development.


jason

unread,
Jan 25, 2013, 3:55:42 PM1/25/13
to mobicent...@googlegroups.com
I noticed that I used the default restcomm and I went to build the git version they described.  After building, I tried to deploy the app and I keep getting this:

Jan 25, 2013 2:54:37 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable
java.lang.RuntimeException: java.lang.RuntimeException: Failed to find a local port 2727 to bound stack at org.mobicents.servlet.sip.restcomm.callmanager.mgcp.MgcpServer.start(MgcpServer.java:131)

Not sure how to resolve this since I have nothing on port 2727 on my box when I used netstat.


On Friday, January 25, 2013 11:38:46 AM UTC-6, jason wrote:
As fyi I tried following the steps using cygwin to execute the "curl" command (since we develop in Windows where I am) and I got the following:

$ curl --data "PhoneNumber=1234&VoiceUrl=http://127.0.0.1:8080/restcomm/demo/hello-world.xml&VoiceMethod=POST" http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b03524916...@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers.json

Ivelin Ivanov

unread,
Jan 25, 2013, 4:02:40 PM1/25/13
to mobicent...@googlegroups.com
Did you run the media server on your box? That should be in the deployment instructions. If not, please open an issue here:

Ivelin

Ivelin Ivanov

unread,
Jan 25, 2013, 4:11:58 PM1/25/13
to mobicent...@googlegroups.com, Charles Roufay
Please open a request to add instructions for Windows to the docs so we can get to it as soon as possible. Please mark the feature request with Component-Docs.

Better yet, if you feel like you want to give back to the open source community, feel free to add Windows instructions to the docs. This is the docs source files root directory:



--
 
 

Ivelin Ivanov

unread,
Jan 25, 2013, 4:17:12 PM1/25/13
to mobicent...@googlegroups.com
Looks like your are figuring out your way around the SIP Servlets standard. Here is some discussion on the application routing configuration, which is required before you can use a SIP Servlet.




--
 
 

jason

unread,
Jan 28, 2013, 11:11:27 AM1/28/13
to mobicent...@googlegroups.com
I am looking, but for some reason, my app stopped working on the routing.  There is something missing that I don't understand.

I did use "file:///" and absolutely qualified the location of the properties to a local location.  I tried both of the following formats:

file:///c:/export/home/mobicents/conf/dars/mobicents-dar.properties
file:///export/home/mobicents/conf/dars/mobicents-dar.properties

Still looking to figure out why this is broken all of a sudden.

Charles Roufay

unread,
Jan 28, 2013, 11:32:29 AM1/28/13
to mobicent...@googlegroups.com
Hi Jason,

I'm working on a more intuitive tutorial that should be easier to follow. For your info, I discovered that there was an issue with linphone not often sending invites. This of course will prevent the sample tutorial from sending a response. I tried another sip phone, ekiga, that did help but it had other issues.


Regards

Charles
Telestax_Doc_Team

--
You received this message because you are subscribed to the Google Groups "mobicents-public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-publ...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jason

unread,
Jan 28, 2013, 11:36:04 AM1/28/13
to mobicent...@googlegroups.com
This error is driving me crazy.  Everything is correct as far as I am concerned.  I don't know why I get this.


WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:SimpleServlet' did not find a matching property.

What does this error mean?  The definition is in the mobicents-dar.properties as follows:


INVITE: ("org.example.servlet.sip.SimpleServlet", "DAR:From", "TERMINATING", "", "NO_ROUTE", "0")

And the server.xml has this:


<Context docBase="SimpleServlet" path="/SimpleServlet" reloadable="true" source="org.eclipse.jst.j2ee.server:SimpleServlet"/>

To say it did not find a matching property in the host context does not make sense.

What does the error REALLY mean?

jason

unread,
Jan 28, 2013, 11:37:31 AM1/28/13
to mobicent...@googlegroups.com
I would use X-Lite.  That seemed successful for me.  I personally used and old version with I found at an old version site (specifically version 3.0).

jason

unread,
Jan 28, 2013, 12:07:56 PM1/28/13
to mobicent...@googlegroups.com
I have deduced that Eclipse is giving the problem.

I was able to export the project into a war and put it in the "webapps" and then start it with the "start.bat" and had no problems.  Either my computer is seriously messed up with old and new Eclipse versions I have tried, or Tomcat has a serious issue with Tomcat version of Mobicents.  I rather not use JBoss or another server.  Really would like to know why Eclipse and Tomcat are not being cooperative on deployment.

Charles Roufay

unread,
Jan 28, 2013, 12:23:52 PM1/28/13
to mobicent...@googlegroups.com
Hi Jason,

A lot of people have experienced problems with the setup using eclipse and Tomcat or Jboss. Often, the problem is having incompatible plugins or jar files during installation and integration of eclipse with Tomcat or Jboss. At times, doing a test outside of eclipse will often help identify the source of the problem. I'm glad you've made further progress with your test.

With regards to the fully qualified path, the new sip samples all use full path as can be seen in the dar file here. https://code.google.com/p/sipservlets/source/browse/sip-servlets-examples/click-to-call/click2call-dar.properties

It is important to use the latest samples in order to avoid further issues in the future. The most recent ones have often been tested against new iterations of the containers.

By the way, would you be interested in contributing a little how-to-tutorial  about your process for windows users?


Regards


Charles
Telestax_Doc_Team
--
You received this message because you are subscribed to the Google Groups "mobicents-public" group.
To unsubscribe from this group, send email to mobicents-publ...@googlegroups.com.

jason

unread,
Jan 28, 2013, 12:38:15 PM1/28/13
to mobicent...@googlegroups.com
I can contribute, but contingent on getting the platform integration with one of the servers working with Eclipse.  Until this happens, I am not well with telecom platform will work for my client's needs.  IDE and Server integration is needed.  Having both segregated through the development process will impede productive development.  When I have this integration resolved, then writing a document will be meaningful for Windows developer.  I do not think my employer will have a problem providing a guide for the general public.

Charles Roufay

unread,
Jan 28, 2013, 12:59:01 PM1/28/13
to mobicent...@googlegroups.com
Jason,

That makes sense. I will update you about the tutorial that will also provide the eclipe IDE integration.

Regards


Charles
Telestax_Doc_Team

jason

unread,
Jan 28, 2013, 2:09:31 PM1/28/13
to mobicent...@googlegroups.com
I did get mine working again.  I noticed exactly what was going on.  It was mainly my fault -- I guess.

The tutorial does indicate to remove the auto-generated "context" in the server.xml.  For eclipse, it is natural for the context to be added when adding a web module.  I did remove it initially, but then I shuffled things around and Eclipse "auto added" it back in.

So in understanding what is going on, would I be correct in assuming that the context definition is too primitive for what the dar properties needs to perform for routing?  In other words, mobicents framework uses the dar properties file to resolve more specific context lookup (ie routing)?

I guess the real question now is whether there is a way in Eclipse to prevent context definitions to be added for Sip Servlets in a mobicents project.

I would venture that there needs to be another "plugin" for Eclipse to correctly manage this.  I will be going in and out of the server.xml to make sure context definitions are always removed when adding new servlets.

How annoying.

jason

unread,
Jan 28, 2013, 3:00:20 PM1/28/13
to mobicent...@googlegroups.com
Ok.  I got the JSR309 working too.  I had to modify the server.xml context path to "/media-jsr309-servlet" from "/media-jsr-servlet".  Someone did you update the project correctly before checking it in.

Now, I just need to look at a DTMF PIN example to do my "ad-hoc" example.

I think I am getting the idea of what is going on.

To be honest, on the "Simple Servlet" example, deleting the context was not necessary. The key thing was to not conflict the currect path to the project which the Mobicents framework "connects" to (pardon my explanation since I don't know the framework that well).  So, what I had to "really" do was just rename the path in the host/context of the "server.xml" to something different that "/SimpleServlet".  I renamed it to "/simple-servlet" and the application functioned with no problems.  The key (I think) is that the context to the project has to not be referenced to the servlet context.  The Mobicents frameworks uses that to "connect" to the dar properties and resolve the routing?  I think?

Help me out here.  I think I understand, but I need someone to "clean up" my thought process.

Ivelin Ivanov

unread,
Jan 29, 2013, 12:58:17 AM1/29/13
to mobicent...@googlegroups.com
You are doing a good job guessing your way through SIP Servlets. It may be a good use of time to skim through the SIP Servlets 1.1 spec. Its not a very big document.

jason

unread,
Jan 29, 2013, 12:58:44 PM1/29/13
to mobicent...@googlegroups.com
Lengthy document.  Seems to address almost all of my questions.  I am still reading it.

I decide to take a break and skim to the question I posed in this thread and I found the document does not really address the scenario I mentioned below.

Maybe I should rephrase my question since I have more insight in my head.

  • Why is the host context not required in the server.xml when coding a SIP Servlet?
  • Does the server.xml of Tomcat override the sip.xml?  Is this the reason why the context is left out of the server.xml for Tomcat?  If so, does this logic apply to JBoss and other servers using Mobicents?

Let me know.

Jean Deruelle

unread,
Feb 7, 2013, 8:14:05 AM2/7/13
to mobicents-public
Hi Jason,

Sorry for being late to the party here but the context path has nothing to do with routing. What the DAR file uses is the application name from the sip.xml.
What you're experiencing might be an issue due to the fact that this eclipse plugin was not updated in a long time and meant for Tomcat 6 and now Mobicents has moved to Tomcat 7. 
I created http://code.google.com/p/sipservlets/issues/detail?id=193 to track this down and get it resolved.

Jean

Jean Deruelle

unread,
Feb 7, 2013, 8:27:26 AM2/7/13
to mobicents-public
I need to recheck the plugin but  see my reply inline

Jean


On Tue, Jan 29, 2013 at 6:58 PM, jason <ivory...@gmail.com> wrote:
Lengthy document.  Seems to address almost all of my questions.  I am still reading it.

I decide to take a break and skim to the question I posed in this thread and I found the document does not really address the scenario I mentioned below.

Maybe I should rephrase my question since I have more insight in my head.

  • Why is the host context not required in the server.xml when coding a SIP Servlet?
The Host tag is something that is needed to deploy web and sip applications. The Context can be kept but I think the plugin is missing the addition of key attributes in the Context that is being added for the application to be able to be scanned and deployed as a SIP Application and not a Web Application, see my comment on the article http://ben-touron.blogspot.fr/2009/11/developping-simple-sip-application-with.html?showComment=1259313801192#c5446589215074009499.
  • Does the server.xml of Tomcat override the sip.xml? 
No 
  • Is this the reason why the context is left out of the server.xml for Tomcat? 
No,  If the context is left out the container will look in a specific folder appBase attribute of the Host tag http://tomcat.apache.org/tomcat-7.0-doc/config/host.html so eclipse might deploy the application in that directory and it gets picked up automagically without the need to add the context. This is what typically happens when you deploy your app in a standalone Tomcat under the webapps directory.
  • If so, does this logic apply to JBoss and other servers using Mobicents?
JBoss uses JBoss Web which is based on Tomcat as well so there might be similar behavior happening. We don't currently support any other container than Tomcat and JBoss 

To unsubscribe from this group and stop receiving emails from it, send an email to mobicents-publ...@googlegroups.com.

jason

unread,
Feb 8, 2013, 11:39:02 AM2/8/13
to mobicent...@googlegroups.com
Nope.

I am using Tomcat 6 with JDK 6 and got this problem.

If there truly is a difference in how the server.xml is update for Tomcat 6 versus 7, the update to the plugin will have to know what Tomcat version is being used in order to generate the correct Context.
Reply all
Reply to author
Forward
0 new messages