Incoming Call Label

Home » Asterisk Users » Incoming Call Label
Asterisk Users 11 Comments

I’m using Audio-codes MP-114 unit and it has two public lines PSTN ports

IN audocodes setting I have:
“EndPoint Phone Number

Channel: 3 phone number: pstn-4444
Channel: 4 phone number: pstn-9998

When I am calling ” pstn-4444″ the port number “Channel:3” lights up but asterisk is showing that the call is coming on “pstn-9998”

— Executing ….. Answer(“SIP/pstn-9998….

Asterisk should be showing “pstn-4444” (not pstn-9998)
Where is this label coming from?

11 thoughts on - Incoming Call Label

  • Thanks for the input.

    In sip.conf I have relevant entries.

    [pstn-4444] ; incoming/outgoing calls on FXO port type=friend secret=spa354
    username=voice-4444
    mailboxb2 ; just for audiocodes error complain host=dynamic canreinvite=no ; (dtmf not wroking correctly without this one)
    disallow=all allow=ulaw allow=alaw nat=no context=incoming callgroup=1
    pickupgroup=1
    insecure=invite

    [pstn-9998]
    type=friend secret8567
    username

  • Not necessarily. You appear to be doing IP+port based matching. If requests always come from the same source IP address and port, then it would match only one. Turning on sip debug using “sip set debug on” and verbosity using “core set debug 9” would give you more information about each packet (including where it is from) and what was actually matched based on it.

  • Thanks again for the hint. Here is the output from asterisk.

    The call is coming on Audocodes gateway from: pstn-4444

    But asterisk display:
    Found peer ‘pstn-9998’ for ‘7804715665’ from 10.10.0.8:5060

    Why not loolking up “pstn-4444” in sip.conf?

    <--- SIP read from UDP:10.10.0.8:5060 --->
    INVITE sip:4@10.10.0.4 SIP/2.0
    Via: SIP/2.0/UDP 10.10.0.8;branch=z9hG4bKac766808844
    Max-Forwards: 70
    From: “Z” ;tag766802762
    To:
    Call-ID: 7668022781522018162620@10.10.0.8
    CSeq: 1 INVITE
    Contact:
    Supported:
    em,100rel,timer,replaces,path,early-session,resource-priority,sdp-anat Allow:
    REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE
    User-Agent: Audiocodes-Sip-Gateway-/v.5.80A.032.003
    Content-Type: application/sdp Content-Disposition: session Content-Length: 249

    v=0
    o=AudiocodesGW 766797875 766797759 IN IP4 10.10.0.8
    s=Phone-Call c=IN IP4 10.10.0.8
    t=0 0
    m=audio 6000 RTP/AVP 0 8 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    <------------->
    — (14 headers 12 lines) –

  • It found pstn-4444 using 10.10.0.8:5060 – if the request always comes from the same IP address and port it has no other way built in to differentiate between the two except by matching based on username in the ‘From’ header.

  • Call comes from same IP address always. To comes form Audiocode:

    <--- SIP read from UDP:10.10.0.8:5060 --->
    INVITE sip:4@10.10.0.4 SIP/2.0
    Via: SIP/2.0/UDP 10.10.0.8;branch=z9hG4bKac766808844
    Max-Forwards: 70
    From: “Z” ;tag766802762
    To:
    Call-ID: 7668022781522018162620@10.10.0.8
    CSeq: 1 INVITE
    Contact:

    Contact: “sip:pstn-4444”

    And it found in sip.conf only:
    Found peer ‘pstn-9998’ for ‘7804715665’ from 10.10.0.8:5060

    Is perhaps the name effected by the special character “-” (dash) that is why it only matches “pstn” and take the first one it found. Will it make a difference if I rename the port to pstn_4444 in configuration files.

  • Thelma

    sip show peers Name/username Host Dyn Forcerport Comedia ACL Port Status Description
    pstn-4444/voice-4444 10.10.0.8 D No No 5060 Unmonitored
    pstn-9998/fax-9998 10.10.0.8 D No No 5060 Unmonitored

  • It didn’t find “pstn-4444 using 10.10.0.8:5060”
    The call came IN from PSTN line on audiocodes equipment to FXO port that is labelled “pstn-4444” so asterisk reported as such. And I think asterisk suppose to lookup this label in sip.conf to the registered entry but instead selected pstn-9998 entry; I don’t know why.

    If the call came IN on pstn-4444
    and sip.conf has two entries:
    [pstn-4444]
    [pstn-9998]

    Why it can not distinguish between the two of them correctly?

  • Le 16/02/2018 à 05:30, thelma@sys-concept.com a écrit :
    If your device supports SIP authentication, you can try to turn on the
    “match_auth_username” parameter in sip.conf. It is said to be experimental but has always worked well for me.

  • Hello Thelma,

    Friday, February 16, 2018, 2:16:02 AM, you wrote:

    If the type=friend then it matches on IP Address and Port Number, not the user name. It will then use the first entry in the sip.conf – it does not take any notice of the name. If you change the order that the two entries appear, all the calls will appear to come from [pstn-9998]
    even if they come from [pstn-4444].

    I used to set user=peer, which solved the problem for me, but I now direct all the calls to a single context in extensions.conf and then send them to their own contexts based on the DNID.

  • Thanks for the input. I’ve tried “match_auth_username” parameter in sip.conf it didn’t work. but the above entry needs to be enable in sip.conf to avoid “user mismatch” error

    Calls are coming on “pstn-4444” from Audiocodes FXO but sip.conf recognizes it as “pstn-9998”

    But adding to sip.conf relevant entry in my case [pstn-4444] and [pstn-9998]
    “user=peer”

    SOLVED the problem. Now command line is showing correctly:
    calls coming from pstn-4444 are showing on command line as “pstn-4444”

    Thanks to Julian Beach for the hint!


    Thelma.