News & Reviews
More How-To's & Tips More News
More Reviews Device Configuration Tools
No account yet? Create one
Forgot your Username or Password?

Welcome to the Voxilla VoIP Forum.

Voxilla has been a trusted source for accurate, up-to-date information on the IP Communications industry since 2002. A dedicated staff of reporters and engineers produce feature articles and product reviews to keep industry watchers abreast of the people, companies, and trends driving a fast moving market.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.





Closed Thread
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old September 23rd, 2006, 06:13 PM
DGrant303 DGrant303 is offline
Member
 
Join Date: May 2006
Posts: 44
DGrant303
Talking Asterisk CLI Database PUT question..

Hi -

I have Asterisk@Home 2.8 set up with VoipStreet service. I am finding that VoipStreet only supports Caller ID NUMBER ONLY.

I am trying to set up a database and enter number so that when each call is answered, it will look up the phone number in the Asterisk database and display the name as well.

When using Asterisk CLI, I am entering,

database put cidname 3035551212 "John Smith"

BUT when I use the database show cidname, this is the response:

/cidname/3035551212 : John
Verbosity is at least 3

As you can see, it is cutting off the last name and the space between the first and last name.

Any thoughts on how I can correct this???

Thank you,

David
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2 (permalink)  
Old September 24th, 2006, 01:59 AM
chandave chandave is offline
Senior Member
 
Join Date: Jul 2005
Posts: 362
chandave is an unknown quantity at this point
Send a message via MSN to chandave
Default Re: Asterisk CLI Database PUT question..

Strange. I just tried the exact same CLI on both Asterisk v1.2.4 and v1.2.12.1 and neither had the truncation problem:
Code:
ast*CLI> show version
Asterisk 1.2.4 built by root @ asterisk on a i686 running Linux on 2006-09-12 09:18:48 UTC
ast*CLI> set verbose 3
Verbosity is at least 3
ast*CLI> database put cidname 3035551212 "John Smith"
Updated database successfully
ast*CLI> database show cidname 3035551212
/cidname/3035551212                               : John Smith
Code:
athome2*CLI> show version
Asterisk 1.2.12.1 built by root @ athome2 on a i686 running Linux on 2006-09-16 14:09:38 UTC
athome2*CLI> set verbose 3
Verbosity was 5 and is now 3
athome2*CLI> database put cidname 3035551212 "John Smith"
Updated database successfully
athome2*CLI> database show cidname 3035551212
/cidname/3035551212                               : John Smith
See ya...

d.c.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3 (permalink)  
Old September 24th, 2006, 02:56 AM
DGrant303 DGrant303 is offline
Member
 
Join Date: May 2006
Posts: 44
DGrant303
Default Re: Asterisk CLI Database PUT question..

Thanks for the "wealth" of information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4 (permalink)  
Old September 24th, 2006, 06:08 PM
chandave chandave is offline
Senior Member
 
Join Date: Jul 2005
Posts: 362
chandave is an unknown quantity at this point
Send a message via MSN to chandave
Default Re: Asterisk CLI Database PUT question..

You're welcome. And, here's another bit of info for you:

Sarcasm towards thoses that are trying to help you will not encourage others to provide assistance.

I provided you with CLI dumps from two different versions of Asterisk that did not have the same problem your current version of Asterisk has. This means one of two things: 1) You have a buggy version of Asterisk in your A@H v2.8; 2) Operator error.

My CLI dumps provide you with verbatim output indicating exactly how I tried to replicate your problem. But, I did not have the same problem. Your problem statement only provided your interpretation of your events and their results. No verbatim CLI dump was included. Therefore, we cannot rule out operator error.

Additionally, you did not include any info about your configuration besides "A@H v2.8". Is it using MySQL for persistence? Or, are you using the Berkeley DB? If MySQL, have you checked to see what your table entries look like in the DB? Have you turned on MySQL transaction tracking to see what Asterisk might be using as an SQL command to insert the info into the table? Have you tried it with single quotes instead of double quotes? Have you tried to escape out the double quotes while still wrapping the CLI Name with double quotes?

