RestComm and SIP Endpoints

780 views
Skip to first unread message

Lyle Pratt

unread,
Nov 27, 2012, 12:31:45 PM11/27/12
to mobicent...@googlegroups.com
I'm wondering if its possible to use RestComm to create SIP endpoints that desk IP phones could use. Plivo lets you create endpoints that these SIP devices can connect to....its a big reason to use Plivo over Twilio. Unfortunately, I don't see any way to do something like that with RestComm. Am I just missing it?

Thanks,
Lyle

Thomas Quintana

unread,
Nov 27, 2012, 12:35:04 PM11/27/12
to mobicent...@googlegroups.com
Hi Lyle,

If you are asking if RestComm and be used to register SIP phones the answer is yes. You can use RestComm to build your own PBX from scratch it's all up to you we try to not get in the way. It's not obvious but the instructions are in the user guide if you get lost just feel free to ask.

Cheers,
Thomas Quintana

Thomas Quintana

unread,
Nov 27, 2012, 12:37:00 PM11/27/12
to mobicent...@googlegroups.com
I have multiple user agents including my Bria Android edition registered to my test instance.

Lyle Pratt

unread,
Nov 27, 2012, 12:40:40 PM11/27/12
to mobicent...@googlegroups.com
Great news! I just don't see how I programmatically create SIP endpoints that I can register SIP devices with. I see how I can make outgoing SIP calls using the Rest API and the Dial verb, but not how to configure SIP endpoints that devices can connect to.

-Lyle

Lyle Pratt

unread,
Nov 27, 2012, 12:47:22 PM11/27/12
to mobicent...@googlegroups.com
I guess I'm just misunderstanding, or maybe not explaining myself clearly.

Say I have 20 Polycom phones I need to enable. Each of those phones needs to have its own extension, SIP endpoint, and username and password. How would I configure any of those things with RestComm?

-lyle

Thomas Quintana

unread,
Nov 27, 2012, 12:50:36 PM11/27/12
to mobicent...@googlegroups.com
Hi Lyle,

I apologize that is not in the user guide. You have to create a Client using the rest API. Below is an example

curl --data "Login=lyle&Password=1234&VoiceUrl=http://ip-address:8080/restcomm/demo/hello-world.xml&VoiceMethod=POST" http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f8423e5c38b035249166@ip-address:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Clients.json

This will create a client with username lyle and password 1234. Everytime an outbound call is made from the user agent the script located @ http://ip-address:8080/restcomm/demo/hello-world.xml will be executed. So you have control of how the call is handled. You can bridge the call to their desired destination (we pass that info to your script) using the <Dial> verb or you can take some completely different action.

You would create a Client for each phone and they can all execute the same script or different ones. It's up to you.

Best Regards,
Thomas Quintana

Lyle Pratt

unread,
Nov 27, 2012, 12:58:45 PM11/27/12
to mobicent...@googlegroups.com
Ok. Thats what I was looking for. I'll try to give that a go after I can get a basic inbound call working.

Thanks!
-Lyle

Thomas Quintana

unread,
Nov 27, 2012, 1:14:45 PM11/27/12
to mobicent...@googlegroups.com
Keep in mind that the Twilio Java Wrapper is being extended to support all the extra functionality provided by RestComm. Once the Java Wrapper is caught up I will direct my attention to the Python wrapper and that should be fairly soon. Maybe that will also help build applications with RestComm.

Lyle Pratt

unread,
Nov 27, 2012, 1:31:52 PM11/27/12
to mobicent...@googlegroups.com
Cool. If I can get this other stuff working and it seems like RestComm will be a viable option for us, I can probably help contribute to the Python wrapper.

Thomas Quintana

unread,
Nov 27, 2012, 1:36:46 PM11/27/12
to mobicent...@googlegroups.com
Sweet! Excited to have join our community and please feel free to continue asking questions until you are up and running.

Cheers!
Thomas Quintana

Lyle Pratt

unread,
Nov 28, 2012, 10:38:15 PM11/28/12
to mobicent...@googlegroups.com
Just successfully made a call from a SIP phone app on my iPhone through a RestComm client endpoint. Worked great! 

I'm going to spend some time testing this with some Polycom phones tomorrow. Need to make sure basic phone functions work: Normal Transfers, Blind Transfers, Conferencing, etc.

Writing that made me think of this question:
Do you know if you guys support the Polycom paging feature?

-Lyle

Thomas Quintana

unread,
Nov 28, 2012, 10:47:22 PM11/28/12
to mobicent...@googlegroups.com
So here is the situation with handset function keys. Currently, not all handsets implement function keys in the same way and since we have been working to make RestComm as complete as possible (in regards to Twilio) we haven't had a chance to think about these keys. We do need to provide an example of how to implement these keys for handset vendors to follow so I would be happy to start with the devices you need support for since you are helping so much by using RestComm and providing feedback. I hope this works for you.

Best Regards,
Thomas

Lyle Pratt

unread,
Nov 28, 2012, 10:55:40 PM11/28/12
to mobicent...@googlegroups.com
Yeah...I totally understand the issue around handset functions. Fortunately, from what I understand, Polycom has historically been one of the closer followers of standards and is one of the easiest handset providers to support. Hopefully it won't be too bad. No way to improve if we don't ever find the issues!

-Lyle

Thomas Quintana

unread,
Nov 28, 2012, 11:15:13 PM11/28/12
to mobicent...@googlegroups.com
I agree :)

Okay, have to get some shuteye been burning brain grease for quite a few hours. I will continue in the morning. Oh yeah for each function key open an issue and provide logs + tcpdump this way it's easy to reverse what the phone is doing and implement the appropriate functionality.

Best Regards,
Thomas

