[Asterisk-Users] Problem with realtime SIP

vinod malani vinod.malani at gmail.com
Thu Aug 4 23:55:17 MST 2005


Hi Guys,

We have just set up Asterisk 1.0.7 with (CVS Head) for a realtime
enviorment using MySQL & Asterisk Addons.

I have populated the "sip_buddies" table with the same information
that is came from our sip.conf, however registration seems to fail for
the
softphone we have set up.

Does anyone have any idea what we have done? Asterisk Console Message
when SIP try to login
Aug  5 11:52:31 NOTICE[8941]: chan_sip.c:9518 handle_request_register:
Registration from 'vinodmalani <sip:400 at 192.168.0.34>' failed for
'192.168.0.112 <http://192.168.0.112>'

*CLI> dial 400 at mycontext 
*CLI>     -- Executing Dial("OSS/dsp", "SIP/400")
Aug  5 12:24:06 WARNING[9008]: chan_sip.c:1780 create_addr: No such host: 400
Destroying call '062eb8b7544d47895a99c70013100b94 at 127.0.0.1'
Aug  5 12:24:06 NOTICE[9008]: app_dial.c:1091 dial_exec_full: Unable
to create channel of type 'SIP' (cause 3 - No route to destination)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing Answer("OSS/dsp", "Ringing")
 << Console call has been answered >>

<-- SIP read from 192.168.0.112:5060 <http://192.168.0.112:5060>:

--- (0 headers 0 lines) Nat keepalive ---
Aug  5 12:24:19 WARNING[9008]: pbx.c:2334 __ast_pbx_run: Timeout, but
no rule 't' in context 'mycontext'
 << Hangup on console >>

SIP DEBUG MESSAGE ( for reference )
<-- SIP read from 192.168.0.112:5060 <http://192.168.0.112:5060>:
REGISTER sip:192.168.0.34 <http://192.168.0.34> SIP/2.0
Via: SIP/2.0/UDP 192.168.0.112:5060
<http://192.168.0.112:5060>;rport;branch=z9hG4bK46E3233E27ED47DABD0B778CE4D37C87
From: vinodmalani <sip:400 at 192.168.0.34>;tag=1345370993
To: vinodmalani <sip:400 at 192.168.0.34>
Contact: "vinodmalani" <sip:400 at 192.168.0.112:5060>
Call-ID: E862870D99084D8EAE98225AB0774939 at 192.168.0.34
CSeq: 55251 REGISTER
Expires: 1800
Max-Forwards: 70
User-Agent: X-Lite release 1103m
Content-Length: 0


--- (11 headers 0 lines)---
Using latest request as basis request
Sending to 192.168.0.112 <http://192.168.0.112> : 5060 (NAT)
Transmitting (NAT) to 192.168.0.112:5060 <http://192.168.0.112:5060>:
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.0.112:5060
<http://192.168.0.112:5060>;branch=z9hG4bK46E3233E27ED47DABD0B778CE4D37C87;received=192.168.0.112
<http://192.168.0.112>;rport=5060
From: vinodmalani <sip:400 at 192.168.0.34>;tag=1345370993
To: vinodmalani <sip:400 at 192.168.0.34>;tag=as740959f2
Call-ID: E862870D99084D8EAE98225AB0774939 at 192.168.0.34
CSeq: 55251 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY
Contact: <sip:400 at 192.168.0.34>
Content-Length: 0


---
Aug  5 12:24:39 NOTICE[9008]: chan_sip.c:9518 handle_request_register:
Registration from 'vinodmalani <sip:400 at 192.168.0.34>' failed for
'192.168.0.112 <http://192.168.0.112>'
Scheduling destruction of call
'E862870D99084D8EAE98225AB0774939 at 192.168.0.34' in 15000 ms
Destroying call 'E862870D99084D8EAE98225AB0774939 at 192.168.0.34'

<-- SIP read from 192.168.0.112:5060 <http://192.168.0.112:5060>:


--- (0 headers 0 lines) Nat keepalive ---

i am describing entire files that we have used

extconfig.conf :- content
[settings]
sippeers => mysql,cdr,sip_buddies
sipusers => mysql,cdr,sip_buddies
;sipfriends => mysql,cdr,sip_buddies
realextension => mysql,cdr,extensions_table 

extensions.conf : content
[general]
static=no / yes  ( tried with both)
writeprotect=yes / no  ( tried with both)

[mycontext]
switch => Realtime/mycontext at realextension

res_mysql.conf :- content
[general]
dbhost = 127.0.0.1 <http://127.0.0.1>
dbname = cdr
dbuser = root
dbpass = 
dbport = 3306
dbsock = /tmp/mysql.sock

sip.conf : content
[general]
type=friend
;rtcachefriends = yes
;rtcache=yes
nat=yes
 / no ( tried with both )
