News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Using CSipSimple With OBi

Started by ianobi, November 25, 2012, 03:26:42 AM

Previous topic - Next topic

ianobi

#60
Good DigitMap detective work there by azrobert   :)

I accept that some users do find my InboundCallRoute a little daunting. Its aim is to be all things to all people. It allows any device to call in and use single stage dialling to call out on any service on the OBi. This includes direct calling to the auto attendant or to the local OBi phone so you can call home directly. The **7 is needed in some parts of the world to avoid conflict with the sip2sip servers. I have **7 rules and the non **7 equivalents to allow local softphones etc to also use sp2 for single stage dialling through the OBi. At home I also use a different CSipSimple account to convert my cellphone into a local wifi phone to connect with my home OBi the same way as the Phone Port phone. All these work through the sp2 InboundCallRoute.

So that's why its so complicated   :D

Having said all that, I do believe in keeping things simple if that's possible. If your need is simple then use a simple InboundCallRoute.

With regard to STUN and ICE, my advice is to only try them if you have problems. Here is an extract from the sip2sip website:

QuoteSTUN Servers
You may use STUN for ICE NAT traversal. The STUN servers can be found in the DNS by using SRV lookup for _stun._udp.sip2sip.info.

NAT Traversal¶
SIP2SIP infrastructure is smart enough to handle the NAT traversal for both SIP signaling, RTP and MSRP media sessions. Also it supports ICE negotiation in the clients and provides automatically a TURN relay candidate.

Practically, you should not set any NAT traversal features in the client as the chance of fixing things is much smaller than breaking them.
•   Do not use STUN for Register purposes
•   Do not set your client to discover a global IP address

azrobert

Quote from: ianobi on May 20, 2013, 08:40:41 AM
I accept that some users do find my InboundCallRoute a little daunting.

The first time I saw that inbound route my eyes crossed. LOL

Without thinking about it much I always thought the **7 prefix was to avoid conflict with your Phone Port DigitMap (prefixing numbers with **n). I see that was faulty analysis. I had no idea why the **7 and non **7 testing. Thanks for the explaination.

jjjooonnn

Getting to this setup has been quite a learning experience!
My working setup: https://plus.google.com/111737898109693132669/posts/RTj7MXhmkCG

I'm sure a lot of others are in the same boat, since the obi app is SOooo outdated, CSipSimple is really the only viable option for anyone.

I'll keep the STUN/ICE options in mind whenever I'm on public WiFi, I'll give it a go.

You've been a great help anobi. For a 6month old post, to still get a response it amazing enough!  (both of you ianobi, azrobert, again thank  you)

odyindfamily

Hi jjjooonnn

I want to setup this softphone option in replacement to the OBIon App on my android phone. It's seems your working setup location is giving that this post is deleted. Can you please share the steps involved to use my OBI110 device and CSipSimple softphone on the android device. Thank you in advance.

jjjooonnn

Sorry, haven't checked this post in forever and the link was broken. Try this one: https://plus.google.com/111737898109693132669/posts/HXRCx8hiTWo

lguerra10

I am using the beautiful method proposed by azrobert quoted below
I have sp1 in OBI 110 connected to Google Voice and I am trying to call from my cell phone through OBI 110

In the method described by azrobert my User name is maria
In OBi's SP2 X_InboundCallRoute, I am using the following rule:{('maria'):sp1} (the rule proposed by azrobert does not work for me)

when I dial any phone using CsipSimple I hear  my cell-phone ringing for ever until it times out or until I stop the process, but the person that I ring does not hear the phone ringing, so obviously something does not work.

The call history, though, is exactly the same than when using OBION (the android client from OBI). OBION works just fine. Here you have the call history

Call 13   09/11/2013    22:41:13   

Terminal ID   SP2   GoogleVoice1
Peer Name     Mariatweidner   
Peer Number   maria   7146513070
Direction   Inbound   Outbound
22:41:13   Ringing   
22:41:16      Call Connected
22:41:30   End Call   

Call 14   09/11/2013    22:18:37   

