<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Lior Gradstein's Blog &#187; asterisk</title>
	<atom:link href="http://www.gradstein.info/category/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gradstein.info</link>
	<description></description>
	<pubDate>Mon, 29 Sep 2008 12:39:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Change in syntax and functionality in Asterisk AstDB functions</title>
		<link>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</link>
		<comments>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/#comments</comments>
		<pubDate>Mon, 14 May 2007 10:32:00 +0000</pubDate>
		<dc:creator>Lior Gradstein</dc:creator>
		
		<category><![CDATA[asterisk]]></category>

	<!-- AutoMeta Start -->
	<category>access</category>
	<category>the</category>
	<category>astdb</category>
	<category>database</category>
	<category>a</category>
	<category>berkeley</category>
	<category>local</category>
	<category>database</category>
	<category>2</category>
	<category>background one_local forward forward_number_is</category>
	<category>3</category>
	<category>background one_local forward forward_number_is</category>
	<category>1</category>
	<category>gotoif   db_exists forward   f_ext</category>
	<category>1</category>
	<category>set forward_number   db forward 1234</category>
	<category>1</category>
	<category>my</category>
	<category>newly</category>
	<category>installed</category>
	<category>asterisk</category>
	<category>1 4 4</category>
	<category>3</category>
	<category>sayalpha   forward_number</category>
	<category>4</category>
	<category>sayalpha   forward_number</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://www.gradstein.info/uncategorized/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/</guid>
		<description><![CDATA[Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; one named Set (except for DbDel which seems to still exist). There was a functionnality that when a key was not found in AstDB, a jump would be done to n+101. So the [...]]]></description>
			<content:encoded><![CDATA[<p>Since Asterisk 1.2+, the methods to access the AstDB database (a berkeley local database) were changed from DBGet,DBPut,DBDel to the merged &#8220;simpler&#8221; one named Set (except for DbDel which seems to still exist). There was a functionnality that when a key was not found in AstDB, a jump would be done to n+101. So the following would be OK:</p>
<p class="code">exten = s,1,Set(forward_number=${DB(FORWARD/1234)})<br />
exten = s,2,Background(one_local/forward/forward_number_is)<br />
exten = s,3,sayalpha(${forward_number})<br />
exten = s,4,Goto(s-report_mode,1)<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)<br />
exten = s,103,Goto(s-not_set,1)</p>
<p>But with my newly installed Asterisk 1.4.4, it doesn&#8217;t jump anymore. It continues to s,2 :-(.<br />
So I guess I need to add a <a href="http://www.voip-info.org/wiki/view/Asterisk+func+db_exists" class="liexternal">supplementary line</a> to explicitely test the presence of the key:</p>
<p class="code">exten = s,1,GotoIf(${DB_EXISTS(FORWARD/${F_EXT})}?:102)<br />
exten = s,2,Set(forward_number=${DB_RESULT})<br />
exten = s,3,Background(one_local/forward/forward_number_is)<br />
exten = s,4,sayalpha(${forward_number})<br />
&#8230;<br />
exten = s,102,NoOp(Pas de valeur ce qui est normal)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gradstein.info/asterisk/change-in-syntax-and-functionnality-in-asterisk-astdb-functions/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
