[asterisk-dev] IP address only dialing

David Woodfall dave at dawoodfall.net
Sun May 8 21:04:19 CDT 2011


Following on from the conversation on the forum about getting 404
errors back when dialing just an IP address I had a look at the code
to see if I could come up with a solution.

It seems that the routine that makes the extension to 's' was never
being reached. Instead it fell through to a switch that gave a 404
error. The attached patch puts in an extra test to stop that.

The chances are it's not a great solution and may break other things.
I'm not really much of a C coder and am not really familiar with
asterisk source. It's also a pain editing a 21000 line file in Vim ;)

Anyway I hope that the patch is useful.

Cheers

Dave

-- 
Don't look back, the lemmings are gaining on you.
-------------- next part --------------
diff -Naur a/channels/chan_sip.c b/channels/chan_sip.c
--- a/channels/chan_sip.c	2011-04-21 20:42:56.000000000 +0100
+++ b/channels/chan_sip.c	2011-05-09 02:18:36.000000000 +0100
@@ -21463,8 +21463,7 @@
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_DTMF, ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
 			ast_rtp_instance_set_prop(p->rtp, AST_RTP_PROPERTY_DTMF_COMPENSATE, ast_test_flag(&p->flags[1], SIP_PAGE2_RFC2833_COMPENSATE));
 		}
-
-		if (!replace_id && (gotdest != SIP_GET_DEST_EXTEN_FOUND)) {	/* No matching extension found */
+		if (!replace_id && gotdest != SIP_GET_DEST_EXTEN_FOUND && gotdest != SIP_GET_DEST_PICKUP_EXTEN_FOUND) {	/* No matching extension found */
 			switch(gotdest) {
 			case SIP_GET_DEST_INVALID_URI:
 				transmit_response_reliable(p, "416 Unsupported URI scheme", req);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110509/6583aaae/attachment.pgp>


More information about the asterisk-dev mailing list