ftocc

(SIP HEADERS) mv370 issues anyone?

percykwong
Posts: 753
Member Since:
2007-04-30

Hey all,

I decided to pick up a portech mv370 gsm to sip gateway and needless to say it's one big flaming piece of crap. Even with tech support from portech, they couldn't get it working properly. Well, needless to say, I got it *somewhat* functioning, but I was wondering if anyone else with this unit realized that it sends the CIDname and CIDnum in reverse order?

Obviously, it's an issue due to the fact that when you reroute the call out a trunk, it doesn't pass the CIDnum.

Anybody with a quickie fix out there?

SIP DEBUG shows: where "2126608888" should be the CIDnum and not the CIDname and is obviously the CIDname and not the CIDnum.


<--- SIP read from 192.168.1.247:5060 --->
ACK sip:523@192.168.1.250 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.247:5060;branch=z9hG4bK2dc02a83af
From: "2126608888" <sip:gsm1in@192.168.1.250>;tag=4a0dc00a
To: <sip:523@192.168.1.250>;tag=as6e722499
Call-ID: 0cb93c805532fe0606c3679d06c777e3@192.168.1.247
Contact: <sip:gsm1in@192.168.1.247:5060>
CSeq: 801 ACK
Max-Forwards: 70
User-Agent: CM5K  (706220)
Content-Length: 0