Terminal ID   OBiTALK1   GoogleVoice1
Peer Name     Luis phone   
Peer Number   290367476   7146513070
Direction   Inbound   Outbound
22:18:37   Ringing   
22:18:40      Call Connected
22:18:47   End Call

any idea as to why this may happen and how to correct this?

Thanks   

Quote from: azrobert on February 04, 2013, 03:46:30 PM
I have a new method of using CSipSimple to directly initiate calls on an OBi, eliminating Sip2Sip.

In CSipsimple add a new account.
Select BASIC
Account name = anything
User = robert
Server = me.dyndns.com:5061
Password = anything
SAVE

Press and hold on the account name.
When a new screen appears select "Choose Wizard".
Select Expert
Select your account again.
Select Registration URI and blank it out, then ok.
SAVE

In OBi's SP2 X_InboundCallRoute add:
{(robert)>(xxxxxxxxxx):sp1}

That's it. Dial a number on your Android and the call will go out SP1.
No CSipSimple filters.



ianobi

Iguerra - welcome to the forum.

Try this rule in your InboundCallRoute:

{('maria')>(xx.):sp1}


The most reliable way I have found of using CSipSimple calling in directly is here:

http://www.obitalk.com/forum/index.php?topic=6211.msg39466#msg39466

Note: This method does need another registered sip service to "piggy-back" off.

lguerra10

Thanks ianobi for the help
{('maria')>(xx.):sp1} behaves the same than {('maria'):sp1} with the exception that I do not hear the ringing. The callhistory still shows ringing and conected to GV, but the other party's phone does not ring.

I tried your method. Exacty as per your example with the following changes

User Defined DigitMap "cot"
Display Label> cot
DigitMap> 'maria'

Instead of  "sip:my.ddns.com:5070"  in Proxy URI, I have used sip:212.21.37.49:5060 this is the external address of my router where I have forwarded 5060 to 5061 to the OBI internal address 192.168.1.20.
The UserAgentPort of sp1 is 5060

When I try to dial I get "404/Not found" in the CSip call in progress screen.
The port forwarding schema seems to work with sp2 (5061) but not with sp1 (5060) since call history does not show any call thru sp1.



ianobi

QuoteUser Defined DigitMap "cot"
Display Label> cot
DigitMap> 'maria'

The DigitMap should be in parentheses like so:
DigitMap> ('maria')


Quotein Proxy URI, I have used sip:212.21.37.49:5060 this is the external address of my router where I have forwarded 5060 to 5061

This does not need to be so complicated. In Proxy URI simply use 212.21.37.49:5061. Your router will then direct calls from CSipSimple to OBi sp2 InboundCallRoute. This will then direct the calls to use GV on sp1:

Voice Services > SP2 Service > X_InboundCallRoute:
((Mcot)>(xx.):sp1)

Or this may work better for you:

Voice Services > SP2 Service > X_InboundCallRoute:
{('maria'):sp1}

For this configuration to work there must be a registered sip service on sp2 for the direct ip calling from CSipSimple to "piggy-back" off. It can be any SIP voip provider (not GV). You could use a free one such as sip2sip.

lguerra10

Thanks for the help, we are getting close

When I apply what you suggested the call is directed to the phone connected to the OBI110 and the phone rings

Voice Services > SP2 Service > X_InboundCallRoute:
{('maria'):sp1}

For this configuration to work there must be a registered sip service on sp2 for the direct ip calling from CSipSimple to "piggy-back" off. It can be any SIP voip provider (not GV). You could use a free one such as sip2sip.

May be I need to modify the SP1  X_InboundCallRoute but I do not know how.

If with your help we succeed we will post the solution to the foum

Here you have the history
Call 1   01/02/2010    01:00:09   

Terminal ID   SP2   PHONE1
Peer Name   Mariatweidner   
Peer Number   maria   
Direction   Inbound   Inbound
01:00:09   Ringing   
20:12:42   End Call   

lguerra10

Hi again

I modified my SP1 route
my SP1 X_Inbound Call Route is

