[Asterisk-Users] Broadvoice asterisk patch

brian at fcu.com brian at fcu.com
Wed Nov 10 12:54:22 MST 2004


Just received this from broadvoice, anyone know if this patch will
become part of the CVS tree?


------------------
THIS PATCH MUST BE APPLIED WITHIN 5 DAYS OF RECEIVING THIS E-MAIL OR YOU
WILL RISK THE POSSIBLE SUSPENSION OF YOUR BROADVOICE SERVICE. WE
APOLOGIZE FOR ANY INCONVENIENCE THIS MAY CAUSE BUT REQUIRE THIS PATCH IN
ORDER TO MAINTAIN UNINTERRUPTED OPERATION.


Dear Asterisk-Using BroadVoice Customer,

BroadVoice has been working very hard in recent months to become a
market leader in VoIP service.? As a part of that effort, we have made a
concerted effort to facilitate interoperability with as many different
SIP devices as possible -- including Asterisk.? While BroadVoice does
not directly support Asterisk and will not be able to field specific
question on your Asterisk set-up we are doing our best to assist.

Unfortunately, the SIP channel in Asterisk has a number of serious
issues which make it very difficult for BroadVoice to accommodate
Asterisk.? One of these issues, a bug with the Asterisk registration
system, is causing an unacceptable load our systems.

BroadVoice has hired Olle Johansson and Steve Sokol (the AstriCon team)
to work out a solution to the issue.? Attached is a patch that, when
applied, will reduce the undue strain on the BroadVoice systems by
properly handling registration for Asterisk servers located behind NAT
gateways.? We ask that you take a few minutes and patch your server
using the following instructions.

This patch applies both to the current CVS Head and the Stable 1.0
versions of Asterisk.? If you are running an older version of Asterisk,
please update your system to at least 1.0 prior to applying this patch
(or you can hack the patch into place in the old chan_sip.c if you feel
like it).

Note that this patch will be incorporated into the Asterisk CVS at the
earliest opportunity.? However, due to the serious nature of the issue
we ask that you patch your servers immediately.

-= Patch Instructions =-

1.? Copy the patch to /usr/src/asterisk/channels/ (or wherever you store
your Asterisk source image.

# cp /usr/bob/sip_patch.diff /usr/src/asterisk/channels/

2.? Apply the patch using the following command:

# cd /usr/src/asterisk/channels
# patch chan_sip.c sip_patch.diff

3.? Re-compile the SIP channel by executing 'make' in the /etc/asterisk
directory.

# cd /usr/src/asterisk
# make

4.? Install the newly compiled SIP channel with the 'make install'
command.

# make install

5.? Restart Asterisk to enable the patch as follows:

# asterisk -rx "restart when convenient"

This patch will update the Asterisk channel to cache and properly handle
registration messages.? Please review the code and, if you have any
suggestions, send comments to the author at oej at edvina.net

-= BroadVoice Configuration Notes =-

Because Asterisk does not have outbound proxy support, you need to make
a few other changes to make Asterisk work well with BroadVoice.

1.? Find the closest BroadVoice proxy using the 'ping' utility.

proxy.dca.broadvoice.com??????? 147.135.0.128
proxy.lax.broadvoice.com??????? 147.135.8.128
proxy.mia.broadvoice.com??????? 147.135.4.128


# ping proxy.lax.broadvoice.com


PING proxy.lax.broadvoice.com (147.135.8.128) 56(84) bytes of data.
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=1
ttl=47 time=41 ms
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=2
ttl=47 time=31 ms
64 bytes from proxy.lax.broadvoice.com (147.135.8.128): icmp_seq=3
ttl=47 time=58 ms

# ping proxy.dca.broadvoice.com
PING proxy.dca.broadvoice.com (147.135.0.128) 56(84) bytes of data.
64 bytes from proxy.dca.broadvoice.com (147.135.0.128): icmp_seq=1
ttl=47 time=141 ms
64 bytes from proxy.dca.broadvoice.com (147.135.0.128): icmp_seq=2
ttl=47 time=312 ms
64 bytes from proxy.dca.broadvoice.com (147.135.0.128): icmp_seq=3
ttl=47 time=258 ms

Which ever proxy is closer (has a shorter ping time) is the proxy you
want to use.

2.? Make the proxy your default by adding it to your /etc/hosts file.

cd /etc
vi hosts

If say dca is closest add a host entry that looks like:

147.135.0.128?????? sip.broadvoice.com

of course replace 0.128 with the ip of the "closer" proxy

3.? Configure Asterisk to connect to BroadVoice:

?From the sip.conf file:

register => 8165551212:MyPa55w07d at sip.broadvoice.com/8165551212

[broadvoice]
type=friend
username=8165551212
fromuser=8165551212
secret=MyPa55w07d
host=sip.broadvoice.com
port=5060
context=broadvoice
fromdomain=sip.broadvoice.com
canreinvite=no
dtmfmode=inband
insecure=very
permit=147.135.0.128/32????? ; or of closer proxy
qualify=yes

Note that having the IP address in the host file alters the way SIP
recognizes incoming calls from BroadVoice (before, Asterisk would not
tie incoming BroadVoice calls to the BroadVoice peer).? For this reason
you have to add the "insecure=very" to allow Asterisk to accept calls,
then add the permit=147.135.X.128/32 to limit calls to only the valid
proxy.

Calls from BroadVoice will end up in the 'broadvoice' context in
extensions.conf.? You will need to add an entry for your own phone
number in the context and direct that to whatever device you want:

[broadvoice]
exten => 8165551212,1,Dial(SIP/100|30)
exten => 8165551212,2,VoiceMail(u100 at default)
exten => 8165551212,102,VoiceMail(b100 at default)

Alternately you can leave the phone number off the end of the 'register'
statement in sip.conf and Asterisk will set it to 's' automatically.? In
that case you would want the following:

exten => s,1,Dial(SIP/100|30)
exten => s,2,VoiceMail(u100 at default)
exten => s,102,VoiceMail(b100 at default)

Send outbound PSTN calls to your BroadVoice account as follows:

[outgoing-context]
exten => _.,1,Dial(SIP/broadvoice/${EXTEN})
exten => _.,2,Congestion()


Thanks for helping to make Asterisk and BroadVoice work together, and
thank you for your business.


Sincerely,

The BroadVoice Team



-------------- next part --------------
A non-text attachment was scrubbed...
Name: sip_patch.tar
Type: application/x-tar
Size: 20480 bytes
Desc: sip_patch.tar
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041110/dd579ce5/sip_patch.tar


More information about the asterisk-users mailing list