Cisco 7941G gets a "Registration rejected"

It’s specified, not negotiated.

No, I meant the reception port on the destination peer not the reception port on the Asterisk server.

The IP and port are not negotiated, they are declared.

I make a call from my Yealink the INVITE will contain the SDP for my device. The media IP and RTP port will be presented to Asterisk (in this case) and in the 200 OK reply from Asterisk my Yealink will be told what IP/port to use for RTP. Now in cases where Asterisk will accept Early Media, the SDP will be part of the 183 Early Media reply. The only thing negotiated is the codecs during this.

You can even be fancy, the early media could come from one source and when the 200 OK is sent and the actual call is setup, the call media can be a different source.

You don’t have to be politically correct when discussing a computer protocol, LOL.

A declaration IS a negotiation. It’s an aggressive negotiation, you know, like with a lightsaber… :wink:

" in the 200 OK reply from Asterisk my Yealink will be told what IP/port to use for RTP."

which it will then use even if it’s rtp port range configuration does not include that port number. Which is the same thing as what I said - which is that setting an rtp port range in the phone does not make the phone - the Yealink - refuse the rtp just because the port Asterisk tells it to use is outside of whatever range is specified in it’s config.

It is not. Let me put it another way, the IP/port used for RTP is non-negotiable. There is zero negotiation involved with that. The codecs can be negotiated but that is it.

Oh I see your problem here. The RTP port settings in the phone are for the phone it has no bearing on the RTP used by the SIP server or PBX it is connecting to. As I pointed out earlier, not every phone/device has an RTP Range setting but they do have RTP Port setting, which is the starting port to use for RTP.

Using the 7941G as the example, it has a range from 16384-32766 which means two things: 1) The phone will pick two ports from that range to listen for RTP on/gather stats for that call for each call it has. 2) It has 16382 ports to select from meaning it can support 8191 calls. An impossible amount of calls to have going on for a phone that supports 2 lines.

Math check, that should be 16383 so how are replies (RTCP) to 32766 routed ?

You are viewing the 16384-32766 range as some kind of filter and it isn’t, it’s a directive telling the phone what the allowable ports are to use when sending an rtp packet. If the end of the port range is, for example, 20000 (what Asterisk uses) then it could in theory send an RTP udp packet with a source port of 20000 but then it would follow it with an rtcp packet with a source port of 20001 since that would be implied.

Or the programmer could simply have written the code to look at the directive and if the adjacent +1 port used for rtcp wasn’t in the permitted list, subtracted 1 from the proposed source port number.

No way to know what’s going on in the code inside the phone.

Hello Ted,

I’ve tried calling the phone with diffrent softphone, but i still got the same result.
But as i said, the phone appears as offline to asterisk, so thats why i get forwarded to voicemail every time.

Kind regards,
Mr. Rüdiger

I never once said that.

I wasn’t replying to you I was replying to dicko

Mathis,

Still need to know the version number of the FreePBX server you are using.

Did you try the force_rport command in pjsip.endpoint_custom_post.conf I suggested?

Remember to keep a close eye on the “intrusion detection” in the system admin module. On boot the phone will attempt to register once. If there’s any mistake like a bad password then sometimes the intrusion detection will block the phone. If that happens then the phone won’t continue to attempt to register. LATER models of Cisco phones WILL continue to attempt to register - so if Intrusion Detection has blocked them, and you correct the problem and unblock the IP of the phone - they will almost immediately register. But the firmware in this model does not appear to do that - it will just continue displaying the “registering” message forever and not make any attempt to register. You have to power cycle the phone.

Note also that with the latest 9x version of Firmware, Cisco made it impossible to send a remote reboot command to the phone. With earlier versions you could SSH into the phone and issue the reboot command.

You posted your SEPMAC 9 days ago. The following is the SEPMAC file I am using with my 7961G which registers in perfectly to chan_pjsip. My phone has a Cisco 7914 “outrigger” sidecar on it so my SEPMAC has more button definitions in it than a normal 7961 but otherwise it’s similar. The firmware I am using on my phone is:

SIP41.9-2-1S.loads

The firmware I am using on my sidecar is:

S00105000400.SBN

