[asterisk-users] requirecalltoken and Realtime

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Fri Sep 4 13:09:02 CDT 2009


On Friday 04 September 2009 12:08:26 Gary Hawkins wrote:
> I've just had to enable the requirecalltoken=no option in iax.conf for
> one of my IAX2 trunks, and I don't think it works properly in the
> realtime version.  I've created the requirecalltoken field in my
> (Postgres via ODBC) database, type text, and have variously tried it
> with 'yes', 'no' and 'auto' in the field.  But the setting never seems
> to be used and thus calls fail down the trunk.
>
> If I try the same thing using iax.conf flat file, the requirecalltoken
> parameter works fine, so I was wondering if anyone else has seen this
> and wonder if I've tripped over a bug?

Please try the attached patch.

-- 
Tilghman & Teryl
with Peter, Cottontail, Midnight, Thumper, & Johnny (bunnies)
and Harry, BB, & George (dogs)
-------------- next part --------------
Index: channels/chan_iax2.c
===================================================================
--- channels/chan_iax2.c	(revision 216548)
+++ channels/chan_iax2.c	(working copy)
@@ -1894,8 +1894,10 @@
 	/* ----- Case 2 ----- */
 	if ((subclass == IAX_COMMAND_NEW) && (user = find_user(find))) {
 		calltoken_required = user->calltoken_required;
-	} else if ((subclass != IAX_COMMAND_NEW) && (peer = find_peer(find, 1))) {
+	} else if ((subclass != IAX_COMMAND_NEW) && (peer = find_peer(find, 0))) {
 		calltoken_required = peer->calltoken_required;
+	} else if ((subclass != IAX_COMMAND_NEW) && (peer = realtime_peer(find, sin))) {
+		calltoken_required = peer->calltoken_required;
 	}
 
 	if (peer) {


More information about the asterisk-users mailing list