Lyle Pratt

unread,
Nov 28, 2012, 11:29:37 PM11/28/12
to mobicent...@googlegroups.com
Will definitely include logs for each function. I'm going to hit the hay myself.

Thanks again,
Lyle

Thomas Quintana

unread,
Nov 29, 2012, 1:08:12 PM11/29/12
to mobicent...@googlegroups.com
Lyle,

Today we will start using the latest stable MMS with our nightly builds. As soon as it is configured you can just download build copy your configuration over (not the files because there are configuration file changes that will break if removed) to the new build and re-deploy. I will update this thread when the task is completed and the first build is available. This new build will bring the missing property we spoke about yesterday to help improve DTMF detection.

Best Regards,
Thomas

Thomas Quintana

unread,
Nov 29, 2012, 4:23:48 PM11/29/12
to mobicent...@googlegroups.com
HI Lyle,

The move to the latest Mobicents Media Server is done. Now the default is to always use the latest stable version for our nightly builds. You can download a snapshot with all the fixes from yesterday here https://mobicents.ci.cloudbees.com/job/RestComm/lastSuccessfulBuild/artifact/ also, when I'm done pushing the remaining fixes tonight I will start another build which you can get from the same address. This will help the RestComm team get working software with fixes in the community's hands with the least amount of effort. Moving on, I will continue to update the tickets as I close them I very close to closing 134 and 136.

Best Regards,
Thomas

Thomas Quintana

unread,
Nov 30, 2012, 2:33:51 PM11/30/12
to mobicent...@googlegroups.com
Hi Lyle,

Quite a few of your issues have been resolved (All the major ones). Please use the latest build from the link I previously provided to test that everything is working fine for you. I will spend the next few days working on the RestAPI and sometime next week I will move on to the Polycom phones.

So you are on the same page and can provide useful feedback what I am planning on doing is as follows. When RestComm sees a function key press from the handset it will put together a request with the usual information you expect to receive from RestComm + other useful information like the user agent, the desired function, etc. This way all the function keys on your handsets will be programmable by you and allows the most flexibility to your application for handling user events. Let me know if this sounds like something that will work for you.

Best Regards,
Thomas

Lyle Pratt

unread,
Nov 30, 2012, 5:40:03 PM11/30/12
to mobicent...@googlegroups.com
Ahh. Thats an interesting approach. Definitely different than how others I've seem are approaching it, but seems more flexible and much easier to add support for other devices. Look forward to trying it out.

Thanks so much for closing all those issues. I'm going to download the latest builds tomorrow and retest everything!

-Lyle

Thomas Quintana

unread,
Nov 30, 2012, 5:53:40 PM11/30/12
to mobicent...@googlegroups.com
I'm glad you like the idea. I figured it doesn't make sense to just have user agents going nuts on your network and since RestComm is a platform to build communication software that it should extend to the user agent. Also, we like restful APIs and Twilio's overall approach so I think this will satisfy all of the above. Finally, you're very welcome and on the same token I would like to thank you for your time in helping us make RestComm a great solution.

Best Regards,
Thomas

Ivelin Ivanov

unread,
Nov 30, 2012, 6:06:17 PM11/30/12
to mobicent...@googlegroups.com
Thomas,

Can you show an example request dump when a Polycom transfer key is pressed as in Lyle's use case?
I am curious how his app would distinguish between regular DTMF keys and the various non-standard function keys.

Ivelin

Thomas Quintana

unread,
Nov 30, 2012, 6:15:56 PM11/30/12
to mobicent...@googlegroups.com
Hi Ivelin,

He posted a capture in the ticket he opened for this issue http://code.google.com/p/restcomm/issues/detail?id=137. The way it works (in this case) is with predefined call flows. Please see the following link http://tools.ietf.org/html/rfc5359. We can use the built in state machine to successfully identify these call flows and generate HTTP callbacks with all the appropriate information for the user application to do something with the request. This can lead to really cool applications and fined grained control of your applications all the way down to the registered user agents.

Best Regards,
Thomas 

Lyle Pratt

unread,
Nov 30, 2012, 6:38:15 PM11/30/12
to mobicent...@googlegroups.com
Interesting!

So one thing I've always wanted with Twilio is the ability to optionally receive DTMF callbacks during a live call (outside of a Gather). Since these feature buttons would basically be doing the same thing, would this be possible?

-Lyle

Sent from my mobile.

Ivelin Ivanov

unread,
Nov 30, 2012, 7:28:46 PM11/30/12
to mobicent...@googlegroups.com
Interesting complications. Several related comments:

1. Polycom actually does not use DTMF codes at all for Transfer. Instead it acts an intelligent, stateful UA and uses a SIP call flow sequence to implement the function: http://tools.ietf.org/html/rfc5359#section-2.4

Is that a correct statement?

2. In order for the app to properly implement transfer it needs to implement state machine for transition from ongoing call to hold and redirect. It also has to be able to understand the appropriate SIP sequence and SIP responses. Almost sounds like a complexity that defeats the purpose of Restcomm. An app that has such level of sophistication might be better implemented as a SIP Servlet. 

We can imagine a situation where the UA is too smart (or malicious) and tries to engage in prolonged SIP dialogues with Restcomm that don't fit any standard call flow for UAs. In that case Restcomm and the app may end up in a nondeterministic mess.

Maybe we can look at identifying a way to describe standard or at least safe call flows that extend the Restcomm call flow state machine without putting it in a nondeterministic state. From the SIP messages in RFC 5359, I don't see a quick way to mark a SIP message as the beginning of a standard call flow. Are there any markers we could use to quickly identify an acceptable call flow or flag a SIP request as illegal? Start/end call flow markers will be useful for the app. The app would not get involved with the SIP dialog details, but it would stay informed about important state changes.