root@mail:/tftpboot # cat  SEP001F6C81328D.cnf.xml.CP7961-plus-7914-sidecar
<?xml version="1.0" encoding="UTF-8"?>
<device>
    <fullConfig>true</fullConfig>
    <deviceProtocol>SIP</deviceProtocol>
    <ipAddressMode>0</ipAddressMode>
    <sshUserId>cisco</sshUserId>
    <sshPassword>cisco</sshPassword>
    <devicePool>
        <dateTimeSetting>
            <dateTemplate>M/D/YA</dateTemplate>
            <timeZone>Pacific Standard/Daylight Time</timeZone>
                <ntps>
                    <ntp>
                        <name>172.16.1.1</name>
                        <ntpMode>unicast</ntpMode>
                    </ntp>
                </ntps>
        </dateTimeSetting>
        <callManagerGroup>
            <members>
                <member priority="0">
                    <callManager>
                        <name>172.16.1.16</name>
                        <description>FreePBX</description>
                        <ports>
                            <ethernetPhonePort>2000</ethernetPhonePort>
                            <sipPort>5060</sipPort>
                            <securedSipPort>5061</securedSipPort>
                        </ports>
                        <processNodeName>172.16.1.16</processNodeName>
                    </callManager>
                </member>
            </members>
        </callManagerGroup>
        <connectionMonitorDuration>120</connectionMonitorDuration>
    </devicePool>
    <commonProfile>
        <phonePassword>cisco</phonePassword>
        <backgroundImageAccess>true</backgroundImageAccess>
        <callLogBlfEnabled>1</callLogBlfEnabled>
    </commonProfile>
    <loadInformation model="IP Phone 7961">SIP41.9-2-1S</loadInformation>

    <addOnModules>
        <addOnModule idx="1">
        <loadInformation model="Addon 7914">S00105000400</loadInformation>
        </addOnModule>
    </addOnModules>

    <vendorConfig>
        <disableSpeaker>false</disableSpeaker>
        <disableSpeakerAndHeadset>false</disableSpeakerAndHeadset>
        <pcPort>0</pcPort>
        <settingsAccess>1</settingsAccess>
        <garp>0</garp>
        <voiceVlanAccess>0</voiceVlanAccess>
        <g722CodecSupport>2</g722CodecSupport>
        <handsetWidebandEnable>1</handsetWidebandEnable>
        <headsetWidebandEnable>0</headsetWidebandEnable>
        <headsetWidebandUIControl>0</headsetWidebandUIControl>
        <handsetWidebandUIControl>0</handsetWidebandUIControl>
        <videoCapability>0</videoCapability>
        <autoSelectLineEnable>0</autoSelectLineEnable>
        <daysDisplayNotActive></daysDisplayNotActive>
        <displayOnTime></displayOnTime>
        <displayOnDuration></displayOnDuration>
        <displayIdleTimeout>00:05</displayIdleTimeout>
        <webAccess>0</webAccess>
        <spanToPCPort>0</spanToPCPort>
        <loggingDisplay>1</loggingDisplay>
        <displayOnWhenIncomingCall>1</displayOnWhenIncomingCall>
        <loadServer></loadServer>
        <sshAccess>0</sshAccess>
        <sshPort>22</sshPort>
    </vendorConfig>
    <userLocale>
        <name>English_United_States</name>
        <uid>1</uid>
        <langCode>en_US</langCode>
        <version>1.0.0.0-1</version>
        <winCharSet>utf-8</winCharSet>
    </userLocale>
    <networkLocale>United_States</networkLocale>
    <networkLocaleInfo>
        <name>United_States</name>
        <version>1.0.0.0-1</version>
    </networkLocaleInfo>
    <deviceSecurityMode>1</deviceSecurityMode>
    <authenticationURL></authenticationURL>
    <directory></directory>
    <idleTimeout>0</idleTimeout>
    <idleURL></idleURL>
    <informationURL></informationURL>
    <messagesURL></messagesURL>
    <proxyServerURL></proxyServerURL>
    <servicesURL></servicesURL>
    <dscpForSCCPPhoneConfig>96</dscpForSCCPPhoneConfig>
    <dscpForSCCPPhoneServices>0</dscpForSCCPPhoneServices>
    <dscpForCm2Dvce>96</dscpForCm2Dvce>
    <transportLayerProtocol>1</transportLayerProtocol>
    <dndCallAlert>5</dndCallAlert>
    <capfAuthMode>0</capfAuthMode>
    <capfList>
        <capf>
            <phonePort>3804</phonePort>
        </capf>
    </capfList>
    <certHash></certHash>
    <encrConfig>false</encrConfig>
    <sipProfile>
        <sipProxies>
            <backupProxy></backupProxy>
            <backupProxyPort></backupProxyPort>
            <emergencyProxy></emergencyProxy>
            <emergencyProxyPort></emergencyProxyPort>
            <outboundProxy></outboundProxy>
            <outboundProxyPort></outboundProxyPort>
            <registerWithProxy>true</registerWithProxy>
        </sipProxies>
        <sipCallFeatures>
            <cnfJoinEnabled>true</cnfJoinEnabled>
            <callForwardURI>x-cisco-serviceuri-cfwdall</callForwardURI>
            <callPickupURI>x-cisco-serviceuri-pickup</callPickupURI>
            <callPickupListURI>x-cisco-serviceuri-opickup</callPickupListURI>
            <callPickupGroupURI>x-cisco-serviceuri-gpickup</callPickupGroupURI>
            <meetMeServiceURI>x-cisco-serviceuri-meetme</meetMeServiceURI>
            <abbreviatedDialURI>x-cisco-serviceuri-abbrdial</abbreviatedDialURI>
            <rfc2543Hold>false</rfc2543Hold>
            <callHoldRingback>2</callHoldRingback>
            <localCfwdEnable>true</localCfwdEnable>
            <semiAttendedTransfer>true</semiAttendedTransfer>
            <anonymousCallBlock>2</anonymousCallBlock>
            <callerIdBlocking>2</callerIdBlocking>
            <dndControl>0</dndControl>
            <remoteCcEnable>true</remoteCcEnable>
        </sipCallFeatures>
        <sipStack>
            <sipInviteRetx>6</sipInviteRetx>
            <sipRetx>10</sipRetx>
            <timerInviteExpires>180</timerInviteExpires>
            <timerRegisterExpires>3600</timerRegisterExpires>
            <timerRegisterDelta>5</timerRegisterDelta>
            <timerKeepAliveExpires>120</timerKeepAliveExpires>
            <timerSubscribeExpires>120</timerSubscribeExpires>
            <timerSubscribeDelta>5</timerSubscribeDelta>
            <timerT1>500</timerT1>
            <timerT2>4000</timerT2>
            <maxRedirects>70</maxRedirects>
            <remotePartyID>false</remotePartyID>
            <userInfo>None</userInfo>
        </sipStack>
        <autoAnswerTimer>0</autoAnswerTimer>
        <autoAnswerAltBehavior>false</autoAnswerAltBehavior>
        <autoAnswerOverride>true</autoAnswerOverride>
        <transferOnhookEnabled>true</transferOnhookEnabled>
        <enableVad>false</enableVad>
        <preferredCodec>g711ulaw</preferredCodec>
        <dtmfAvtPayload>101</dtmfAvtPayload>
        <dtmfDbLevel>3</dtmfDbLevel>
        <dtmfOutofBand>avt</dtmfOutofBand>
        <alwaysUsePrimeLine>false</alwaysUsePrimeLine>
        <alwaysUsePrimeLineVoiceMail>false</alwaysUsePrimeLineVoiceMail>
        <kpml>3</kpml>
        <stutterMsgWaiting>0</stutterMsgWaiting>
        <callStats>false</callStats>
        <silentPeriodBetweenCallWaitingBursts>10</silentPeriodBetweenCallWaitingBursts>
        <disableLocalSpeedDialConfig>false</disableLocalSpeedDialConfig>
        <startMediaPort>16384</startMediaPort>
        <stopMediaPort>32766</stopMediaPort>
        <voipControlPort>5060</voipControlPort>
        <dscpForAudio>184</dscpForAudio>
        <ringSettingBusyStationPolicy>0</ringSettingBusyStationPolicy>
        <dialTemplate>dialplan.xml</dialTemplate>
        <softKeyFile>softkeys.xml</softKeyFile>
        <phoneLabel>771</phoneLabel>
        <natEnabled>true</natEnabled>
        <natAddress></natAddress>

        <sipLines>
            <line button="1">
                <featureID>9</featureID>
                <featureLabel>771 Line 1</featureLabel>
                <name>771</name>
                <displayName>771</displayName>
                <contact>771</contact>
                <proxy>USECALLMANAGER</proxy>
                <port>5060</port>
                <autoAnswer>
                    <autoAnswerEnabled>0</autoAnswerEnabled>
                </autoAnswer>
                <callWaiting>1</callWaiting>
                <authName>771</authName>
                <authPassword>abb6bfed</authPassword>
                <sharedLine>false</sharedLine>
                <messageWaitingLampPolicy>3</messageWaitingLampPolicy>
                <messagesNumber>*98</messagesNumber>
                <ringSettingIdle>4</ringSettingIdle>
                <ringSettingActive>5</ringSettingActive>
                <forwardCallInfoDisplay>
                    <callerName>true</callerName>
                    <callerNumber>false</callerNumber>
                    <redirectedNumber>false</redirectedNumber>
                    <dialedNumber>true</dialedNumber>
                </forwardCallInfoDisplay>
            </line>

      <line button="2">
        <featureID>21</featureID>
        <featureLabel>801 Office</featureLabel>
        <speedDialNumber>801</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

      <line button="3">
        <featureID>21</featureID>
        <featureLabel>802 Office Sec</featureLabel>
        <speedDialNumber>802</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

      <line button="4">
        <featureID>21</featureID>
        <featureLabel>803 Laptop</featureLabel>
        <speedDialNumber>803</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

      <line button="5">
        <featureID>21</featureID>
        <featureLabel>805 PCS</featureLabel>
        <speedDialNumber>805</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

      <line button="6">
        <featureID>21</featureID>
        <featureLabel>806 Sales</featureLabel>
        <speedDialNumber>806</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

      <line button="7">
        <featureID>21</featureID>
        <featureLabel>821 Master BR</featureLabel>
        <speedDialNumber>821</speedDialNumber>
        <featureOptionMask>1</featureOptionMask>
      </line>

            </sipLines>
    </sipProfile>

