Is there a way to force sipsorcery to pass the actual CID to the ATA when receiving a incoming call using IPKALL?
Sipsorcery passes whatever CID it received from IPKall (unless you tweak CID in your "In" dialplan, which I believe is not the case). If your IPKall number is so-called "misbehaving" one, it will send a wrong CID to Sipsorcery (typically CID of a local termination). There's nothing you can do about it... the only suggestion - forward your incoming calls via some other provider (e.g. Gizmo5). The other providers have their own problems, though...
Stiefel,
Interworking with C# is a bit tricky. Sometimes you have to use to_s, sometimes to_str, and yet there is ToString(). Sometimes 2 or even all 3 work fine. Typically you have to find out what works on this or that particular object, by try and error.
Long ago I found that to_s works fine on req.URI.User and have been using it this way ever since.
As to your experiments with dst.length, I don't see why would you need all that. You have a pattern in "when" and the most natural way would be to use this pattern for removing leading of leading zeroes:
- Code: Select all
when /^000(1[2-9]\d{2}[2-9]\d{6})/ then sys.GoogleVoiceCall("user name", "password", "1747xxxxxxx", $1)
After all, the pattern will make sure you have a valid US number after 000
P.S. If you want to remove 3 first chars from a string, use this:
dst[3..-1]
No need in all that "length" gymnastics