Ivelin

Lyle Pratt

unread,
Nov 30, 2012, 8:16:23 PM11/30/12
to mobicent...@googlegroups.com
You're correct that Polycom doesn't use DTMF tones for feature buttons. I was just ALSO suggesting that it would be nice to receive tones at any time during a call. For example: to allow a caller to begin recording the call at any point (similar to Google Voice).

I agree that it definitely introduces a whole additional level of complexity to the call handling process. It would be nice to have the best of both world: a default behavior "template" with an opportunity to override. Maybe this behavior template could be XML based and could be easily contributed by others.

-Lyle

Lyle Pratt

unread,
Nov 30, 2012, 11:16:34 PM11/30/12
to mobicent...@googlegroups.com
My apologies if the suggestion about capturing DTMF tones at any point during a call was unrelated. I was just thinking that if RestComm was sending callbacks when someone pressed a feature button, it could also send them when someone pressed a digit (without explicitly being inside a Gather verb).

I don't mean to draw the conversation off topic.

Lyle Pratt

unread,
Dec 1, 2012, 10:59:05 AM12/1/12
to mobicent...@googlegroups.com
I'm trying to update RestComm with the latest builds, however I need to move over old data. Where is the data currently being stored (calls, notifications, numbers, etc)?

Thanks!
Lyle

Lyle Pratt

unread,
Dec 1, 2012, 11:23:47 AM12/1/12
to mobicent...@googlegroups.com
Also, it seems that the Tomcat configuration in the latest build is messed up. All of the Restcomm stuff is 404ing and I'm not sure where to edit the Tomcat configuration
to fix it :S. Total tomcat n00b here.

Thomas Quintana

unread,
Dec 1, 2012, 11:24:50 AM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

Sorry I went MIA on you guys last night it was late over here and I headed to world of beer with some buddies to blow some steam :)

Okay, I will answer every email one by one starting with this one. Lyle, RestComm uses an embedded in memory database called HSQL by default. The database files are located @ $TOMCAT_HOME/webapps/restcomm/WEB-INF/data/hsql

Note: We also support other RDBMS engines and MongoDB if you would like to move your database records outside of HSQL.

Then you have to back up the files in the following directories.

$TOMCAT_HOME/webapps/restcomm/recordings (This is if you have files to back created with the <Record> verb)
$TOMCAT_HOME/webapps/restcomm/cache/acapela (This is if you want to backup the phrases cached by the TTS engine we do this for performance and to save our users $$$ in production)

Best Regards,
Thomas

Thomas Quintana

unread,
Dec 1, 2012, 11:29:11 AM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

It's 404ing because the new build doesn't have your DID configured in the IncomingPhoneNumbers resource. You have to replace the database files with the ones you backed up or just use curl to re-create the entry. To help speed things up you can use

$] history | grep curl

Best Regards,
Thomas

Lyle Pratt

unread,
Dec 1, 2012, 11:31:21 AM12/1/12
to mobicent...@googlegroups.com
No, i mean everything in the restcomm directory is 404ing. I can't even view /restcomm/demo/hello-world.xml

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 11:37:00 AM12/1/12
to mobicent...@googlegroups.com
Also, this is what I'm using to move over files and configurations after upgrading. Am I leaving anything out?

#!/bin/bash

RESTCOMM=../workspace/restcomm
RESTCOMM_OLD=../workspace/restcomm_old

cp "$RESTCOMM_OLD/mobicents-media-server/deploy/server-beans.xml" "$RESTCOMM/mobicents-media-server/deploy/server-beans.xml"
cp "$RESTCOMM_OLD/conf/server.xml" "$RESTCOMM/conf/server.xml"
cp "$RESTCOMM_OLD/webapps/restcomm/WEB-INF/conf/restcomm.xml" "$RESTCOMM/webapps/restcomm/WEB-INF/conf/restcomm.xml"
cp -a "$RESTCOMM_OLD/webapps/restcomm/WEB-INF/data/hsql" "$RESTCOMM/webapps/restcomm/WEB-INF/data/hsql"
cp -a "$RESTCOMM_OLD/webapps/restcomm/recordings" "$RESTCOMM/webapps/restcomm/recordings"
cp -a "$RESTCOMM_OLD/webapps/restcomm/cache/acapela" "$RESTCOMM/webapps/restcomm/cache/acapela"

 

Thomas Quintana

unread,
Dec 1, 2012, 11:44:33 AM12/1/12
to mobicent...@googlegroups.com
No, that looks correct. If I were you I would verify that everything copied over correctly to the right place and that the values match. This also brings up a very good point. Updating should be easy so users can test new fixes and features. Lyle, can you please open an issue for an update script to RestComm that will update to the latest nightly snapshot. I can have it in the next build so you can just run $TOMCAT_HOME/bin/update.sh. If you have any more issues please let me know so we can figure it out together.

Best Regards,
Thomas

Lyle Pratt

unread,
Dec 1, 2012, 11:45:25 AM12/1/12
to mobicent...@googlegroups.com
Well, I'm still having issues with everything in the restcomm webapp 404ing... 

Thomas Quintana

unread,
Dec 1, 2012, 11:47:28 AM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

Can you provide me the log files and a capture. I should be able to tell you what's going on by looking at them.

Lyle Pratt

unread,
Dec 1, 2012, 11:51:25 AM12/1/12
to mobicent...@googlegroups.com
Theres just has to be something that has changed in the Tomcat configuration in the latest nightly build. Or possibly some permissions? All of the other Tomcat webapps are accessible. Nothing in http://my-ip:8080/restcomm/ is. For example, if I go to http://my-ip:8080/restcomm/demo/hello-world.xml I get a 404. If I go to http://my-ip:8080/, I get the Tomcat welcome page. 

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 12:11:46 PM12/1/12
to mobicent...@googlegroups.com
Actually, please provide the logs. RestComm may have failed to load for some reason.

