tcp version of toronto – osaka doesn’t work

Home » Asterisk Users » tcp version of toronto – osaka doesn’t work
Asterisk Users 4 Comments

I’m trying to setup a simple tcp sip connection based on the toronto
osaka example in the Asterisk book.

On the remote box (osaka) (1.8.9.0-rc1):

[toronto]
type=friend
transport=tcp
secret=welcome
context=toronto_incoming
host=dynamic
disallow=all
allow=ulaw

sip show peer toronto

* Name : toronto
Secret :
MD5Secret :
Remote Secret:

Context : toronto_incoming
……..
Useragent : Asterisk PBX 10.1.0-rc1
Reg. Contact : sip:osaka@:5060;transport=TCP

On the home box (toronto) (10.1.0-rc1):

register => tcp://toronto:welcome@officePBX/osaka
[osaka]
type=friend
transport=tcp
secret=welcome
context=incoming
host=dynamic
disallow=all
allow=ulaw

But make a call from the remote Dial(SIP/toronto) , and the home cli shows:

Call from ” (:5060) to extension ‘osaka’ rejected because
extension not found in context ‘default’.

which makes no sense to me at all. Doesn’t the string after the “/” in
register refer to the user/device on the box doing the register? Doesn’t
it tell the device on the remote host which local device to connect to?
i.e., toronto@remote > osaka@home ?? And where’s context “default”
coming from?

Is the book just out of date? Or is tcp not ready?

sean

4 thoughts on - tcp version of toronto – osaka doesn’t work

  • Looks like tcp is messed up. Or is my setup somehow flawed? Does anyone
    have tcp working?

    Turning on sip debug on toronto gave the below INVITE. Notice From:
    “Anonymous”

    Why isn’t this toronto > ? As it is, Anonymous
    becomes the peer/user, which is not found. Then osaka is viewed as the
    extension – not the peer – and context default is searched for osaka.

    < --- SIP read from TCP::5060 —>
    INVITE sip:osaka@:5060;transport=TCP SIP/2.0
    Via: SIP/2.0/TCP :5060;branch=z9hG4bK41111f7e;rport
    Max-Forwards: 70
    Contact:
    Call-ID: 6f7df020162fa79f7e58b2015ab0f410@:5060
    CSeq: 102 INVITE
    User-Agent: Asterisk PBX 1.8.9.0-rc1
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
    INFO, PUBLISH
    Supported: replaces, timer
    Content-Type: application/sdp
    Content-Length: 244

    v=0
    o=root 1399746571 1399746571 IN IP4
    s=Asterisk PBX 1.8.9.0-rc1
    c=IN IP4

    t=0 0
    m=audio 11112 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16
    a=ptime:20
    a=sendrecv
    < ------------->

  • As I think about it, isn’t this a problem with 10.1.0 on toronto.

    The INVITE is correct:

    INVITE sip:osaka@:5060;transport=TCP SIP/2.0

    so why isn’t 10.1.0 looking for peer “osaka”?

    Is it simply a mistake that it’s taking the user from the FROM header
    rather than the INVITE?

    sean

  • OK, the book is out of date. Do Not put the name of the local
    device/user in the register statement.

    sean

  • Does it work with UDP? If so, then that is a different behaviour. The
    book only tested with UDP, not TCP, so if it works with UDP, then it was
    working as expected.

    Also, please be sure to file errata so that we can look at it for the
    next printing or version of the book (depending on what the issue
    actually is).

    Errata can be filed at http://oreilly.com/catalog/9780596517342/errata/