</device>
root@mail:/tftpboot #

Please note I have CAREFULLY gone through my SEPMAC and replaced all tabs with spaces and corrected all the indentation errors. I don’t think the phone cares about that but poor indentation in an XML file makes it harder to catch errors.

Some POSSIBLE issues in your SEPMAC file are:

  1. You are defining UTF-8 at the top of yours and then you use the directive WInCharSet iso-8859-1 which is inconsistent. The phone ignores the UTF-8 at the top so it does not matter but I would test with or without the iso-8859-1 to see if it makes the phone change anything at all in it’s display.

  2. Make sure in your tftp server logs that the phone is indeed properly loading the language files for Danish and those files are present in the tftp server

  3. Your date template may not be right - this phone does not support all permutations of date template. You should probably use D/M/YA

  4. If you have an internal NTP server, use that.

  5. You have a duplicate listing of common Profile, one at the end and one in the middle

  6. You have videocapability defined as 1 but this phone is not a videophone so that should be 0

  7. daysdisplaynotactive appears to be ignored by this phone as do all the display parameters

  8. your preferred codec is g711alaw although the phone’s datasheets seem to indicate it only supports g711ulaw although when I was testing either directive worked

  9. you have a public IP in nataddress directive which should be blank unless you are accessing a freepbx server on the internet