Thanks

Lyle Pratt

unread,
Dec 1, 2012, 12:17:47 PM12/1/12
to mobicent...@googlegroups.com

Thomas Quintana

unread,
Dec 1, 2012, 12:20:32 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

Just as I suspected :)

Go to the restcomm.xml file and add <response-timeout>500</response-timeout> inside <mgcp-server name="Mobicents Media Server"> and restart. This will solve your problems.

Thomas

Ivelin Ivanov

unread,
Dec 1, 2012, 12:20:48 PM12/1/12
to mobicent...@googlegroups.com
Lyle,

Is there now way currently to implement keypad shurtcut functions with twiml during any point of a call - recording, transfer, join an extra participant, etc.?

Ivelin

Thomas Quintana

unread,
Dec 1, 2012, 12:22:33 PM12/1/12
to mobicent...@googlegroups.com
Ivelin,

How are you. You can't even register devices in to their network so they would have to start there. You can only use the Twilio Clients.

Thomas

Lyle Pratt

unread,
Dec 1, 2012, 12:24:33 PM12/1/12
to mobicent...@googlegroups.com
No, unless you are inside of a Gather verb, there is no way to get input callbacks. Its a huge, HUGE, hole in Twilio.

Lyle Pratt

unread,
Dec 1, 2012, 12:25:04 PM12/1/12
to mobicent...@googlegroups.com
That fixed it Thomas. Thanks!

Ivelin Ivanov

unread,
Dec 1, 2012, 12:27:39 PM12/1/12
to mobicent...@googlegroups.com
I think I did not state the question clearly. My understanding of Lyle's question is that he wants to be able to implement a shortcut (e.g. *6) on the phone keypad that can trigger app logic at any point during a phone call. I am trying to clarify whether or how that is currently done with twiml.

Thomas Quintana

unread,
Dec 1, 2012, 12:28:52 PM12/1/12
to mobicent...@googlegroups.com
No problem, make sure that you test all the issues you opened :)

Also, you probably overwrote the mms config file with the new parameters for DTMF it's no biggie we set safe defaults but next update try to move the config for the media server by hand and from then on the update script will take care of it for you so you don't miss out on anything.

Best Regards,
Thomas

Lyle Pratt

unread,
Dec 1, 2012, 12:29:44 PM12/1/12
to mobicent...@googlegroups.com
Ivelin,

It is not possible with Twilio. There is no way to receive Digit callbacks unless Twilio is executing a Gather verb. Thats why I'm requesting that functionality in RestComm :)

Thomas,

I pulled those configurations out before copying :)

Ivelin Ivanov

unread,
Dec 1, 2012, 12:29:54 PM12/1/12
to mobicent...@googlegroups.com
Interesting. Its a pretty common IVR feature. Do you have a handy link to a discussion on the twilio forums about this hole?

Lyle Pratt

unread,
Dec 1, 2012, 12:32:23 PM12/1/12
to mobicent...@googlegroups.com
There is not much discussion that I know of, but here is a similar feature request for inside Conferences:

Personally, I don't think it should be limited to conferences. You should be able to optionally configure a Digit callback URL for ANY call.

Ivelin Ivanov

unread,
Dec 1, 2012, 12:39:34 PM12/1/12
to mobicent...@googlegroups.com
Wow. Its been hanging for 2 years. About a year ago the thread expanded to a general request for global key callbacks. There are a few design suggestions and some workarounds. What is your take on those:

Lyle Pratt

unread,
Dec 1, 2012, 12:45:00 PM12/1/12
to mobicent...@googlegroups.com
My thoughts are similar to Tim's. You could just receive the callbacks at the existing StatusCallback url. Whether inside a conference or not, the request would just need to contain the CallSid and the Digits pressed. Doesn't seem like it would involve much of a change to RestComm.

I agree that theres no need to be able to return TwiML (that would significantly complicate things). Just manipulate the live call using the RestAPI.

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 12:47:52 PM12/1/12
to mobicent...@googlegroups.com
Thomas,

Since upgrading, RestComm isn't sending me any requests when I call the test number you guys gave me. I've verified that the number is configured correctly.


{
  • sidPN26fdbb3aebaf4426aa9b41eaf48c1917
  • account_sidACae6e420f425248d6a26948c17a9e2acf
  • friendly_name(512) 646-1497
  • phone_number+15126461497
  • voice_urlhttp://dev.example.com/twilio/render-template/
  • voice_methodPOST
  • voice_fallback_methodPOST
  • status_callbackhttp://dev.example.com/twilio/call-status/
  • status_callback_methodPOST
  • voice_caller_id_lookupfalse
  • date_created2012-11-27T00:00:00.000Z
  • date_updated2012-11-27T00:00:00.000Z
  • sms_methodPOST
  • sms_fallback_methodPOST
  • api_version2012-04-24
  • uri/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/IncomingPhoneNumbers/PN26fdbb3aebaf4426aa9b41eaf48c1917.json
}

Thomas Quintana

unread,
Dec 1, 2012, 12:53:38 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

It seems that RestComm can't find the media server. Can you please attach the Media server logs.

Lyle Pratt

unread,
Dec 1, 2012, 12:55:47 PM12/1/12
to mobicent...@googlegroups.com

Thomas Quintana