As you can see, your "Wealth" of information about your problem statement resulted in my limited response. I'm not known for my terseness when it comes to providing assistance. Just check out some of my other responses on this forum as well as others (e.g. dslreports.com). But, if I'm given limited crap, I'll regurgitate a limited crap answer.

See ya...

d.c.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5 (permalink)  
Old September 24th, 2006, 08:56 PM
rizsher rizsher is offline
Senior Member
 
Join Date: Jul 2004
Posts: 1,119
rizsher
Default Re: Asterisk CLI Database PUT question..

Chandave,

Not trying to hijack this thread, but, could you please tell me exactly where does the name we assign to a CID appear?. Does it appear as the name of the caller on the phone display, or, in the Call Detail Reports?

In my case, I took a number as it appeats in the 3rd column of FreePBX Call Detail Reports, the Title of the column is "Source", added it to the database using put cidname, get the followign result when I show

Code:
asterisk1*CLI> database show cidname 20105551234
/cidname/20105551234                              : Rizwan Turdff
however, subsequesnt calls from 20105551234 still only show the number, both on the phone and the FreePBX Call Reports STLLL only show 20105551234, "Rizwan Turdff" doesn't show anywhere...

This is the CLI output I get:

Code:
 -- Goto (timeconditions,1,1)
    -- Executing GotoIfTime("SIP/81123456-098df990", "00:10-07:00|*|*|*?ivr-3|s|1") in new stack
    -- Executing Goto("SIP/81123456-098df990", "ext-findmefollow|111|1") in new stack
    -- Goto (ext-findmefollow,111,1)
    -- Executing Macro("SIP/81123456-098df990", "user-callerid|") in new stack
    -- Executing GotoIf("SIP/81123456-098df990", "0?report") in new stack
    -- Executing GotoIf("SIP/81123456-098df990", "0?start") in new stack
    -- Executing Set("SIP/81123456-098df990", "REALCALLERIDNUM=20105551234") in new stack
    -- Executing NoOp("SIP/81123456-098df990", "REALCALLERIDNUM is 20105551234") in new stack
    -- Executing Set("SIP/81123456-098df990", "AMPUSER=") in new stack
    -- Executing AGI("SIP/81123456-098df990", "calleridname.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/calleridname.agi
  calleridname.agi: CALLERID IS: 20105551234
  calleridname.agi: Unable to parse phone number for NPA/NXX/station. Phone number is: 20105551234
    -- AGI Script calleridname.agi completed, returning 0
    -- Executing Set("SIP/81123456-098df990", "AMPUSERCIDNAME=") in new stack
    -- Executing GotoIf("SIP/81123456-098df990", "1?report") in new stack
    -- Goto (macro-user-callerid,s,10)
    -- Executing NoOp("SIP/81123456-098df990", "Using CallerID "20105551234" <20105551234>") in new stack
    -- Executing GotoIf("SIP/81123456-098df990", "0?NEWPREFIX") in new stack
    -- Executing Set("SIP/81123456-098df990", "CALLERID(name)=20105551234") in new stack
    -- Executing Set("SIP/81123456-098df990", "RGPREFIX=") in new stack
    -- Executing Set("SIP/81123456-098df990", "CALLERID(name)=20105551234") in new stack
Following is the macro-user-callerid section of my extensions.conf file:

Code:
[macro-user-callerid]
exten => s,1,GotoIf($["${CHANNEL:0:5}" = "Local"]?report) 
exten => s,n,GotoIf($["${REALCALLERIDNUM:1:2}" != ""]?start)
exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),NoOp(REALCALLERIDNUM is ${REALCALLERIDNUM})
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,AGI(calleridname.agi)
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($["x${AMPUSERCIDNAME:1:2}" = "x"]?report) 
exten => s,n,Set(CALLERID(all)=${AMPUSERCIDNAME} <${AMPUSER}>)
exten => s,n(report),NoOp(Using CallerID ${CALLERID(all)})