I tried to write a custom context that would assign a fictitious DID to the trunk and then route from it with the CIDname as the CIDnum using Set(CallerID(num)=$(CallerID(Name)) then passing back to from-trunks, but it doesn't seem to work.. Then again, I'm a lousy coder.. I'm more an architecture and admin type.

Enclosed are my configs if anyone wants to muck around and put one together for me.. (*hint*):

Sadly enough, this could be a great product if it just *worked* properly. Half the time it picks up, the other half, it doesn't, or it just drops me to a disa generated within the gsm-gateway. (obviously, I disabled the box until a pending solution might work *security*).

Well.. Hopefully someone has a workable answer considering it's pretty much useless if I can't have the CID forwarded to my real cellphone.

TIA.

Basically, it should work like this:

Caller----> mv370 -----> Trixbox ----> voip trunk----> My real cell phone

*sigh*.. crappy taiwanese hardware... (hey.. I'm chinese, I'm allowed to make fun of my ethnic manufacturing quality) **hehe**

I left my comments for the context in, because it pretty much describes what I'm trying to do..


Trunk Settings that matter: (incoming)

User Context: gsm1in

type=friend
secret=trueism1
username=gsm1in
context=gsm-gateway-phony-did
permit=0.0.0.0/0.0.0.0
qualify=yes
host=dynamic

Extensions_custom.conf

[gsm-gateway-phony-did]
;Give the incoming calls from this trunk a phony DID so I can route the calls properly
; then set the CIDnum as the CIDname because the manufacturer's a retard.
;
exten => _.,1,Noop(Fixing DID to 2125551213)
exten => _.,1,Set(CALLERID(num)=${CALLERID(name)})
;
;verify this works or doesn't work
;
exten => _.,1 Noop(${CALLERID(all)})
;This is where I mess around with either dialing an extension or passing to another context
; obviously comment / uncomment one or the other.
; 
exten => _.,n Dial(SIP/523)
;exten => _.,n,Goto(from-trunk,2125551213,1)

--

-----------------------------------------------
Percy Kwong
www.swimminginthought.com
www.iphonebounties.com



percykwong
Posts: 753
Member Since:
2007-04-30
I'm so unloved :(

I'm so unloved :(

--

-----------------------------------------------
Percy Kwong
www.swimminginthought.com
www.iphonebounties.com



brbourdo
Posts: 374
Member Since:
2007-04-24
Quote: I'm so unloved :( I
Quote:
I'm so unloved :(

I love you, Percy! I just don't know.. :(

--

Brian Bourdon
www.redwatervoip.com
brian [at] redwatervoip [dot] com
Portland, Oregon



percykwong
Posts: 753
Member Since:
2007-04-30
yeah.. i know it's a little

yeah.. i know it's a little esoteric.. I never seem to have simple problems.. *cry*

--

-----------------------------------------------
Percy Kwong
www.swimminginthought.com
www.iphonebounties.com



tolix
Posts: 11
Member Since:
2007-10-16
[gsm] exten =>

[gsm]
exten => _X.,1,EAGI(fixcid_mv370.php,${SIP_HEADER(FROM)})
exten => _X.,n,Set(CALLERID(name)=GSM)
exten => _X.,n,Verbose(CallerID is $(CALLERID(NUM))

fixcid_mv370.php
#!/usr/bin/php -f
<?PHP
###############################################################################
#### fixcid_mv370.php - AGI-BIN
#### Author: Filippo Grassilli
###############################################################################

$cidnum=$_SERVER[argv][1]; // Caller Number (CallerID)
// Fix CallerID for GSM Gateway Portech MV-370 - Pass SIP_HEADER(FROM)
if(ereg(" $cidnum=trim(ereg_replace("(\")|(<.*)","",$cidnum));
if($cidnum[0]=="+") {
if(ereg("^\+371",$cidnum)) $cidnum=substr($cidnum,4);
else $cidnum="00".substr($cidnum,1);
} elseif($cidnum=="N") {
$cidnum="";
}
}
$cidnum="0".$cidnum;
echo "set variable CALLERID(NUM) \"$cidnum\"\n";



percykwong
Posts: 753
Member Since:
2007-04-30
Tolix, Thank You! I won't

Tolix,

Thank You! I won't be able to test it until I get back on Oct. 4. Ended up leaving for the job early.. heh.

You ROCK dude!

-Percy

--

-----------------------------------------------
Percy Kwong
www.swimminginthought.com
www.iphonebounties.com



tolix
Posts: 11
Member Since:
2007-10-16
If it helps, replace +371 to

If it helps, replace +371 to your country prefix,
and remove/change $cidnum="0".$cidnum; if you need number for calling like 02126608888 , X2126608888



majamer
Posts: 168
Member Since:
2007-08-29
Is this code still valid? I

Is this code still valid? I just tested on a MV-374 and it didn't work. The outbound calls through the gateway show the SIM card's phone number instead of the SIP caller's number. Any fix? The firmware shows the latest August version. I saved the PHP file to var/lib/asterisk/agi-bin and made asterisk the owner and the rights 0755, then added the gsm context to extensions_custom.conf and referenced it in the peer details of the GSM trunk context=gsm

--

Thank you in advance,
Martha Amer



tolix
Posts: 11
Member Since:
2007-10-16
This code only for inbound

This code only for inbound CID fixing. About outbound, i think outbound custom cid is locked by gsm provider, so we can use only sim card number :(



majamer
Posts: 168
Member Since:
2007-08-29
Interesting; so people use

Interesting; so people use GSM gateways to forward VoIP and lanline calls to GSM and vice versa just to save money in spite of this major downside? How do mobile users know where those calls are coming from?
Thanks!

--

Thank you in advance,
Martha Amer



tolix
Posts: 11
Member Since:
2007-10-16
Not allways for forwarding,

Not allways for forwarding, it can be used in companys as trunk for saving money calling to mobile phones. Specialy if company have free talks between workers mobile phones, so we can make outbound route to gsm. Im using gsm only as trunk, but in one service sending sms with cid number, but there is determinated number of called phone numbers.



percykwong
Posts: 753
Member Since:
2007-04-30
I'm looking to use this for

I'm looking to use this for Incoming GSM Service. Apparently (after really looking @ my phone bills) My "Anytime" minutes are charged against incoming calls. Now, this may not be a big deal until you have 8 employees out in the field constantly calling the office for support, questions, etc. Those minutes get burned up pretty quickly, but with a GSM<-->VOIP gateway, those minutes don't get burned up, but are "free", because they're mobile to mobile. That leads to a big savings for me.

--

-----------------------------------------------
Percy Kwong
www.swimminginthought.com
www.iphonebounties.com



majamer
Posts: 168
Member Since:
2007-08-29
But would you really

But would you really sacrifice the caller ID feature just to lower your bill? I was exploring the idea of GSM gateway to offer it to my clients who have plenty of reps out in the field. When I saw that the incoming CID is getting replaced with the one of the SIM cards' CID I had to mention this in my offers but none of the clients was interested. The rep needs to know where the call is coming from. Also, what happens if the wireless vendor finds out that those calls are coming from a GSM gateway, they will begin deactivating the SIM card as this is against their policy. Having said that, this gateway works well for the company calling its reps (not customers calling the reps through the gateway) or the reps calling the company.

--

Thank you in advance,
Martha Amer



tolix
Posts: 11
Member Since:
2007-10-16
Incoming CID ->gsm->asterisk

Incoming CID ->gsm->asterisk will work, outgoing CID asterisk->gsm->somethere will allways be sim card number or 2 or 3 numbers, depend on route/trunk configuration. Calling to this gsm number you will go an IVR or to a secretary or ringroup as you wish. So in many cases there is no problem. About bloking SIM card i think operators are interested in to make more traffic from your company via gsm connection but not from pstn :)



railson
Posts: 1
Member Since:
2008-09-14
I get caller-id from the "From" SIP Header.

exten => ###,n,Set(from=${SIP_HEADER(From)})
exten => ###,n,Set(cid=${from:0:8}) <- should be better but I only use it to receive local calls
exten => ###,n,Set(CALLERID(number)=${cid})
exten => ###,n,Set(CALLERID(name)=${cid})



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.