unread,
Dec 1, 2012, 1:02:28 PM12/1/12
to mobicent...@googlegroups.com
Okay, so I see RestComm sending requests to the media server and never getting a response. In the media server logs I never see the request coming in for processing. I'm guessing replacing the new config file may be causing this issue since the RTP channel manager is not being loaded. Please overwrite your server-beans.xml file with this one http://code.google.com/p/mediaserver/source/browse/bootstrap/src/main/config/server-beans.xml and move your configuration by hand. Then try restarting the media server and making another call.

Thomas

Ivelin Ivanov

unread,
Dec 1, 2012, 1:12:18 PM12/1/12
to mobicent...@googlegroups.com
Building on Tim's suggestion, what if there is a way for the app to register for global keypress events. Maybe the app submits a regex pattern that its interested in receiving call-global callbacks for. The global matching would be suppressed within the Gather tag.

SIP RFC 4730 suggest a lot more generalized mechanism for solving this problem.

If we can figure a way to recognize standard call flows in a safe way, the callback registration could support multiple types: dtmf request, call state change request (for the Polycom intelligent SIP phone case), ... 

Ivelin

Lyle Pratt

unread,
Dec 1, 2012, 1:13:39 PM12/1/12
to mobicent...@googlegroups.com
I'm receiving a request now, but nothing ever gets processed. Just rings forever.
Tomcat:

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 1:32:49 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

I apologize for this but can you restart both servers and retest. This time provide both log files and a capture. Thank you so much for your time and patience I will make sure update script eliminates this pain.

Thanks,
Thomas

Lyle Pratt

unread,
Dec 1, 2012, 1:39:08 PM12/1/12
to mobicent...@googlegroups.com
Restarted them and updated logs. But I restarted both last time. Same behavior this time as well.

Thomas Quintana

unread,
Dec 1, 2012, 1:46:04 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

I think you forgot the capture. The reason for the restart to clean up the logs for MMS.

Lyle Pratt

unread,
Dec 1, 2012, 1:51:54 PM12/1/12
to mobicent...@googlegroups.com
You mean you also want a TCPDump?
http://50.17.213.1:8080/logs/capture.cap

I cleaned the logs for Tomcat and the media server. They are in my previous post.

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 1:57:14 PM12/1/12
to mobicent...@googlegroups.com
Lyle,

Is RestComm reporting any Notifications?

Lyle Pratt

unread,
Dec 1, 2012, 2:14:20 PM12/1/12
to mobicent...@googlegroups.com
Well its very difficult to tell since theres no hour or minute information on Notifications. I'm doing a count on "date_updated2012-12-01T00:00:00.000Z" and see 9 errors with error code 11200.

However, I see RestComm hitting my server, but this is the only request I receive during the call.
======================== NEW REQUEST ===========================
{u'Direction': u'inbound', u'CallSid': u'CA096422cb044f4602aa04627a647e21a3', u'From': u'15128278678', u'CallerName': u'', u'ApiVersion': u'2012-04-24', u'To': u'+15126461497', u'AccountSid': u'ACae6e420f425248d6a26948c17a9e2acf', u'ForwardedFrom': u'', u'CallStatus': u'ringing'}
[01/Dec/2012 13:09:18] "POST /twilio/render-template/ HTTP/1.1" 200 10

I've verified that my server is available from the RestComm instance.

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 2:29:31 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

Can you post one of the 11200 Notifications? I'm trying to track down the problem now.

Thomas Quintana

unread,
Dec 1, 2012, 2:36:44 PM12/1/12
to mobicent...@googlegroups.com
I think I know what is happening. Try to open your statusCallbackUrl it just keeps the socket open and never sends anything. The only reason that RestComm is hanging is because it is trying to notify the statusCallbackUrl that the call just went in to a ringing state. Since there is no error response and the sockets just stays open the thread waits for a response. Can you please verify if the same is happening for you, maybe I'm wrong.

http://dev.lylepratt.com/twilio/call-status/ <--- Not returning a response

Lyle Pratt

