diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-21 00:07:56 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-21 00:07:56 +0000 |
commit | 9e8b32b39c3ee7a83f4d00febfe7d1d6e421516e (patch) | |
tree | 369252e4ce57f37a8e9e1d3ff7b800a667fb016a /channels/chan_h323.c | |
parent | 625e2c693e6230c2e0aafd11089fafbd09229d19 (diff) |
Fix G.729 name annoucement to Open H.323 and inform Asterisk's RTP stack specifically which codec we are expecting.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4508 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_h323.c')
-rwxr-xr-x | channels/chan_h323.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/channels/chan_h323.c b/channels/chan_h323.c index 6b6730481..6309404ed 100755 --- a/channels/chan_h323.c +++ b/channels/chan_h323.c @@ -1167,14 +1167,24 @@ struct rtp_info *external_rtp_create(unsigned call_reference, const char * token int progress(unsigned call_reference, const char *token, int inband); /** + * Definition taken from rtp.c for rtpPayloadType because we need it here. + */ +struct rtpPayloadType { + int isAstFormat; /* whether the following code is an AST_FORMAT */ + int code; +}; + +/** * Call-back function passing remote ip/port information from H.323 to asterisk * * Returns nothing */ -void setup_rtp_connection(unsigned call_reference, const char *remoteIp, int remotePort, const char *token) +void setup_rtp_connection(unsigned call_reference, const char *remoteIp, int remotePort, const char *token, int pt) { struct oh323_pvt *pvt = NULL; struct sockaddr_in them; + struct rtpPayloadType rtptype; + int fmt; /* Find the call or allocate a private structure if call not found */ pvt = find_call(call_reference, token); @@ -1182,6 +1192,19 @@ void setup_rtp_connection(unsigned call_reference, const char *remoteIp, int rem ast_log(LOG_ERROR, "Something is wrong: rtp\n"); return; } + + rtptype = ast_rtp_lookup_pt(pvt->rtp, pt); + + fmt = ast_best_codec(pvt->owner->nativeformats); + + ast_mutex_lock(&pvt->lock); + pvt->owner->nativeformats = rtptype.code; + pvt->owner->readformat = fmt; + pvt->owner->writeformat = fmt; + ast_set_read_format(pvt->owner, pvt->owner->readformat); + ast_set_write_format(pvt->owner, pvt->owner->writeformat); + ast_mutex_unlock(&pvt->lock); + them.sin_family = AF_INET; /* only works for IPv4 */ them.sin_addr.s_addr = inet_addr(remoteIp); @@ -1191,6 +1214,7 @@ void setup_rtp_connection(unsigned call_reference, const char *remoteIp, int rem if (pvt->options.progress_audio) { progress(call_reference, token, 1); } + return; } |