( tried with both with DB parameters & without it, but same result of failure )
localnet=192.168.0.0/255.255.255.0 <http://192.168.0.0/255.255.255.0>
dbhost = 127.0.0.1 <http://127.0.0.1>
dbname = cdr
dbuser = root
dbpass = 
dbport = 3306
dbsock = /tmp/mysql.sock

Modules.conf
[modules]
autoload=yes
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
noload => app_intercom.so
load => chan_modem.so
load => res_musiconhold.so
noload => chan_alsa.so
noload => res_odbc.so
noload => libodbc.so
noload => pbx_wilcalu.so
noload =>  cdr_odbc.so
load => cdr_addon_mysql.so
load => chan_oss.so

[global]
chan_modem.so=yes

these  modules
1. noload => chan_alsa.so
2. noload => res_odbc.so
3. noload => libodbc.so
4. noload => pbx_wilcalu.so
5. noload =>  cdr_odbc.so
   gave us problem when we updated CVS so we decided to block them...
but even after that asterisk was wroking fine with sip.conf &
extensions.conf wtih static entries



sip_buddeis table of mysql  :- content
+---+------+------------+---------+----------+--------------------+------------+----------+----------+---------+---------+-----------+--------+---------+---------+--------+----------+----+-------+-----+-----+------------+-----+--------+------------+-----------+---------------+--------+-------+---------+---------+------------------------+------------+-----------+-------+---------+---------------+
| id| name | accountcode| amaflags| callgroup| callerid           |
canreinvite| context  | defaultip| dtmfmode| fromuser| fromdomain|
host   | insecure| language| mailbox| md5secret| nat| permit| deny|
mask| pickupgroup| port| qualify| restrictcid| rtptimeout|
rtpholdtimeout| secret | type  | username| disallow| allow            
     | musiconhold| regseconds| ipaddr| regexten| cancallforward|
+---+------+------------+---------+----------+--------------------+------------+----------+----------+---------+---------+-----------+--------+---------+---------+--------+----------+----+-------+-----+-----+------------+-----+--------+------------+-----------+---------------+--------+-------+---------+---------+------------------------+------------+-----------+-------+---------+---------------+
| 2 | vinod|            |         |          | "vinodmalani" <400>|
yes        | mycontext|          | rfc2833 |         |           |
dynamic|         |   |        |          | no |       |     |     |   
        |     |        |         |           |               |
testing| friend| 400     | all     | g729;ilbc;gsm;ulaw;alaw|         
  | 0 | ip-addr of sip client ( tried with ip & null) | 400| yes|
+---+------+------------+---------+----------+--------------------+------------+----------+----------+---------+---------+-----------+--------+---------+---------+--------+----------+----+-------+-----+-----+------------+-----+--------+------------+-----------+---------------+--------+-------+---------+---------+------------------------+------------+-----------+-------+---------+---------------+

extensions_table of mysl :- content
+---+----------+------+---------+-------+--------+
| id| context  | exten| priority| app   | appdata|
+---+----------+------+---------+-------+--------+
| 3 | mycontext| 400  | 2       | Dial  | SIP/400|
| 4 | mycontext| 400  | 1       | Answer| Ringing|
+---+----------+------+---------+-------+--------+


CLI > realtime mysql status
Connected to cdr at 127.0.0.1, port 3306 with username root for 9 seconds.

*CLI> realtime load sippeers name vinod
                   Column Name  Column Value
          --------------------  --------------------
                            id  2
                          name  vinod
                      callerid  "vinodmalani" <400>
                   canreinvite  yes
                       context  mycontext
                      dtmfmode  rfc2833
                          host  dynamic
                           nat  no
                        secret  testing
                          type  friend
                      username  400
                      disallow  all
                         allow  g729
                         allow  ilbc
                         allow  gsm
                         allow  ulaw
                         allow  alaw
                    regseconds  0
                      regexten  400
                cancallforward  yes

but CLI > sip show users & sip show peers does't give us any result

Asterik Console Message : when reloaded

Binding sippeers to mysql/cdr/sip_buddies
Binding sipusers to mysql/cdr/sip_buddies
Binding realextensions to mysql/cdr/extensions_table
MySQL Realtime Reloaded

and my cdr table has the records in it..........

its working with static sip.cong file :- contents of it
[400]
reinvite=no
canreinvite=no
disallow=all
allow=ulaw
allow=gsm
dtmfmode=rfc2833
type=friend
host=dynamic
callerid = "vinodmalani" <400>
secret=password
nat=no
qualify = 1000
context = mycontext

but with realtime god bless me. 

Any help very much appreciated.  

Thanks,

vinod malani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050805/874633f7/attachment.htm


More information about the asterisk-users mailing list