{pp(ob290367476),ph},{(Mcot)>(Msp1),(Mcot)>(<**1:>(Msp1)):sp1},{(Mcot)>(<**2:>(Msp2)):sp2},{(Mcot)>(<**8:>(Mli)):li},{(Mcot)>(<**9:>(Mpp)):pp},{(Mcot)>**0:aa},{(Mcot)>0:ph}

with this I get the following history

Call 1   09/15/2013    20:30:57   

Terminal ID   SP2   GoogleVoice1
Peer Name   Mariatweidner   
Peer Number   maria   7145613070
Direction         Inbound   Outbound
20:30:57   Ringing   
20:31:06   End Call

It looks as if the call goes to GoogleVoice, but ... the CSIp client does not ring and the call times out without ringing at the other side. I am at the ppoint where I started last week. The call seem to go to GV but things do not work.



lguerra10

YES!!! Problem solved. Things with CsipSimple work great

Thanks especially to ianobi and to azrobert for their ideas and help. This has to be the simplest way to make Csip work if you have admin access to the router in your LAN


The quality of the call both with WIFI and Data is perfect

the solution works as follows

1. In the router forward all the required ports at the WAN to the OBI inside the LAN

   1   OBI   5060 ~ 5062   5060 ~ 5062   UDP   192.168.1.11   
   2   OBI-1   10000 ~ 11000   10000 ~ 11000   UDP   192.168.1.11   
   3   OBI-2   16600 ~ 16998   16600 ~ 16998   UDP   192.168.1.11   
   4   OBI-3   19305   19305   UDP   192.168.1.11   
   5   OBI-4   5222 ~ 5223   5222 ~ 5223   TCP   192.168.1.11   
   6   OBI-5   6800   6800   TCP/UDP   192.168.1.11
   
2. SP2 X_InboundCallRoute
{('pgonzalezg'):a},{('maria'):sp1)} ,{ph}

3. SP1 X_InboundCallRoute
{pp(ob290367476),ph},{(Mcot)>(Msp1),(Mcot)>(<**1:>(Msp1)):sp1},{(Mcot)>(<**2:>(Msp2)):sp2},{(Mcot)>(<**8:>(Mli)):li},{(Mcot)>(<**9:>(Mpp)):pp},{(Mcot)>**0:aa},{('luis'):sp1},{(Mcot)>0:ph}

The SP2 has a SIP service associated with it to receive calls

The settings at the CSIP client have been explained in this same thread by azrobert.

lguerra10

Further notes on CSIP battery usage
CSIP uses by defaul UDP transport. With this setting and always on (to receive calls) the program was using battery in my Jiayu GS2 (3000 mWh battery) at a pace of over 8% per hour.
I changed the setting "Transport" to TCP in the Account-Edit. This reduced the usage to below 3% per hour.
The quality of the calls is perfect with UDP or TCP, both over WIFI or Data.
Good luck

Texas

A MUCH BETTER SOLUTION !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Easier Too ! This is so simple a baby can do this.

Ok. I tried and tried and tried to use the ObiTALK Android app and it SUCKS! (Apple app work ok). So, here is the good news!

I have an OBi100:

- SP1 = GoogleVoice
- SP2 = Callcentric SIP (100% FREE! Free callcentric number and FREE USA DID)
- Auto Attendant turned ON with default values

OBJECTIVE: If specific callcentric users OR anyone (your choice) calls our callcentric number which comes in on SP2 they get our Auto Attendant and can make a free USA phone call.
 
SOLUTION:
IF you put under Voice Services, SP2 Service, X_InboundCallRoute={1777xxxxxxx|1777xxxxxxx>:aa},{ph}    THEN the specified 1777xxxxxxx number/s goes to AA and your DONE !!!!! All other calls rings our phone. AA takes over and completes the call as desired. OBiTALK NOT USED OR ENABLED. OBi services on their web site NOT USED. EVERYTHING CONTROLLED BY YOUR OBi device.

Using cSIPsimple app works PERFECTLY on ALL Android and Apple devices. THE CALLS ARE ALWAYS 100% FREE. No DID number needed. Anyone in the entire world can call your OBi device and make free USA phone calls.

GREAT STUFF !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 