Last and most important - when the phone first boots it reads in the SEPMAC file and then writes the parameters to it’s nvram. If you then later make a change in the SEPMAC file that the phone cannot parse or does not like - then the phone will SILENTLY ignore the SEPMAC file and use the nvram settings.

Which means that unless you make a trivial change - add or remove a line button or change the name of Line to Linje or vis-versa, some visible change to the phone’s display - you won’t know for certain if the phone is even loading in any changes in your SEPMAC

I found this very frustrating when testing SEPMACs. It would be far better if the phone simply issued an “error in provisioning file” on the display but it doesn’t.

The top problems in getting a phone to provision:

incorrect username/extension name/number
incorrect password
intrusion detection blocking the phone
Not setting the proper allow IP subnet range in SIP’s configuration on FreePBX

Well if that what you think, I’m pretty sure what a range is mathematically and well understand the modulus operator and the RTP protocol, but who am I to disagree with your thinking?

I am also not the one who boldly posted

you may want to narrow this range down to say 16384 and 16390, and then map UDP ports 16384 through to 16390 to your phone from the outside. This will allow your phone to receive inbound RTP voice streams.

because it is flawed in math and comprehension , RTCP replies to 16390 on 16391 ( which comes from the far end) would not get back to Asterisk. further more, 3 and a half channels of media is useful for what diagnoses?

