[asterisk-users] iaxpeers from Realtime

asterisk at mazone.info asterisk at mazone.info
Tue Nov 20 12:17:11 CST 2007


Hello asterisk users, here is a little problem pulling out iax peers from
real time database

I have the following peer configured in my database



mysql> select
name,username,secret,type,context,host,disallow,allow,defaultip,deny,permit,
ipaddr,port from iax_users where name='iaxtermination';
+----------------+----------+----------------------------------+------+-----
-----------+--------------+----------+---------------+-----------+------+---
-----+--------+------+
| name           | username | secret                           | type |
context        | host         | disallow | allow         | defaultip | deny
| permit | ipaddr | port |
+----------------+----------+----------------------------------+------+-----
-----------+--------------+----------+---------------+-----------+------+---
-----+--------+------+
| iaxtermination | NULL     | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   | peer |
iaxtermination | 195.66.85.55 | all      | gsm;alaw;ulaw | NULL      | NULL
| NULL   | NULL   |    0 | 
+----------------+----------+----------------------------------+------+-----
-----------+--------------+----------+---------------+-----------+------+---
-----+--------+------+

And the extension to use it is..

mysql> select * from extensions_table where context='iaxtermination'  order
by context,exten,priority;
+-----+----------------+-------+----------+------+--------------------------
--------------+
| id  | context        | exten | priority | app  | appdata
|
+-----+----------------+-------+----------+------+--------------------------
--------------+
| 719 | iaxtermination | _*92. |        1 | Dial |
IAX2/5640 at iaxtermination/011${EXTEN:3} | 
+-----+----------------+-------+----------+------+--------------------------
--------------+


But whe I try to place the call I ge some wiered messages saying doing -->
lookup for '195.66.85.55' <---

Here is de details output....


    -- Executing Dial("SIP/FJST1001-087b8138",
"IAX2/5640 at iaxtermination/01115141234123")
    -- doing lookup for '195.66.85.55'
    -- doing lookup for '195.66.85.55'
    -- Called 5640 at iaxtermination/01115141234123
    -- doing lookup for '195.66.85.55'
    -- Hungup 'IAX2/iaxtermination-2'
  == Spawn extension (autorized, *9215141234123, 1) exited non-zero on
'SIP/FJST1001-087b8138'
    -- doing lookup for '195.66.85.55'


I know iax_users and sip_users on realtime are suposte to be dynamic, on an
incomming request, ARA will look on to the database and pull the information
necessary to authenticate the user and let them place calls, etc, and then
after hangup ARA will delete/remove the information about that particular
user, but this is for incomming requests, (users,friends) but what about
peers ?

if I issue a iax2 show peers command on the console, ther is absolutly no
informtion about the peer, see output...

lnxca*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status

0 iax2 peers [0 online, 0 offline, 0 unmonitored]



A little test I did wast configuring the peer static and once the iax was
reloaded I was able to see peers information in the console and able to
successfull place a call 

/etc/iax.conf

[iaxtermination]
type = peer
host = 195.66.85.55
secret = xxxxxxxxxxxxxxxxxxxxxxxxx
auth = md5
notransfer = yes
context = a2billing
disallow=all
allow=gsm
allow=alaw
allow=ulaw


lnxca*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status

iaxtermination   195.66.85.55    (S)  255.255.255.255  4569
Unmonitored
1 iax2 peers [0 online, 0 offline, 1 unmonitored]


    -- Executing Dial("SIP/FJST1001-087b8138",
"IAX2/5640 at iaxtermination/01115146421231234")
    -- Called 5640 at iaxtermination/01115146421231234
    -- Call accepted by 195.66.85.55 (format ulaw)
    -- Format for call is ulaw
    -- IAX2/iaxtermination-7 is ringing
    -- Hungup 'IAX2/iaxtermination-7'



Is there something missing on my peer's config on the iax_users table? here
is the structure for the iax_users table

mysql> describe iax_users; 
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int(11)      | NO   | PRI | NULL    | auto_increment | 
| name        | varchar(30)  | NO   | UNI |         |                | 
| username    | varchar(30)  | YES  |     | NULL    |                | 
| type        | varchar(6)   | NO   |     |         |                | 
| secret      | varchar(50)  | YES  |     | NULL    |                | 
| md5secret   | varchar(32)  | YES  |     | NULL    |                | 
| dbsecret    | varchar(100) | YES  |     | NULL    |                | 
| notransfer  | varchar(10)  | YES  |     | NULL    |                | 
| inkeys      | varchar(100) | YES  |     | NULL    |                | 
| auth        | varchar(100) | YES  |     | NULL    |                | 
| accountcode | varchar(100) | YES  |     | NULL    |                | 
| amaflags    | varchar(100) | YES  |     | NULL    |                | 
| callerid    | varchar(100) | YES  |     | NULL    |                | 
| context     | varchar(100) | YES  |     | NULL    |                | 
| defaultip   | varchar(15)  | YES  |     | NULL    |                | 
| host        | varchar(31)  | NO   |     | dynamic |                | 
| language    | varchar(5)   | YES  |     | NULL    |                | 
| mailbox     | varchar(50)  | YES  |     | NULL    |                | 
| deny        | varchar(95)  | YES  |     | NULL    |                | 
| permit      | varchar(95)  | YES  |     | NULL    |                | 
| qualify     | varchar(4)   | YES  |     | NULL    |                | 
| disallow    | varchar(100) | YES  |     | NULL    |                | 
| allow       | varchar(100) | YES  |     | NULL    |                | 
| ipaddr      | varchar(15)  | YES  |     | NULL    |                | 
| port        | int(11)      | YES  |     | 0       |                | 
| regseconds  | int(11)      | YES  |     | 0       |                | 
+-------------+--------------+------+-----+---------+----------------+




More information about the asterisk-users mailing list