In my case i have installed asterisk through yum so recompiling will not work for me so i search yum repo for chan_sip.so
[root@MTL-189551 asterisk]# yum whatprovides */chan_sip.so
Note it is very necessary to install the correct version of the module i have installed Asterisk 13.17.2 so it is very necessary to install same module
In yum search result i found this version
asterisk-sip-13.17.2-vici.el7.centos.x86_64 : Legacy SIP channel driver for
Asterisk
Repo : goautodial-updates
Matched from:
Filename : /usr/lib64/asterisk/modules/chan_sip.so
[root@MTL-189551 asterisk]# yum install asterisk-sip-13.17.2
Before restart asterisk add below line
[root@MTL-189551 ~]# vim /etc/asterisk/modules.conf
Find the below line in file and uncomment or add
require = chan_sip.so
After this restart your asterisk and connect to asterisk console and check whether module is loaded or not
MTL-189551*CLI> module show like chan_sip.so
Module Description Use Count Status Support Level
chan_sip.so Session Initiation Protocol (SIP) 0 Running core
1 modules loaded
MTL-189551*CLI>