dicko, as I made it clear the phone (and, likely, Asterisk) is obviously not using the non-mod-2 ranges of 10000-20000 and 16384-32766 as a directive to block incoming rtp that is not within that range, but rather as a directive to restrict the starting port it will select for rtp streams (not rtcp). And in that case, the range does not need to be mod 2 since it would only determine the source port for rtp - because as you point out, the port for rtcp is always +1. The fact it works proves this. The code is obviously ignoring that directive for rtcp.

If the phone and asterisk was refusing to accept rtp outside of it’s defined ranges - nothing would work at all since as Tom pointed out lots of things have different “media port range” settings yet all clearly work together.

These directives are antiques left over from an era where NAT devices were not RTP-aware and all you could do was port forward 5060 and some rtp range you defined for your phone and your Asterisk system and add your “public” IP address into various other configurations in your phone and PBX and cross your fingers and hoped it all worked. Which often, it didn’t.

That is why I told the OP to remove his public IP address from his phone’s config. Now, if he’s using public SIP trunks he might possibly be in a situation where he needs that. But he needs to get the phone registered in, and he needs to get extension-to-extension calling working, first. And in any case he likely has a modern router that knows about SIP so even if he is using SIP trunks the NAT in the router will handle any rewriting needed.

Unlike you I don’t see no value in discussing all this. Even some modern SIP phones manufactured a month ago have these antique configuration directives in them. I certainly wouldn’t go buy hundreds of old 7941Gs for a new installation (someone else might, lol) but it’s useful to know that you could walk into a company like Dunder Mifflin Paper that had 50-100 of these phones on people’s desks and drop in a brand new FreePBX system and support them all with chan_pjsip.

Again you miss the point, if a non mod 2 range is blindly chosen for RTP range and the same one used for 'unblockin’or ‘routing’ back to Asterisk a number of calls will have problems, and the smaller that range is the higher proportion, there are no idiot checks in Asterisk to correct a non mod2 range so choosing a mod2 range for asterisks makes sense and confuses no-one.

One in 5000 calls with problems will hardly be noticed, but on in 3 almost certainly would, so I pointed it out.

@mjr55 seems that your question is lost in the noise. I recommend opening a new thread with specific questions and would ask that answerers give specific answers… I’ll be glad to help as I can but this thread is way off track.

4 Likes

That is correct but it’s clear that the phone is ignoring the specified range for any kind of blocking of incoming rtp or rtcp and only using it to determine the source port for outgoing rtp UDP packets (and also ignoring it for the source port for outgoing rtcp UDP packets since they are always +1 higher port than the rtp stream)

I don’t know what Asterisk is doing with the rtp range. Someone probably should look at the code or maybe a developer could answer.

I also wholeheartedly agree that using a mod2 range would be better then 10000-20000 because anyone looking at the config who understood that only 10001-20000 or 10000-19999 or some such was mod2 and was wondering if it was being used to erect a block, would not be worrying about it. But not for any technical reason, more a human reason.

Possibly the Asterisk developers did not want to explain this kind of discussion every time someone asked “why is the range 10000-19999 instead of a nice round number like 20000” on the Asterisk forum and since it didn’t matter just set it at that so as not to provoke a support discussion?

It’s off track because using the same firmware and setup he’s using I can’t duplicate the error and the phone works. :frowning:

New thread is created: Calls to Cisco 7941 go to voicemail

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.