PS. Other SIP apps like Media5 phone (use to be my favorite but no more) and 3CX and many others have serious problems (especially the android apps). The call completes and voice works but is disconnected after a few seconds. MUST USE cSIPsimple !

Usetheforceobiwan

#74
I really want to try this method but have reservations from a security perspective as far as inbound dialing from Csipsimple to the Obi.  

If I am reading this thread (and several of the others) correctly - and I have read them over and over again - the only security with the sip to sip (not to be confused with sip2sip) connection is by the userid that is passed through the LAN or internet connection to the listening port on the Obi box.  In other words, the Csipsimple app establishes a connection with your routers public IP address which uses the open port (5060 or whatever corresponds to the appropriate Spx you are communicating with) to act as a pass through to the Obi box.  Once this connection is established, your Obi box checks the userid of the inbound communication stream and if it matches,  permits access to the specific Spx for you to make your call through the Obi box to other trunks.

My security concern is if someone else tried to make the same connection to your Obi box using the same sip to sip method, could they make calls through your Obi box if they used the same userid that you had established?  Also, is this method vulnerable to port scanning and other malicious hacking exploits?

If the security possible by the sip to sip connection is too weak, are there any merits to putting the Obi box behind a VPN?  I have read elsewhere of others using Android's built in VPN client to establish connections to a VOIP provider or server.

I am hoping other more knowledgeable forum members can share their thoughts on this subject.

ianobi

#75
Security is always an issue worth considering. Looking at InboundCallRoutes we have three parts that we can use:

Caller>callee:terminal

If we look at the "Direct Calling" method of using CSipSimple described here, then we can see a typical InboundCallRoute:

http://www.obitalk.com/forum/index.php?topic=6211.msg39466#msg39466

Voice Services > SP1 Service > X_InboundCallRoute (typical example):
{(Mcot)>(Msp1),(Mcot)>(<**1:>(Msp1)):sp1},{(Mcot)>(<**2:>(Msp2)):sp2},{(Mcot)>(<**8:>(Mli)):li},{(Mcot)>(<**9:>(Mpp)):pp},{(Mcot)>**0:aa},{(Mcot)>0:ph},{>1787856:ph}

Mcot contains the list of allowed CallerIDs. These can be quite complex made up of numbers, lower and upper case letters (beware of "reserved characters"). The OBi is case sensitive whan it deals with CallerIDs. For example you might have a CallerID of 62Hf17nN4kd3. Hackers and scanners are not easily going to break that sort of CallerID. I'm not sure how many characters long a CallerID can be, but long enough for our purposes!

Callee is used differently. The last rule above {>1787856:ph} is a typical use of the "Oleg Method". An incoming service or DID is allowed to call the target (phone in this case) if they are using the correct callee. The callee in this case might be your phone number or SIP identity. In this case callers only get access to ring your phone, no through dialling is allowed.

Callee in a more complex rule above such as {(Mcot)>(<**2:>(Msp2)):sp2} is (<**2:>(Msp2)). In this case the number dialled has to begin with **2 and match the DigitMap Msp2. We use **2 to make it the same as dialling from the phone attached to the OBi. However, if you wished to make things more difficult for hackers, you could use any combination such as (<**2*8:>(Msp2)). The problem here is that you are making things difficult for yourself! You could be extra clever and use CSipSimple's filters to add these odd codes for you.

Next we have terminal. Not much you can do here, although a blank terminal can be used to send unwanted callers to the "bit bucket" as in this rule:
{(?|x|xx|xxx|xxxx|xxxxx|xxxxxx|un@@.|anon@@.):}
This will ban calls with no Peer Number, any Peer Number less than seven digits, Peer Number "unknown" and Peer Number "anonymous".

Finally we have the SIP "listening ports". The OBi knows them as UserAgentPorts. I recommend always changing them to something obscure well away from 5060, 5061 etc. It's not a sure way to stop scanners, but it's another level of security to add to the others.

I've been using CSipSimple for direct calling into my OBi for quite a while and have had no hacker / scanner problems. I do use most of the methods described above.

May the OBi force be with you   :)

Usetheforceobiwan

#76
May the force with you too ianobi  :o  And thanks for your reply.