; overrides callerid out trunks
; arg1 is trunk
; macro-user-callerid should be called _before_ using this macro

I added exten => s,n,AGI(calleridname.agi) following the steps on the nerdvittles website.

Last edited by rizsher : September 24th, 2006 at 09:33 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old September 24th, 2006, 08:56 PM
  #6 (permalink)  
Old September 25th, 2006, 04:17 AM
chandave chandave is offline
Senior Member
 
Join Date: Jul 2005
Posts: 362
chandave is an unknown quantity at this point
Send a message via MSN to chandave
Default Re: Asterisk CLI Database PUT question..

(Looks like you have a typo in the phone number or someone is purposely prefixing a zero to your NXX...)

The CIDnum Asterisk is getting is:
20105551234
which is not in the format calleridname.agi expects. It expects a 10 digit number so it can parse it out as NPA (3-digits), NXX (3-digits), and STATION (4-digits). That's why you are getting the "Unable to parse phone number for NPA/NXX/station. Phone number is: 20105551234" message.

If you really want it to work, you can add the following between lines 47 and 48:
Code:
elsif ( (length($callerid)==11) && (substr($callerid,3,1)==0) && ($callerid =~ /^(\d{3})(\d{4})(\d{4})$/) ) {
$npa = $1;
$nxx = $2;
$station = $3;
$AGI->verbose("Checking funky zero-prefixed NXX: $npa $nxx $station...\n");
}
So, it would look something like:
Code:
$AGI->verbose("Checking $npa $nxx $station...\n");
}
elsif ( (length($callerid)==11) && (substr($callerid,3,1)==0) && ($callerid =~ /^(\d{3})(\d{4})(\d{4})$/) ) {
......
else {
$AGI->verbose("Unable to parse phone number for NPA/NXX/station. Phone number is: $callerid\n");
exit(0);
}
And to answer your other questions:
Quote:
Originally Posted by rizsher
...could you please tell me exactly where does the name we assign to a CID appear?. Does it appear as the name of the caller on the phone display, or, in the Call Detail Reports?
The CIDName will appear in your CDR (probably in /var/log/asterisk/cdr-csv/Master.csv) in the 5th column as "Real Name <cidnum>". How it appears on the phone is up to your phone...if it even understands CIDName.

See ya...

d.c.

(rizsher or Eric: please move this thread to a new topic if we need to continue it)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7 (permalink)  
Old September 25th, 2006, 10:24 AM
rizsher rizsher is offline
Senior Member
 
Join Date: Jul 2004
Posts: 1,119
rizsher
Default Re: Asterisk CLI Database PUT question..

Chandave, moved my query here.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:



Similar Threads for: Asterisk CLI Database PUT question..
Thread Thread Starter Forum Replies Last Post
log into asterisk CLI as normal user baddah Asterisk Support Forum 5 July 7th, 2006 07:26 PM
[Question] How to put domain name (xx.net) into sip:username gkong Linksys (Sipura) VoIP Support Forum 1 October 11th, 2005 07:11 PM
Access Asterisk database from shellscript digital_storm Asterisk Support Forum 5 May 10th, 2005 09:40 AM
Asterisk & Sipura SPA-2000 loses 3 digits off end of CLI timfhdavidson Asterisk Support Forum 1 January 18th, 2005 07:50 PM
Does Asterisk support MySQL database in v1? achaniotis Asterisk Support Forum 1 December 8th, 2004 07:24 AM



All times are GMT. The time now is 01:23 PM.


vBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc. Logos and trademarks are the property of Voxilla or their respective owner. All other content © 2003-2007 by Voxilla, Inc.