unread,
Dec 1, 2012, 2:37:27 PM12/1/12
to mobicent...@googlegroups.com
No, thats just because my ssh tunnel timed out.

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 2:38:05 PM12/1/12
to mobicent...@googlegroups.com
Before testing each time I've verified all URLs are accessible.

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 2:38:56 PM12/1/12
to mobicent...@googlegroups.com
{
  • sidNOdff8d54d3272418ba475423147773de4
  • date_created2012-12-01T00:00:00.000Z
  • date_updated2012-12-01T00:00:00.000Z
  • account_sidACae6e420f425248d6a26948c17a9e2acf
  • call_sidCA22757c919e104232b8e0f3f92894a7cd
  • api_version2012-04-24
  • log0
  • error_code11200
  • more_info/restcomm/errors/11200.html
  • message_text
  • message_date2012-12-01T00:00:00.000Z
  • request_urlhttp://dev.lylepratt.com/twilio/render-template/
  • request_methodPOST
  • request_variables:CallSid=CA22757c919e104232b8e0f3f92894a7cd&AccountSid=ACae6e420f425248d6a26948c17a9e2acf&From=15128278678&To=%2B15126461497&CallStatus=ringing&ApiVersion=2012-04-24&Direction=inbound&ForwardedFrom=&CallerName=
  • response_headersDate=Sat%2C+01+Dec+2012+19%3A05%3A14+GMT&Server=WSGIServer%2F0.1+Python%2F2.7.2%2B&Vary=Cookie%2CAccept-Encoding&Content-Type=text%2Fhtml%3B+charset%3Dutf-8&Via=1.1+dev.lylepratt.com&Keep-Alive=timeout%3D15%2C+max%3D100&Connection=Keep-Alive&Transfer-Encoding=chunked
  • uri/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Notifications/NOdff8d54d3272418ba475423147773de4.json

Thomas Quintana

unread,
Dec 1, 2012, 2:48:24 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

As a quick test can you point the DID to the hello-world.xml file on the local instance and see if that works.

Lyle Pratt

unread,
Dec 1, 2012, 3:08:14 PM12/1/12
to mobicent...@googlegroups.com
That does seem to work. But, I'm also positive theres nothing wrong with what my web server is returning.

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 3:09:10 PM12/1/12
to mobicent...@googlegroups.com
Twilio can access the same template URL perfectly.

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 3:19:08 PM12/1/12
to mobicent...@googlegroups.com
I understand. I don't think there is anything wrong with your webserver either :) I will submit a patch shortly.

Thomas

Thomas Quintana

unread,
Dec 1, 2012, 3:26:40 PM12/1/12
to mobicent...@googlegroups.com
Just so that you are aware of what is going on. HttpClient which is the library we use to request content from the web is not handling chunked data correctly.

Thomas

Lyle Pratt

unread,
Dec 1, 2012, 3:27:29 PM12/1/12
to mobicent...@googlegroups.com
Ahh. That makes sense. I should have noticed that!

Sent from my mobile.

Thomas Quintana

unread,
Dec 1, 2012, 5:12:56 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

I can no longer access http://dev.lylepratt.com/twilio/render-template/ for testing. Is there anyway you can bring it back up for a bit longer.

Best Regards,
Thomas

Lyle Pratt

unread,
Dec 1, 2012, 5:20:09 PM12/1/12
to mobicent...@googlegroups.com
Should be up now.

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 5:34:22 PM12/1/12
to mobicent...@googlegroups.com
Sorry Lyle,

I still can't reach it.

Lyle Pratt

unread,
Dec 1, 2012, 5:41:17 PM12/1/12
to mobicent...@googlegroups.com
Odd. Try now.

Also, the trailing slash on the URL is required.

-Lyle

Lyle Pratt

unread,
Dec 1, 2012, 7:28:45 PM12/1/12
to mobicent...@googlegroups.com
Thats running in a virtual machine on my laptop, and I'm shutting down for now. Its just a django test server though (python simple sever) in case you need to duplicate.

-Lyle

Thomas Quintana

unread,
Dec 1, 2012, 7:58:34 PM12/1/12
to mobicent...@googlegroups.com
Hi Lyle,

Thank you so much for your time and for leaving that up. I have successfully finished resolving the issue. I will push to the Git repository in a little bit after I finished running the test suite.

Best Regards,
Thomas

P.S. Your script should work perfectly fine for the build since there are no configuration file changes.

Thomas Quintana

unread,
Dec 1, 2012, 8:16:13 PM12/1/12
to mobicent...@googlegroups.com

Thomas Quintana

unread,
Dec 2, 2012, 1:10:02 AM12/2/12
to mobicent...@googlegroups.com
Hi Lyle,

I have closed the mis-handling of chunked data and update script tickets. Before, you update be warned that you must move the server-beans.xml file settings by hand one more time as the configuration file had one change made over the weekend. Moving on to run the update script just stop the media server + tomcat and run $TOMCAT_HOME/bin/update.sh

This will replace your current installation with the latest RestComm build, it will move all your audio, configuration, and data files. It will also provide you a backup of your old installation in the archive named restcomm-back.tar.gz located @ $TOMCAT_HOME/


Thomas

Lyle Pratt

unread,
Mar 8, 2013, 1:45:43 PM3/8/13
to mobicent...@googlegroups.com


---------- Forwarded message ----------
From: Lyle Pratt <lyle...@gmail.com>
Date: Fri, Mar 8, 2013 at 12:44 PM
Subject: Re: RestComm and SIP Endpoints
To: Waqas Memon <waqas...@gmail.com>


First register an RCML app that points at a URI endpoint. The app needs to return RCML (very similar to TwiML) that looks something like this:

<Response>
    <!-- To Dial a PSTN Number -->
    <Dial>
        <Number url="answer_response.xml">123-456-7890</Number>
    </Dial>
    <!-- To Dial a SIP URI -->
    <Dial>
        <Uri url="answer_response.xml">sip:ly...@127.0.0.1:5080</Uri>
    </Dial>
</Response>

Notice the "url" attribute on the Number and Uri elements. You'll have another set of XML at that endpoint that will <Say> instructions to the user and <Gather> his/her 4 digit pin.

That RCML will look something like this:

<Response>
    <!-- To Dial a PSTN Number -->
    <Gather action="place_to_send_pin_digits.php">
        <Say>Enter your 4 digit pin to verify your account</Say>
    </Gather>
</Response>


You can find more examples in the RestComm documentation. I would also encourage you to take a look at Twilio's documentation because it has a lot of great examples that are also applicable to RestComm.

RestComm Getting Started Guide:

Regards,
Lyle


On Fri, Mar 8, 2013 at 10:55 AM, Waqas Memon <waqas...@gmail.com> wrote:
I will try to explain a little more. 

I want to write a webservice which somehow connects with SIP servlet and initiates a call to a SIP URI.. The receiver of the Call using Soft phone accepts the call. This call should play an audio file and should be capable of receiving DTMF input from the user. 

i.e. If a user registers with my website, I should be able to call him on a SIP URI for that user, and should play an audio "To Activate you account please enter 4 digit PIN.". User enters 4 digit pin, and i should be able to process that pin and send a response audio. 





On Fri, Mar 8, 2013 at 8:28 PM, Lyle Pratt <lyle...@gmail.com> wrote:
Hi!

I'm a little unclear about what you're trying to do based on your description. If you want to take an inbound call on a number and connect that caller to someone else, you would typically use the <Dial></Dial> element. However, If you want to register a SIP device with RestComm you'll need to use the RestAPI to create a RestComm Client address.

Lastly, before any Outbound functionality will work with RestComm, you have to configure an outbound proxy in the restcomm.xml settings file. 

-Lyle


On Fri, Mar 8, 2013 at 5:31 AM, vixmemon <waqas...@gmail.com> wrote:
Lyle, 

I saw your discussion with Mobicents and RestComm team. I was more or less doing the same thing and I am kind of stuck. 
I have been successful in receiving calls to a registered number in RestComm Accounts and when i receive a call i play back a sound, and receive user input through DTMF. 

Now, i am stuck in being able to make a call from the same registered number (which receives the call). I want to be able to make a call through RestComm to a SIP address (maybe register another user.) and play same audio and receive user input. How can i do it. I am doing it through Java. 



On Tuesday, 27 November 2012 22:31:45 UTC+5, Lyle Pratt wrote:
I'm wondering if its possible to use RestComm to create SIP endpoints that desk IP phones could use. Plivo lets you create endpoints that these SIP devices can connect to....its a big reason to use Plivo over Twilio. Unfortunately, I don't see any way to do something like that with RestComm. Am I just missing it?

Thanks,
Lyle




vixmemon

unread,
Mar 9, 2013, 2:48:01 AM3/9/13
to mobicent...@googlegroups.com
Lyle, 

That i have already done, with this solution, It is possible to achieve following usecase. 

1. A Softphone calls up my RCML app user which i register in accounts through REST API.
2. The RCML app responds with the menu.
3. Or the RCML App dials another sip uri, which also plays a menu. 

What i wanted to do is, 
1. Using java, without using Softphone, call up a SIP URI, and play the menu and receive dtmf input. 
2. The receiver on the other hand uses soft phone to receive the call and listen to the menu and provide dtmf inputs. 

vixmemon

unread,
Mar 9, 2013, 2:51:02 AM3/9/13
to mobicent...@googlegroups.com
One more thing, 

There is no current caller in this usecase. The current caller is My RCML app itself. 
I want to be able to call to a sip URI through my RestComm Java Wrapper... and not a sip phone. 

Lyle Pratt

unread,
Mar 9, 2013, 3:49:53 PM3/9/13
to mobicent...@googlegroups.com
My apologies, but I'm not sure that understand your use case. Are you saying that you want to programmatically interact with an existing IVR that is already built? 

-Lyle


--
You received this message because you are subscribed to a topic in the Google Groups "mobicents-public" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobicents-public/YhJctu6VoKA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to mobicents-publ...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

vixmemon

unread,
Mar 9, 2013, 6:26:31 PM3/9/13
to mobicent...@googlegroups.com
I want to problematically interact with a SIP Phone (12...@127.0.0.1:5080). I want to call that sip uri and play him an audio file. I also want DTMF /input from the receiver of that call. 

Lyle Pratt

unread,
Mar 9, 2013, 9:06:34 PM3/9/13
to mobicent...@googlegroups.com
In my previous description I gave you instructions on how to so that. You'll use the Dial verb with a URL attribute defined on the Number or Uri noun.

vixmemon

unread,
Mar 11, 2013, 11:30:02 AM3/11/13
to mobicent...@googlegroups.com
I want to send this following XML through a servlet /java program to my RCML Application...


<Response>
    <!-- To Dial a PSTN Number -->
    <Dial>
        <Number url="answer_response.xml">123-456-7890</Number>
    </Dial>
    <!-- To Dial a SIP URI -->
    <Dial>
        <Uri url="answer_response.xml">sip:ly...@127.0.0.1:5080</Uri>
    </Dial>
</Response>



It is understandable and easy to write same xml in response of a request. Normally we use Gather to send request to a servlet, this servlet then responds with xml for the RCML. But in my case, I am not reaching this servlet through RCML/Gather keyword, but this servlet/java program is there, i should be able to send XML to a RCML application.

Lyle Pratt

unread,
Mar 11, 2013, 12:49:15 PM3/11/13
to mobicent...@googlegroups.com
You'll want to use the RestComm REST api to initiate an outbound call that REQUESTS the XML I gave you. It would then be connected to the SIP device, doing whatever you tell it to do through XML.

-Lyle
Message has been deleted

vixmemon

unread,
Mar 11, 2013, 6:36:40 PM3/11/13
to mobicent...@googlegroups.com
public static void main(String[] args) {
        //I have replaces accountSID and AUTHTOKEN with my accountsid and authtoken for twilio...
        TwilioRestClient client = new TwilioRestClient(ACCOUNTSID, AUTHTOKEN);

        
         // Set the call parameters.
        final Account account = client.getAccount();
        final Map<String, String> parameters = new HashMap<String, String>();
        parameters.put("From", "ser...@127.0.0.1:5080");
        parameters.put("To", "us...@127.0.0.1:5080");

        parameters.put("Url",  "http://127.0.0.1:8080/restcomm/demo/hello-world.xml");
        parameters.put("Method", "POST");
        parameters.put("Timeout", "30");
        parameters.put("Endpoint", "http://127.0.0.1:8080/restcomm"); // i have tried with this and without this....

        try {
          // Make the phone call.
          final Call call = account.getCallFactory().create(parameters);
        
        } catch(final TwilioRestException exception) {
            System.err.println(exception.getMessage());
            exception.printStackTrace();
        }

    }

but, i get following exception
Exception in thread "main" java.lang.UnsupportedOperationException: text/html;charset=utf-8 not a supported content type
    at com.twilio.sdk.TwilioRestResponse.getParser(TwilioRestResponse.java:230)
    at com.twilio.sdk.TwilioRestResponse.toMap(TwilioRestResponse.java:243)
    at com.twilio.sdk.TwilioRestException.parseResponse(TwilioRestException.java:58)
    at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:522)
    at com.twilio.sdk.resource.list.CallList.create(CallList.java:68)
    at com.systems.Main.main(Main.java:61)

