Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

Topic # 29700 15-Jan-2009 20:31
Send private message

i have a SIP gateway device connected to an asterisk box which is sending all numbers in as +5000 (extension) +095551234 (e.g. auckland) +0275551234 (e.g. mobile).  How do I tell asterisk to strip/ignore the "+" on the number?





Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs


Create new topic
27065 posts

Uber Geek
+1 received by user: 6508

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  Reply # 189851 15-Jan-2009 20:38
Send private message

Asterisk is receiving the numbers from an external SIP provider with the + at the front? What provider is this?



Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 190082 16-Jan-2009 23:32
Send private message

sbiddle: Asterisk is receiving the numbers from an external SIP provider with the + at the front? What provider is this?


its not an external provider - i have two sip gateways sending numbers in with the + at the start.  One is a quintum tenor sip/analog fxo/fxs box, the other is a Microsoft OCS server




Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs


27065 posts

Uber Geek
+1 received by user: 6508

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  Reply # 190109 17-Jan-2009 06:48
Send private message

Something like this

exten => _.,1,Set(CALLERID(num)=${CALLERID(num):1})
exten => _.,n,Goto(from-trunk,${EXTEN},1)

Will return the CALLERID field with all characters after the 1st digit which is a + in this case.

This needs to be put somewhere in your incoming trunk settings or you could create a customer trunk such as the following which you could refer to as trunk-stripfirst

[from-trunk-stripfirst]
exten => _.,1,Set(CALLERID(num)=${CALLERID(num):1})
exten => _.,n,Goto(from-trunk,${EXTEN},1)




Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 190241 17-Jan-2009 21:08
Send private message

thanks, i'll give that a try.

I was hoping there was a nice simple setting I could put in the sip trunk file such as "trunk-prefix=+" or an easy way to handle it in the dialplan but after a bunch of searching I was getting nowhere

i'm pretty sure I could config the quintum so that the + wasnt sent, but i'm not so sure I can get the ocs box to do the same




Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs


27065 posts

Uber Geek
+1 received by user: 6508

Moderator
Trusted
Biddle Corp
Lifetime subscriber

  Reply # 190243 17-Jan-2009 21:12
Send private message

Are you using pure Asterisk or a distro such as trixbox? Assuming both OCS and your gateway use the same incoming context then the change is fairly simple.

2355 posts

Uber Geek
+1 received by user: 374

Trusted

  Reply # 190245 17-Jan-2009 21:19
Send private message

sbiddle: Are you using pure Asterisk or a distro such as trixbox? Assuming both OCS and your gateway use the same incoming context then the change is fairly simple.


why don't you try and get the other devices "fixed" so they send proper CID? instead of trying to fix something else becuase the 1st device is broken?

Thanks
:)




Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 190246 17-Jan-2009 21:19
Send private message

sbiddle: Are you using pure Asterisk or a distro such as trixbox? Assuming both OCS and your gateway use the same incoming context then the change is fairly simple.


i'm using elastix with the asterisk component upgraded to 1.6 (to handle SIP over TCP).  The freepbx was also upgraded to latest version.  As such a bunch of other stuff is broken but i'm not worried about those bits :)

I havent configured anything outside of the elastix interface for teh sip trunks and extensions.  I have a callplus sip trunk (for pstn), a quintum and ocs sip trunk (for interconnectivity) and a bunch of extensions in the 5xxx range.

in an earlier test I used pure asterisk on top of centos and built the sip.conf and extensiosn.conf files manually which meant that I built the suport for the + directly into these files in that case (and it worked ok). 




Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs




Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 190247 17-Jan-2009 21:20
Send private message

LennonNZ:
sbiddle: Are you using pure Asterisk or a distro such as trixbox? Assuming both OCS and your gateway use the same incoming context then the change is fairly simple.


why don't you try and get the other devices "fixed" so they send proper CID? instead of trying to fix something else becuase the 1st device is broken?

Thanks
:)



i always thought that E.164 included the +..... to me, asterisk is broken :P




Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs


2355 posts

Uber Geek
+1 received by user: 374

Trusted

  Reply # 190249 17-Jan-2009 21:31
Send private message

CallerID != E164.

E164 is a routing protocol.




Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 190253 17-Jan-2009 21:53
Send private message

LennonNZ: CallerID != E164.

E164 is a routing protocol.



well its not the CallerID thats the problem for me, its the destination number.  asterisk is receiving a call addressed to +64275551234 which it then needs to route out the callplus sip trunk (or if its a +5XXX then route to an asterisk extension)

note: if i send calls the other way it works fine... ocs and the quintum box route them appropriately. i  have to prepend the + to the normalised number though as it leaves asterisk.




Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs




Infrastructure Geek
4056 posts

Uber Geek
+1 received by user: 195

Trusted
Microsoft NZ
Subscriber

  Reply # 194016 4-Feb-2009 15:14
Send private message

with the release of teh R2 version of Microsoft OCS i can now get around this pesky problem with ease:

http://technet.microsoft.com/en-us/library/dd441273(office.13).aspx
Handling E.164 Numbers in Outbound Calls
By default, E.164 numbers in the Request Uniform Resource Identifier (URI) for outgoing calls are prefixed with a plus sign (+). Most Private Branch eXchanges (PBXs) process such numbers without problem. Certain PBXs, however, do not accept numbers that are prefixed with a plus sign.

To ensure interoperability with these PBXs, Mediation Server has a new WMI Boolean setting called RemovePlusFromRequestURI, which has two values: TRUE and FALSE. If your PBX does not accept numbers prefixed with a plus sign, the value for the WMI setting should be set to TRUE, which causes Mediation Server to strip the plus sign from a Request URI for outbound calls. The default is FALSE, which causes Mediation Server to pass the outgoing INVITE’s Request URI, To URI, and From URI unchanged.





Technical Evangelist
Microsoft NZ
about.me/nzregs
Twitter: @nzregs


Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.