OK, so if I am reading this correctly, the security is provided by four factors - IP address, UserAgentPort, Caller ID and the dialing instructions.  
That is, for a SIP connection / call to made to and through your OBi box, the only way the connection can result in a call being made through one of your trunks is if all of the following conditions are met:

1)  The connection attempt goes to the correct IP address whether it's a public IP or DNS / NAT.
2)  The connection uses the proper UserAgentPort corresponding to the Spx you are using for the relay.  Your router has to have this port open.
3)  The CallerID matches a string in the COT (circle of trust) you create.
4)  The dialing instructions included in this connection's call setup have the proper prefix that matches the routing instructions in your InboundCallRoute.

Looking at these conditions for call placement, I see where it would be  fairly difficult to get all four factors correct at the same time.  I mean IP and port are more easily obtained but also having the correct CallerID and dialing instructions are not.  

ianobi

Yes, you are correct about the four factors with regard to single-stage through dialling.

I keep my prefixes (**1, **2 etc) as standard because I use the same InboundCallRoute for CSipSimple, softphones and another OBi. If you only use the InboundCallRoute for CSipSimple, then you could use its filters to add quite complex prefixes and have OBi remove them before dialling.

"cot" is simply a User Defined Digit Map. You can put the CallerIDs directly in the InboundCallRoute rules, but that makes the rules long and complex. Also using "cot" means that you only have one place to make any changes.

medscy

Hello,

I have tried the direct method posted here.. It worked like a charm on my home network....but failed the moment I go on 4G network or from other wifi network.

I realise that the ACK messages from CSIPSimple never reaches my router on the Internet.... As a result, I can only hear audio from my CSipSimple client to my home phone via Obi...but there is no return audio from Obi back onto CSIPSimple....

Below is the SIP trace on my CSIPSimple client. Note that the "Contact" field contains the private address of my OBI... my guess is that the ACK message got sent to the private address which got lost on the Internet..... that explains why it works for my wifi but not on 4G.... Anyone has any suggestion how to alter that field?

8.8.8.100:1234:
SIP/2.0 200 OK
Call-ID: TtDF7xJN7uvUo-1c3X88BrYVHVJRCbZR
CSeq: 7423 INVITE
Content-Length: 359
From: "test" <sip:test@127.0.0.1>;tag=0nt0zDKLhbNrMH8k0i8mkuQAIP3wFzfa
To: <sip:**0@me.dyndns.org>;tag=SP1243eb3644ac3da40
Via: SIP/2.0/UDP 118.61.22.18:33639;branch=z9hG4bKPjKjIQPqxT0.U2ZobtCY.yz71ZkexApIEY;received=118.61.22.18;rport=33639
Server: OBIHAI/OBi110-1.3.0.2824
Contact: <sip:obi110@192.168.1.100:5060>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Type: application/sdp

v=0
o=- 544003 1 IN IP4 8.8.8.100
s=-
c=IN IP4 8.8.8.100
t=0 0
m=audio 16602 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=ptime:20
a=xg726bitorder:big-endian
a=candidate:1 1 UDP 2113929216 192.168.1.100 16602 typ host
a=candidate:2 1 UDP 2097152000 8.8.8.100 16602 typ srflx



ianobi

medscy,

This is a common problem using an OBi with peer to peer type configurations. The problem it to get the OBi to declare its external ip address rather than its internal ip address. Did you try this method:

http://www.obitalk.com/forum/index.php?topic=6211.msg39466#msg39466

It piggy-backs on an existing registered SIP account. This forces the OBi to use its external ip address.

The other way if you have a fixed external ip address is to change these settings:

Service Providers -> ITSP Profile X -> SIP -> X_DiscoverPublicAddress: Unchecked
Service Providers -> ITSP Profile X -> SIP -> X_PublicIPAddress: Insert your public IP address

There's quite a few posts regarding this problem. Look for posts by hwittenb and azrobert.

My setup just now has two accounts. I use the direct method to effectively use my cell phone as a wifi phone around the home. I use the indirect method via sip2sip to call into my obi from anywhere in the world. If using 3g, then its well worth buying the G729 codec for CSipSimple.