Lyle Pratt

unread,
Mar 11, 2013, 11:59:36 PM3/11/13
to mobicent...@googlegroups.com
I'm actually not sure if the stock Twilio Java Rest client has been rested with RestComm. Can anyone else comment on that?

-Lyle

vixmemon

unread,
Mar 12, 2013, 5:05:59 AM3/12/13
to mobicent...@googlegroups.com
Lyle, 

I am not yet able to make a call to a SIP URI instead of a number. 

Can I make a call to a SIP URI Instead?


I have Registered a Client like this


curl --data "Login=1234&Password=1234&VoiceUrl=http://127.0.0.1:8080/restcomm/demo/restcomm_dtmf_demo.xml&VoiceMethod=POST" http://ACae6e420f425248d6a26948c17a9e2acf:77f8c12cc7b8f842...@127.0.0.1:8080/restcomm/2012-04-24/Accounts/ACae6e420f425248d6a26948c17a9e2acf/Clients.json

Then, I registered a SIP Soft Phone with this User name... the sip phone is running with this registered user. 

now, i need to make a call to this SIP Phone. 

        final TwilioRestClient client = new TwilioRestClient("ACae6e420f425248d6a26948c17a9e2acf", "77f8c12cc7b8f8423e5c38b035249166");
        final Account account = client.getAccount();
        final CallFactory factory = account.getCallFactory();
        final Map<String, String> parameters = new HashMap<String, String>();
        parameters.put("To", "sip:12...@127.0.0.1:5080");
        parameters.put("From", "sip:15...@127.0.0.1:5080");
        parameters.put("Url", "http://127.0.0.1:8080/restcomm/demo/hello-world.xml");
        final Call call = factory.create(parameters);
        call.hangup();

