[asterisk-commits] oej: branch oej/midcomstuff r53579 -
/team/oej/midcomstuff/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Feb 8 10:04:44 MST 2007
Author: oej
Date: Thu Feb 8 11:04:43 2007
New Revision: 53579
URL: http://svn.digium.com/view/asterisk?view=rev&rev=53579
Log:
Updates from Ranch
Modified:
team/oej/midcomstuff/channels/chan_sip.c
Modified: team/oej/midcomstuff/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/midcomstuff/channels/chan_sip.c?view=diff&rev=53579&r1=53578&r2=53579
==============================================================================
--- team/oej/midcomstuff/channels/chan_sip.c (original)
+++ team/oej/midcomstuff/channels/chan_sip.c Thu Feb 8 11:04:43 2007
@@ -1538,7 +1538,7 @@
/* All of these need documentation! */
static void sip_rtp_get_peer_audio_helper(void *p, struct sockaddr_in *them);
static void sip_rtp_get_peer_video_helper(void *p, struct sockaddr_in *them);
-static void sip_rtp_get_us_audio_helper(void *p, struct sockaddr_in *sin);
+static void sip_rtp_get_us_audio_helper(void *p, struct sockaddr_in *sin, struct sockaddr_in *pbx_rtp);
static void sip_rtp_get_us_video_helper(void *p, struct sockaddr_in *vsin);
static void sip_map_hook_struct(void *p, void *r);
static void *sip_get_hook_struct(void *p);
@@ -1548,7 +1548,7 @@
static char *sip_get_username(void *p);
static struct ast_channel *sip_channel_helper(void *p);
static struct ast_channel *sip_bridged_channel_helper(void *p);
-static int sip_get_capability_helper(void *p);
+static int sip_get_capability_helper(void *p, int *codec, int *dtmf_payload);
static void sip_softhangup_helper(void *p);
extern struct ast_sip_hook_cb *midcom_cb;
@@ -1662,11 +1662,19 @@
ast_rtp_get_peer(((struct sip_pvt*)p)->vrtp, them);
}
-static void sip_rtp_get_us_audio_helper(void *p, struct sockaddr_in *sin)
-{
+static void sip_rtp_get_us_audio_helper(void *p, struct sockaddr_in *sin, struct sockaddr_in *pbx_rtp )
+{
+ struct sockaddr_in them;
+
ast_rtp_get_us(((struct sip_pvt*)p)->rtp, sin);
sin->sin_addr = ((struct sip_pvt*)p)->ourip;
-}
+ if( pbx_rtp ) {
+ ast_rtp_get_peer( ((struct sip_pvt*)p)->rtp, &them );
+ ast_ouraddrfor( &(them.sin_addr), &(pbx_rtp->sin_addr));
+ pbx_rtp->sin_port = sin->sin_port;
+ }
+}
+
static void sip_rtp_get_us_video_helper(void *p, struct sockaddr_in *vsin)
{
@@ -1729,10 +1737,13 @@
/*! \brief Get capabilities for a call, after setup. This possibly
needs to be done for video too */
-static int sip_get_capability_helper(void *p)
-{
- struct sip_pvt *dialog = (struct sip_pvt *) p;
- return (dialog->jointcapability);
+static void sip_get_capability_helper(void *p, int *codec, int *dtmf_payload )
+{
+ if( codec )
+ *codec = ((struct sip_pvt*)p)->jointcapability;
+ if( dtmf_payload ) {
+ *dtmf_payload = ast_rtp_lookup_code( ((struct sip_pvt*)p)->rtp, 0, AST_RTP_DTMF);
+ }
}
static void sip_softhangup_helper(void *p)
More information about the asterisk-commits
mailing list