I get following exception

org.codehaus.jackson.JsonParseException: Unexpected character ('E' (code 69)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: java.io.StringReader@100e1b3c; line: 1, column: 2]
at org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1432)
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)
at org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)
at org.codehaus.jackson.impl.ReaderBasedParser._handleUnexpectedValue(ReaderBasedParser.java:1198)
at org.codehaus.jackson.impl.ReaderBasedParser.nextToken(ReaderBasedParser.java:485)
at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.java:2763)
at org.codehaus.jackson.map.ObjectMapper._readMapAndClose(ObjectMapper.java:2711)
at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1856)
at com.twilio.sdk.parser.JsonResponseParser.parseJson(JsonResponseParser.java:33)
at com.twilio.sdk.parser.JsonResponseParser.parse(JsonResponseParser.java:19)
at com.twilio.sdk.TwilioRestResponse.toMap(TwilioRestResponse.java:244)
at com.twilio.sdk.TwilioRestException.parseResponse(TwilioRestException.java:58)
at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:522)
at com.twilio.sdk.resource.list.CallList.create(CallList.java:68)
at com.systems.outbound.Main.testSayVerb(Main.java:76)
at com.systems.outbound.Main.main(Main.java:82)
Exception in thread "main" com.twilio.sdk.TwilioRestException
at com.twilio.sdk.TwilioRestException.parseResponse(TwilioRestException.java:74)
at com.twilio.sdk.TwilioRestClient.safeRequest(TwilioRestClient.java:522)
at com.twilio.sdk.resource.list.CallList.create(CallList.java:68)
at com.systems.outbound.Main.testSayVerb(Main.java:76)
at com.systems.outbound.Main.main(Main.java:82)

-----------------

TwilioRestResponse gives this Response Body.. 
Error type: NOT_A_NUMBER. The string supplied did not seem to be a phone number.

Lyle Pratt

unread,
Mar 12, 2013, 8:22:50 AM3/12/13
to mobicent...@googlegroups.com
I'm not sure why that fails. We'll need to ask Thomas or someone else. It SHOULD work.

-Lyle

Sent from my mobile.

Thomas Quintana

unread,
Mar 12, 2013, 10:22:22 AM3/12/13
to mobicent...@googlegroups.com
Almost done fixing this can one of you guys please open an issue so I can attach notes and close when I have tested.

Thanks,
Thomas

--
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.

Lyle Pratt

unread,
Mar 12, 2013, 11:03:36 AM3/12/13
to mobicent...@googlegroups.com

Thomas Quintana

unread,
Mar 12, 2013, 11:22:13 AM3/12/13
to mobicent...@googlegroups.com
Thanks Lyle,

I will be attending my team meeting and then I will update the ticket.

Best Regards,
Thomas

Thomas Quintana

unread,
Mar 12, 2013, 3:42:27 PM3/12/13
to mobicent...@googlegroups.com
Hi,

I have committed the fix and started a new build. When the build is finished you can find binaries @ https://mobicents.ci.cloudbees.com/job/RestComm/lastSuccessfulBuild/artifact/

Please verify if it is working for both of you while I write automated tests. I will close the ticket once you guys verify proper functionality.

Best Regards,
Thomas

Thomas Quintana

unread,
Mar 12, 2013, 4:29:28 PM3/12/13
to mobicent...@googlegroups.com
Hi guys,

Please use the latest build to test.

Cheers,
Thomas

vixmemon

unread,
Mar 12, 2013, 4:36:24 PM3/12/13
to mobicent...@googlegroups.com
Will it only be available in the binary?
Does this fix the Windows URI Issue that i reported earlier too?

Thomas

Thomas


Thomas

It is loading more messages.
0 new messages